-
Notifications
You must be signed in to change notification settings - Fork 275
/
IndexController.php
43 lines (37 loc) · 1.05 KB
/
IndexController.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
use Icinga\Web\Controller\ModuleActionController;
use Icinga\Module\Setup\WebWizard;
class Setup_IndexController extends ModuleActionController
{
/**
* 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 and run the configuration once finished
*/
public function indexAction()
{
$wizard = new WebWizard();
if ($wizard->isFinished()) {
$setup = $wizard->getSetup();
$success = $setup->run();
if ($success) {
$wizard->clearSession();
} else {
$wizard->setIsFinished(false);
}
$this->view->success = $success;
$this->view->report = $setup->getReport();
} else {
$wizard->handleRequest();
}
$this->view->wizard = $wizard;
}
}