Monitoring config: use SecurityForm

refs #6641
This commit is contained in:
Alexander Klimov 2014-08-19 14:04:00 +02:00
parent 1ba3954b95
commit 65473ac8ee
2 changed files with 18 additions and 0 deletions

View File

@ -14,6 +14,7 @@ use Icinga\Module\Monitoring\Form\Config\Backend\EditBackendForm;
use Icinga\Module\Monitoring\Form\Config\Backend\CreateBackendForm;
use Icinga\Module\Monitoring\Form\Config\Instance\EditInstanceForm;
use Icinga\Module\Monitoring\Form\Config\Instance\CreateInstanceForm;
use Icinga\Module\Monitoring\Form\Config\SecurityForm;
use Icinga\Exception\NotReadableError;
@ -262,5 +263,21 @@ class Monitoring_ConfigController extends ModuleActionController
public function securityAction()
{
$this->view->tabs = $this->Module()->getConfigTabs()->activate('security');
$form = new SecurityForm();
$form->setConfiguration($this->Config()->get('security'));
$form->setRequest($this->getRequest());
if ($form->isSubmittedAndValid()) {
$config = $this->Config()->toArray();
$config['security'] = $form->getConfig();
if ($this->writeConfiguration(new Zend_Config($config))) {
Notification::success('Configuration modified successfully');
$this->redirectNow('monitoring/config/security');
} else {
$this->render('show-configuration');
return;
}
}
$this->view->form = $form;
}
}

View File

@ -1,3 +1,4 @@
<div class="controls">
<?= $this->tabs ?>
</div>
<?= $this->form ?>