From 74e142c3d7da7c5cdd01217b6a09f39f6d306ca5 Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Fri, 6 Feb 2015 14:28:25 -0500 Subject: [PATCH] Fix for ACL REST error --- .../application/controllers/plugins/Acl_plugin.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/controllers/plugins/Acl_plugin.php b/airtime_mvc/application/controllers/plugins/Acl_plugin.php index b7b852129..79493ac8f 100644 --- a/airtime_mvc/application/controllers/plugins/Acl_plugin.php +++ b/airtime_mvc/application/controllers/plugins/Acl_plugin.php @@ -118,8 +118,10 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract // If we don't have an identity and we're making a RESTful request, // we need to do API key verification if ($request->getModuleName() == "rest") { - $this->verifyAuth(); - return; + if (!$this->verifyAuth()) { + $this->getResponse()->sendResponse(); + die(); + } } if ($controller !== 'login') { @@ -185,10 +187,11 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract if ($this->verifyAPIKey()) { return true; } - + $this->getResponse() - ->setHttpResponseCode(401) - ->appendBody("ERROR: Incorrect API key."); + ->setHttpResponseCode(401) + ->appendBody("ERROR: Incorrect API key."); + return false; }