2015-06-29 09:40:24 -04:00
|
|
|
<?php
|
|
|
|
|
|
2015-10-20 16:34:04 -04:00
|
|
|
namespace Icinga\Module\Director\Controllers;
|
|
|
|
|
|
2017-07-20 16:35:41 -04:00
|
|
|
use Icinga\Module\Director\Forms\KickstartForm;
|
2017-07-06 05:41:29 -04:00
|
|
|
use Icinga\Module\Director\Forms\SelfServiceSettingsForm;
|
|
|
|
|
use Icinga\Module\Director\Settings;
|
2015-06-30 05:27:32 -04:00
|
|
|
use Icinga\Module\Director\Web\Controller\ActionController;
|
2019-05-02 07:23:06 -04:00
|
|
|
use ipl\Html\Html;
|
2015-06-29 09:40:24 -04:00
|
|
|
|
2015-10-20 16:34:04 -04:00
|
|
|
class SettingsController extends ActionController
|
2015-06-29 09:40:24 -04:00
|
|
|
{
|
2018-05-08 13:54:00 -04:00
|
|
|
/**
|
|
|
|
|
* @throws \Icinga\Exception\Http\HttpNotFoundException
|
|
|
|
|
*/
|
2017-07-20 16:35:41 -04:00
|
|
|
public function indexAction()
|
|
|
|
|
{
|
|
|
|
|
// Hint: this is for the module configuration tab, legacy code
|
|
|
|
|
$this->view->tabs = $this->Module()
|
|
|
|
|
->getConfigTabs()
|
|
|
|
|
->activate('config');
|
|
|
|
|
|
|
|
|
|
$this->view->form = KickstartForm::load()
|
|
|
|
|
->setModuleConfig($this->Config())
|
|
|
|
|
->handleRequest();
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-08 13:54:00 -04:00
|
|
|
/**
|
|
|
|
|
* @throws \Icinga\Exception\ConfigurationError
|
|
|
|
|
* @throws \Icinga\Exception\IcingaException
|
|
|
|
|
*/
|
2017-07-06 05:41:29 -04:00
|
|
|
public function selfServiceAction()
|
|
|
|
|
{
|
|
|
|
|
$form = SelfServiceSettingsForm::create($this->db(), new Settings($this->db()));
|
2017-07-06 11:20:22 -04:00
|
|
|
$form->handleRequest();
|
2017-07-06 05:41:29 -04:00
|
|
|
|
|
|
|
|
$hint = $this->translate(
|
|
|
|
|
'The Icinga Director Self Service API allows your Hosts to register'
|
|
|
|
|
. ' themselves. This allows them to get their Icinga Agent configured,'
|
|
|
|
|
. ' installed and upgraded in an automated way.'
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$this->addSingleTab($this->translate('Self Service'))
|
2017-07-20 11:00:25 -04:00
|
|
|
->addTitle($this->translate('Self Service API - Global Settings'))
|
2018-05-08 13:54:00 -04:00
|
|
|
->content()->add(Html::tag('p', null, $hint))
|
2017-07-06 05:41:29 -04:00
|
|
|
->add($form);
|
|
|
|
|
}
|
2015-06-29 09:40:24 -04:00
|
|
|
}
|