Rename determineAuthenticationState to requiresLogin

refs #4572
This commit is contained in:
Eric Lippmann 2013-09-02 18:33:19 +02:00
parent 9f923b4940
commit b09b3676de

View File

@ -56,8 +56,7 @@ class ActionController extends Zend_Controller_Action
protected $replaceLayout = false; protected $replaceLayout = false;
/** /**
* If true, this controller will be shown even when no authentication is available * Whether the controller requires the user to be authenticated
* Needed mainly for the authentication controller
* *
* @var bool * @var bool
*/ */
@ -97,7 +96,7 @@ class ActionController extends Zend_Controller_Action
return; return;
} }
if ($this->determineAuthenticationState() === true) { if ($this->requiresLogin() === false) {
$this->view->tabs = new Tabs(); $this->view->tabs = new Tabs();
$this->init(); $this->init();
} else { } 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) { if (!$this->requiresAuthentication) {
return true; return false;
} }
return AuthManager::getInstance( return !AuthManager::getInstance(
null, null,
array('writeSession' => $this->modifiesSession) array('writeSession' => $this->modifiesSession)
)->isAuthenticated(); )->isAuthenticated();
} }
/** /**
* Return the tabs * Return the tabs
* *