diff --git a/airtime_mvc/application/controllers/plugins/Acl_plugin.php b/airtime_mvc/application/controllers/plugins/Acl_plugin.php
index 635882391..5f6b64959 100644
--- a/airtime_mvc/application/controllers/plugins/Acl_plugin.php
+++ b/airtime_mvc/application/controllers/plugins/Acl_plugin.php
@@ -119,12 +119,12 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
// we need to do API key verification
if ($request->getModuleName() == "rest") {
if (!$this->verifyAuth()) {
- $this->denyAccess();
+ //$this->denyAccess();
//$this->getResponse()->sendResponse();
//$r->gotoSimpleAndExit('index', 'login', $request->getModuleName());
//die();
- return;
+ throw new Zend_Controller_Exception("hi", 401);
}
}
diff --git a/airtime_mvc/public/index.php b/airtime_mvc/public/index.php
index 7a99db0b3..f9c6e4fe4 100644
--- a/airtime_mvc/public/index.php
+++ b/airtime_mvc/public/index.php
@@ -92,11 +92,17 @@ try {
}
} catch (Exception $e) {
- header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
+ if ($e->getCode() == 401)
+ {
+ header($_SERVER['SERVER_PROTOCOL'] . ' 401 Unauthorized', true, 401);
+ return;
+ }
+ header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
Logging::error($e->getMessage());
+
if (VERBOSE_STACK_TRACE) {
- echo $e->getMessage();
+ echo $e->getMessage() . '
';
echo "
";
echo $e->getTraceAsString();
echo "";