r2809 - pull bugfix into trunk
[racktables] / process.php
1 <?php
2
3 // Include init after ophandlers, not before, so local.php can redefine things later.
4 require 'inc/ophandlers.php';
5 require 'inc/init.php';
6
7 // FIXME: find a better way to handle this error
8 if ($_REQUEST['op'] == 'addFile' && !isset($_FILES['file']['error'])) {
9 showError ("File upload error, it's size probably exceeds upload_max_filesize directive in php.ini");
10 die;
11 }
12 fixContext();
13
14 if (!strlen ($op) or !isset ($ophandler[$pageno][$tabno][$op]))
15 {
16 showError ("Invalid request in operation broker: page '${pageno}', tab '${tabno}', op '${op}'", __FILE__);
17 die();
18 }
19
20 // We have a chance to handle an error before starting HTTP header.
21 if (!isset ($delayauth[$pageno][$tabno][$op]) and !permitted())
22 $location = buildWideRedirectURL (oneLiner (157)); // operation not permitted
23 else
24 {
25 $location = $ophandler[$pageno][$tabno][$op]();
26 if (!strlen ($location))
27 {
28 showError ('Operation handler failed to return its status', __FILE__);
29 }
30 }
31 header ("Location: " . $location);
32
33 ?>