r3175 Returning multistring ACK in ajax
[racktables] / ajax.php
CommitLineData
11048491 1<?php
90a3d6d8
DY
2ob_start();
3try {
11048491 4
da111736 5require 'inc/init.php';
0df8c52b
DO
6$pageno = 'perms';
7$tabno = 'edit';
11048491
DY
8fixContext();
9
11048491
DY
10if (!permitted())
11{
1dcdcc47 12 echo "NAK\nPermission denied";
11048491
DY
13 exit();
14}
15
1dcdcc47 16switch ($_REQUEST['ac'])
11048491
DY
17{
18 case 'verifyCode':
1dcdcc47 19 $code = str_replace ('\r', '', str_replace ('\n', "\n", $_REQUEST['code']));
11048491
DY
20 $result = getRackCode($code);
21 if ($result['result'] == 'ACK')
2847f8aa 22 echo "ACK\n";
11048491
DY
23 else
24 echo "NAK\n".$result['load'];
25 break;
26}
90a3d6d8
DY
27ob_end_flush();
28}
29catch (Exception $e)
30{
31 ob_end_clean();
32 printException($e);
33}
11048491 34
11048491 35?>