From c686c4ad0eb83b39e66357eefec33f3502bccd4b Mon Sep 17 00:00:00 2001 From: Artur Date: Fri, 13 May 2016 12:32:17 +0300 Subject: [PATCH 1/2] fix return page fix return noauth --- src/EasyACL/Module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EasyACL/Module.php b/src/EasyACL/Module.php index f38b9c2..6e44edb 100644 --- a/src/EasyACL/Module.php +++ b/src/EasyACL/Module.php @@ -25,7 +25,7 @@ public function checkACL($e) } $app = $e->getApplication(); $locator = $app->getServiceManager(); - $auth = $locator->get('ControllerPluginManager')->get('Permission')->doAuthorization($e, $locator); + return $locator->get('ControllerPluginManager')->get('Permission')->doAuthorization($e, $locator); } public function getAutoloaderConfig() From c35b85a50b90a0ceaffc38a926ef524e0cc2088f Mon Sep 17 00:00:00 2001 From: Artur Date: Fri, 13 May 2016 12:33:11 +0300 Subject: [PATCH 2/2] fix return page fix rendering norights --- src/EasyACL/Plugin/Permission.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/EasyACL/Plugin/Permission.php b/src/EasyACL/Plugin/Permission.php index 725ea26..8fcd586 100644 --- a/src/EasyACL/Plugin/Permission.php +++ b/src/EasyACL/Plugin/Permission.php @@ -35,13 +35,15 @@ public function doAuthorization($e, $sm) if ($this->getService($sm)->getUser()&&$needed!=="EasyACL\Errors\\norights") { $url = $router->assemble(array(), array('name' => 'acl/norights')); $response = $e->getResponse(); - $response->setStatusCode(401); + $response->setStatusCode(302); $response->getHeaders()->addHeaderLine('Location', $url); + return $response; } elseif ($needed!=="EasyACL\User\login"&&$needed!=="API\login\index"&&$needed!=="EasyACL\Errors\\norights") { $url = $router->assemble(array(), array('name' => 'acl/login')); $response = $e->getResponse(); $response->setStatusCode(302); $response->getHeaders()->addHeaderLine('Location', $url); + return $response; } } }