2014-09-10 08:48:33 -04:00
|
|
|
<?php
|
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
|
|
2014-11-10 10:43:37 -05:00
|
|
|
use Icinga\Web\Controller\ModuleActionController;
|
2014-11-10 10:31:40 -05:00
|
|
|
use Icinga\Module\Setup\WebWizard;
|
2014-09-10 08:48:33 -04:00
|
|
|
|
2014-11-10 10:43:37 -05:00
|
|
|
class Setup_IndexController extends ModuleActionController
|
2014-09-10 08:48:33 -04:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Whether the controller requires the user to be authenticated
|
|
|
|
|
*
|
|
|
|
|
* FALSE as the wizard uses token authentication
|
|
|
|
|
*
|
|
|
|
|
* @var bool
|
|
|
|
|
*/
|
|
|
|
|
protected $requiresAuthentication = false;
|
|
|
|
|
|
|
|
|
|
/**
|
2014-11-10 04:30:52 -05:00
|
|
|
* Show the web wizard and run the configuration once finished
|
2014-09-10 08:48:33 -04:00
|
|
|
*/
|
|
|
|
|
public function indexAction()
|
|
|
|
|
{
|
2014-11-10 04:30:52 -05:00
|
|
|
$wizard = new WebWizard();
|
2014-09-29 08:31:43 -04:00
|
|
|
|
|
|
|
|
if ($wizard->isFinished()) {
|
2014-11-10 04:30:52 -05:00
|
|
|
$setup = $wizard->getSetup();
|
|
|
|
|
$success = $setup->run();
|
2014-09-29 08:31:43 -04:00
|
|
|
if ($success) {
|
2014-10-24 07:55:41 -04:00
|
|
|
$wizard->clearSession();
|
2014-09-29 08:31:43 -04:00
|
|
|
} else {
|
|
|
|
|
$wizard->setIsFinished(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->view->success = $success;
|
2014-11-10 04:30:52 -05:00
|
|
|
$this->view->report = $setup->getReport();
|
2014-09-29 08:31:43 -04:00
|
|
|
} else {
|
|
|
|
|
$wizard->handleRequest();
|
|
|
|
|
}
|
2014-10-14 10:14:28 -04:00
|
|
|
|
|
|
|
|
$this->view->wizard = $wizard;
|
2014-09-10 08:48:33 -04:00
|
|
|
}
|
|
|
|
|
}
|