r3179 - reloadDictionary() call is necessary for 0.17.6
[racktables] / process.php
CommitLineData
b325120a 1<?php
90a3d6d8
DY
2ob_start();
3try {
b6a7d936
DO
4// Include init after ophandlers, not before, so local.php can redefine things later.
5require 'inc/ophandlers.php';
e673ee24 6require 'inc/init.php';
067d799f
DO
7assertStringArg ('op', __FILE__);
8$op = $_REQUEST['op'];
e1ae3fb4
AD
9
10// FIXME: find a better way to handle this error
067d799f 11if ($op == 'addFile' && !isset($_FILES['file']['error'])) {
e1ae3fb4
AD
12 showError ("File upload error, it's size probably exceeds upload_max_filesize directive in php.ini");
13 die;
14}
da958e52 15fixContext();
e673ee24 16
067d799f 17if (!isset ($ophandler[$pageno][$tabno][$op]))
e673ee24 18{
b0348307 19 showError ("Invalid request in operation broker: page '${pageno}', tab '${tabno}', op '${op}'", __FILE__);
e673ee24
DO
20 die();
21}
22
56a797ef
DO
23// This is the only exception at the moment, so its handling is hardcoded.
24if ($op == 'querySNMPData')
25 include 'inc/snmp.php';
26
e673ee24 27// We have a chance to handle an error before starting HTTP header.
46f92ff7 28if (!isset ($delayauth[$pageno][$tabno][$op]) and !permitted())
db55cf54 29 $location = buildWideRedirectURL (oneLiner (157)); // operation not permitted
46f92ff7 30else
7056988c 31{
46f92ff7 32 $location = $ophandler[$pageno][$tabno][$op]();
59a83bd8 33 if (!strlen ($location))
7056988c
DO
34 {
35 showError ('Operation handler failed to return its status', __FILE__);
36 }
37}
e673ee24 38header ("Location: " . $location);
90a3d6d8
DY
39ob_end_flush();
40}
41catch (Exception $e)
42{
43 ob_end_clean();
44 printException($e);
45}
46?>
e673ee24
DO
47
48?>