Use the setup related utility functions in AuthenticationController.php

This commit is contained in:
Eric Lippmann 2014-12-29 14:30:06 +01:00
parent 611d01788f
commit 9d8fab51b1
1 changed files with 4 additions and 2 deletions

View File

@ -15,6 +15,7 @@ use Icinga\Exception\NotReadableError;
use Icinga\Exception\ConfigurationError;
use Icinga\User;
use Icinga\Web\Url;
use Icinga\Application\Icinga;
/**
* Application wide controller for authentication
@ -33,7 +34,8 @@ class AuthenticationController extends ActionController
*/
public function loginAction()
{
if (@file_exists(Config::resolvePath('setup.token')) && !@file_exists(Config::resolvePath('config.ini'))) {
$icinga = Icinga::app();
if ($icinga->setupTokenExists() && $icinga->requiresSetup()) {
$this->redirectNow(Url::fromPath('setup'));
}
@ -139,7 +141,7 @@ class AuthenticationController extends ActionController
$this->view->errorInfo = $e->getMessage();
}
$this->view->configMissing = is_dir(Config::$configDir) === false;
$this->view->requiresSetup = Icinga::app()->requiresSetup();
}
/**