mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-21 12:54:26 +02:00
parent
9f923b4940
commit
b09b3676de
@ -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
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user