requiresSetup()) && $icinga->setupTokenExists()) { $this->redirectNow(Url::fromPath('setup')); } $form = new LoginForm(); if ($this->Auth()->isAuthenticated()) { $this->redirectNow($form->getRedirectUrl()); } if (! $requiresSetup) { $form->handleRequest(); } $this->view->form = $form; $this->view->title = $this->translate('Icinga Web 2 Login'); $this->view->requiresSetup = $requiresSetup; } /** * Log out the current user */ public function logoutAction() { $auth = $this->Auth(); if (! $auth->isAuthenticated()) { $this->redirectToLogin(); } $isRemoteUser = $auth->getUser()->isRemoteUser(); $auth->removeAuthorization(); if ($isRemoteUser === true) { $this->getResponse()->setHttpResponseCode(401); } else { $this->redirectToLogin(); } } }