r3888 Michael Tiernan: If anyone is interested, I modified the
[racktables] / ajax.php
index b7620ec4a211ef7518aa2f49c4a5c3d377f80fae..928507c92c808236f8037471b2014075bf8b285c 100644 (file)
--- a/ajax.php
+++ b/ajax.php
@@ -16,10 +16,9 @@ if (!permitted())
 switch ($_REQUEST['ac'])
 {
        case 'verifyCode':
 switch ($_REQUEST['ac'])
 {
        case 'verifyCode':
-               $code = str_replace ('\r', '', str_replace ('\n', "\n", $_REQUEST['code']));
-               $result = getRackCode($code);
+               $result = getRackCode (dos2unix ($_REQUEST['code']));
                if ($result['result'] == 'ACK')
                if ($result['result'] == 'ACK')
-                       echo 'ACK';
+                       echo "ACK\n";
                else
                        echo "NAK\n".$result['load'];
        break;
                else
                        echo "NAK\n".$result['load'];
        break;
@@ -29,7 +28,7 @@ ob_end_flush();
 catch (Exception $e)
 {
        ob_end_clean();
 catch (Exception $e)
 {
        ob_end_clean();
-       printException($e);
+       echo "NAK\nRuntime exception";
 }
 
 ?>
 }
 
 ?>