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