r2623 move user-modifiable files to a separate dir (closes: 39)
[racktables] / ajax.php
1 <?php
2
3 require 'inc/init.php';
4 $_REQUEST['page'] = 'perms';
5 $_REQUEST['tab'] = 'edit';
6 fixContext();
7
8 // We have a chance to handle an error before starting HTTP header.
9 if (!permitted())
10 {
11 $errlog = array
12 (
13 'v' => 2,
14 'm' => array (0 => array ('c' => 157)) // operation not permitted
15 );
16 echo "NAK\nPermission denied";
17 exit();
18 }
19
20 switch ($_REQUEST['ac'])
21 {
22 case 'verifyCode':
23 $code = str_replace ('\r', '', str_replace ('\n', "\n", $_REQUEST['code']));
24 $result = getRackCode($code);
25 if ($result['result'] == 'ACK')
26 echo 'ACK';
27 else
28 echo "NAK\n".$result['load'];
29 break;
30 }
31
32
33 ?>