2015-06-17 13:31:51 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Icinga\Module\Director\IcingaConfig\IcingaConfig;
|
2015-06-23 14:37:23 +02:00
|
|
|
use Icinga\Module\Director\Util;
|
2015-06-30 11:27:32 +02:00
|
|
|
use Icinga\Module\Director\Web\Controller\ActionController;
|
2015-06-29 10:13:39 +02:00
|
|
|
use Icinga\Web\Url;
|
2015-06-17 13:31:51 +02:00
|
|
|
|
2015-06-17 18:57:51 +02:00
|
|
|
class Director_ConfigController extends ActionController
|
2015-06-17 13:31:51 +02:00
|
|
|
{
|
|
|
|
public function showAction()
|
|
|
|
{
|
2015-06-23 14:37:23 +02:00
|
|
|
$this->view->config = IcingaConfig::fromDb(Util::hex2binary($this->params->get('checksum')), $this->db());
|
2015-06-17 13:31:51 +02:00
|
|
|
}
|
2015-06-17 18:57:51 +02:00
|
|
|
|
|
|
|
public function storeAction()
|
|
|
|
{
|
|
|
|
$config = IcingaConfig::generate($this->db());
|
2015-06-29 10:13:39 +02:00
|
|
|
$this->redirectNow(
|
|
|
|
Url::fromPath('director/config/show',
|
|
|
|
array('checksum' => $config->getHexChecksum()))
|
|
|
|
);
|
2015-06-17 18:57:51 +02:00
|
|
|
}
|
2015-06-17 13:31:51 +02:00
|
|
|
}
|