From b09b3676deac4ee2a99dbf80df0293b39db31195 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Mon, 2 Sep 2013 18:33:19 +0200 Subject: [PATCH] Rename determineAuthenticationState to requiresLogin refs #4572 --- .../Web/Controller/ActionController.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/library/Icinga/Web/Controller/ActionController.php b/library/Icinga/Web/Controller/ActionController.php index 7e9aedd69..321efebf3 100755 --- a/library/Icinga/Web/Controller/ActionController.php +++ b/library/Icinga/Web/Controller/ActionController.php @@ -56,8 +56,7 @@ class ActionController extends Zend_Controller_Action protected $replaceLayout = false; /** - * If true, this controller will be shown even when no authentication is available - * Needed mainly for the authentication controller + * Whether the controller requires the user to be authenticated * * @var bool */ @@ -97,7 +96,7 @@ class ActionController extends Zend_Controller_Action return; } - if ($this->determineAuthenticationState() === true) { + if ($this->requiresLogin() === false) { $this->view->tabs = new Tabs(); $this->init(); } else { @@ -105,18 +104,26 @@ class ActionController extends Zend_Controller_Action } } - protected function determineAuthenticationState(array $invokeArgs = array()) + /** + * Check whether the controller requires a login. That is when the controller requires authentication and the + * user is currently not authenticated + * + * @return bool + * @see requiresAuthentication + */ + protected function requiresLogin() { if (!$this->requiresAuthentication) { - return true; + return false; } - return AuthManager::getInstance( + return !AuthManager::getInstance( null, array('writeSession' => $this->modifiesSession) )->isAuthenticated(); } + /** * Return the tabs *