mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
AuthenticationController: use Auth() helper function
This commit is contained in:
parent
23ed744747
commit
3fc1205175
@ -32,7 +32,6 @@
|
|||||||
|
|
||||||
use Icinga\Authentication\Backend\AutoLoginBackend;
|
use Icinga\Authentication\Backend\AutoLoginBackend;
|
||||||
use Icinga\Web\Controller\ActionController;
|
use Icinga\Web\Controller\ActionController;
|
||||||
use Icinga\Authentication\Manager as AuthManager;
|
|
||||||
use Icinga\Form\Authentication\LoginForm;
|
use Icinga\Form\Authentication\LoginForm;
|
||||||
use Icinga\Authentication\AuthChain;
|
use Icinga\Authentication\AuthChain;
|
||||||
use Icinga\Application\Config;
|
use Icinga\Application\Config;
|
||||||
@ -60,6 +59,7 @@ class AuthenticationController extends ActionController
|
|||||||
*/
|
*/
|
||||||
public function loginAction()
|
public function loginAction()
|
||||||
{
|
{
|
||||||
|
$auth = $this->Auth();
|
||||||
$this->view->form = new LoginForm();
|
$this->view->form = new LoginForm();
|
||||||
$this->view->form->setRequest($this->_request);
|
$this->view->form->setRequest($this->_request);
|
||||||
$this->view->title = $this->translate('Icingaweb Login');
|
$this->view->title = $this->translate('Icingaweb Login');
|
||||||
@ -67,8 +67,6 @@ class AuthenticationController extends ActionController
|
|||||||
try {
|
try {
|
||||||
$redirectUrl = Url::fromPath($this->params->get('redirect', 'dashboard'));
|
$redirectUrl = Url::fromPath($this->params->get('redirect', 'dashboard'));
|
||||||
|
|
||||||
$auth = AuthManager::getInstance();
|
|
||||||
|
|
||||||
if ($auth->isAuthenticated()) {
|
if ($auth->isAuthenticated()) {
|
||||||
$this->rerenderLayout()->redirectNow($redirectUrl);
|
$this->rerenderLayout()->redirectNow($redirectUrl);
|
||||||
}
|
}
|
||||||
@ -150,7 +148,7 @@ class AuthenticationController extends ActionController
|
|||||||
*/
|
*/
|
||||||
public function logoutAction()
|
public function logoutAction()
|
||||||
{
|
{
|
||||||
$auth = AuthManager::getInstance();
|
$auth = $this->Auth();
|
||||||
$auth->removeAuthorization();
|
$auth->removeAuthorization();
|
||||||
|
|
||||||
if ($auth->isAuthenticatedFromRemoteUser()) {
|
if ($auth->isAuthenticatedFromRemoteUser()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user