mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
Redirect to /setup if necessary
A user gets now redirected to /setup in case he is not logged in, the token file exists and no config.ini was found. refs #7163
This commit is contained in:
parent
032437cdeb
commit
98fbfe68a8
@ -33,6 +33,17 @@ class AuthenticationController extends ActionController
|
|||||||
*/
|
*/
|
||||||
public function loginAction()
|
public function loginAction()
|
||||||
{
|
{
|
||||||
|
if (@file_exists(Config::$configDir . '/setup.token')) {
|
||||||
|
try {
|
||||||
|
$config = Config::app()->toArray();
|
||||||
|
if (empty($config)) {
|
||||||
|
$this->redirectNow(Url::fromPath('setup'));
|
||||||
|
}
|
||||||
|
} catch (NotReadableError $e) {
|
||||||
|
// Gets thrown in case of insufficient permission only
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$auth = $this->Auth();
|
$auth = $this->Auth();
|
||||||
$this->view->form = $form = new LoginForm();
|
$this->view->form = $form = new LoginForm();
|
||||||
$this->view->title = $this->translate('Icingaweb Login');
|
$this->view->title = $this->translate('Icingaweb Login');
|
||||||
|
25
application/controllers/SetupController.php
Normal file
25
application/controllers/SetupController.php
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
|
use Icinga\Web\Controller\ActionController;
|
||||||
|
|
||||||
|
class SetupController extends ActionController
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Whether the controller requires the user to be authenticated
|
||||||
|
*
|
||||||
|
* FALSE as the wizard uses token authentication
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected $requiresAuthentication = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the web wizard
|
||||||
|
*/
|
||||||
|
public function indexAction()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
0
application/views/scripts/setup/index.phtml
Normal file
0
application/views/scripts/setup/index.phtml
Normal file
Loading…
x
Reference in New Issue
Block a user