r3888 Michael Tiernan: If anyone is interested, I modified the
[racktables] / ajax.php
1 <?php
2 ob_start();
3 try {
4
5 require 'inc/init.php';
6 $pageno = 'perms';
7 $tabno = 'edit';
8 fixContext();
9
10 if (!permitted())
11 {
12 echo "NAK\nPermission denied";
13 exit();
14 }
15
16 switch ($_REQUEST['ac'])
17 {
18 case 'verifyCode':
19 $result = getRackCode (dos2unix ($_REQUEST['code']));
20 if ($result['result'] == 'ACK')
21 echo "ACK\n";
22 else
23 echo "NAK\n".$result['load'];
24 break;
25 }
26 ob_end_flush();
27 }
28 catch (Exception $e)
29 {
30 ob_end_clean();
31 echo "NAK\nRuntime exception";
32 }
33
34 ?>