r2452 Added verification for rackCode, as described in ticket #189
[racktables] / ajax.php
1 <?php
2
3 require 'inc/init.php';
4
5 fixContext();
6
7 // We have a chance to handle an error before starting HTTP header.
8 if (!permitted())
9 {
10 $errlog = array
11 (
12 'v' => 2,
13 'm' => array (0 => array ('c' => 157)) // operation not permitted
14 );
15 $location = buildWideRedirectURL ($errlog);
16 header ("Location: " . $location);
17 exit();
18 }
19
20 switch ($_GET['ac'])
21 {
22 case 'verifyCode':
23 $code = $_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 ?>