2015-06-17 07:31:51 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use Icinga\Module\Director\ActionController;
|
|
|
|
|
|
|
|
|
|
use Icinga\Module\Director\IcingaConfig\IcingaConfig;
|
2015-06-23 08:37:23 -04:00
|
|
|
use Icinga\Module\Director\Util;
|
2015-06-17 07:31:51 -04:00
|
|
|
|
2015-06-17 12:57:51 -04:00
|
|
|
class Director_ConfigController extends ActionController
|
2015-06-17 07:31:51 -04:00
|
|
|
{
|
|
|
|
|
public function showAction()
|
|
|
|
|
{
|
2015-06-23 08:37:23 -04:00
|
|
|
$this->view->config = IcingaConfig::fromDb(Util::hex2binary($this->params->get('checksum')), $this->db());
|
2015-06-17 07:31:51 -04:00
|
|
|
}
|
2015-06-17 12:57:51 -04:00
|
|
|
|
|
|
|
|
public function storeAction()
|
|
|
|
|
{
|
|
|
|
|
/** @var IcingaConfig $config */
|
|
|
|
|
$config = IcingaConfig::generate($this->db());
|
2015-06-17 13:04:04 -04:00
|
|
|
$this->view->id = $config->getHexChecksum();
|
2015-06-17 12:57:51 -04:00
|
|
|
}
|
2015-06-17 07:31:51 -04:00
|
|
|
}
|