r2623 move user-modifiable files to a separate dir (closes: 39)
[racktables] / process.php
CommitLineData
b325120a 1<?php
e673ee24
DO
2
3require 'inc/init.php';
e1ae3fb4
AD
4
5// FIXME: find a better way to handle this error
6if ($_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}
da958e52 10fixContext();
e673ee24 11
da958e52 12if (empty ($op) or !isset ($ophandler[$pageno][$tabno][$op]))
e673ee24 13{
b0348307 14 showError ("Invalid request in operation broker: page '${pageno}', tab '${tabno}', op '${op}'", __FILE__);
e673ee24
DO
15 die();
16}
17
18// We have a chance to handle an error before starting HTTP header.
46f92ff7 19if (!isset ($delayauth[$pageno][$tabno][$op]) and !permitted())
db55cf54 20 $location = buildWideRedirectURL (oneLiner (157)); // operation not permitted
46f92ff7 21else
7056988c 22{
46f92ff7 23 $location = $ophandler[$pageno][$tabno][$op]();
7056988c
DO
24 if (empty ($location))
25 {
26 showError ('Operation handler failed to return its status', __FILE__);
27 }
28}
e673ee24
DO
29header ("Location: " . $location);
30
31?>