2015-06-29 15:40:24 +02:00
|
|
|
<?php
|
|
|
|
|
2015-10-20 22:34:04 +02:00
|
|
|
namespace Icinga\Module\Director\Controllers;
|
|
|
|
|
2017-07-20 22:35:41 +02:00
|
|
|
use Icinga\Module\Director\Forms\KickstartForm;
|
2017-07-06 11:41:29 +02:00
|
|
|
use Icinga\Module\Director\Forms\SelfServiceSettingsForm;
|
|
|
|
use Icinga\Module\Director\Settings;
|
2015-06-30 11:27:32 +02:00
|
|
|
use Icinga\Module\Director\Web\Controller\ActionController;
|
2019-05-02 13:23:06 +02:00
|
|
|
use ipl\Html\Html;
|
2015-06-29 15:40:24 +02:00
|
|
|
|
2015-10-20 22:34:04 +02:00
|
|
|
class SettingsController extends ActionController
|
2015-06-29 15:40:24 +02:00
|
|
|
{
|
2018-05-08 19:54:00 +02:00
|
|
|
/**
|
|
|
|
* @throws \Icinga\Exception\Http\HttpNotFoundException
|
|
|
|
*/
|
2017-07-20 22:35:41 +02: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 19:54:00 +02:00
|
|
|
/**
|
|
|
|
* @throws \Icinga\Exception\ConfigurationError
|
|
|
|
* @throws \Icinga\Exception\IcingaException
|
|
|
|
*/
|
2017-07-06 11:41:29 +02:00
|
|
|
public function selfServiceAction()
|
|
|
|
{
|
|
|
|
$form = SelfServiceSettingsForm::create($this->db(), new Settings($this->db()));
|
2017-07-06 17:20:22 +02:00
|
|
|
$form->handleRequest();
|
2017-07-06 11:41:29 +02: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 17:00:25 +02:00
|
|
|
->addTitle($this->translate('Self Service API - Global Settings'))
|
2018-05-08 19:54:00 +02:00
|
|
|
->content()->add(Html::tag('p', null, $hint))
|
2017-07-06 11:41:29 +02:00
|
|
|
->add($form);
|
|
|
|
}
|
2015-06-29 15:40:24 +02:00
|
|
|
}
|