ConfigController: don't use Monitoring\Controller::$backend
refs #11392
This commit is contained in:
parent
eecd15ee68
commit
aa57981b3e
|
@ -9,6 +9,7 @@ use Icinga\Exception\ConfigurationError;
|
||||||
use Icinga\Exception\NotFoundError;
|
use Icinga\Exception\NotFoundError;
|
||||||
use Icinga\Forms\ConfirmRemovalForm;
|
use Icinga\Forms\ConfirmRemovalForm;
|
||||||
use Icinga\Web\Notification;
|
use Icinga\Web\Notification;
|
||||||
|
use Icinga\Module\Monitoring\Backend;
|
||||||
use Icinga\Module\Monitoring\Controller;
|
use Icinga\Module\Monitoring\Controller;
|
||||||
use Icinga\Module\Monitoring\Forms\Config\BackendConfigForm;
|
use Icinga\Module\Monitoring\Forms\Config\BackendConfigForm;
|
||||||
use Icinga\Module\Monitoring\Forms\Config\SecurityConfigForm;
|
use Icinga\Module\Monitoring\Forms\Config\SecurityConfigForm;
|
||||||
|
@ -199,7 +200,11 @@ class ConfigController extends Controller
|
||||||
$form->setRedirectUrl('monitoring/config');
|
$form->setRedirectUrl('monitoring/config');
|
||||||
$form->setTitle(sprintf($this->translate('Edit Command Transport %s'), $transportName));
|
$form->setTitle(sprintf($this->translate('Edit Command Transport %s'), $transportName));
|
||||||
$form->setIniConfig($this->Config('commandtransports'));
|
$form->setIniConfig($this->Config('commandtransports'));
|
||||||
$form->setInstanceNames($this->backend->select()->from('instance', array('instance_name'))->fetchColumn());
|
$form->setInstanceNames(
|
||||||
|
Backend::createBackend($this->_getParam('backend'))->select()->from(
|
||||||
|
'instance', array('instance_name')
|
||||||
|
)->fetchColumn()
|
||||||
|
);
|
||||||
$form->setOnSuccess(function (TransportConfigForm $form) use ($transportName) {
|
$form->setOnSuccess(function (TransportConfigForm $form) use ($transportName) {
|
||||||
try {
|
try {
|
||||||
$form->edit($transportName, array_map(
|
$form->edit($transportName, array_map(
|
||||||
|
@ -241,7 +246,11 @@ class ConfigController extends Controller
|
||||||
$form->setRedirectUrl('monitoring/config');
|
$form->setRedirectUrl('monitoring/config');
|
||||||
$form->setTitle($this->translate('Create New Command Transport'));
|
$form->setTitle($this->translate('Create New Command Transport'));
|
||||||
$form->setIniConfig($this->Config('commandtransports'));
|
$form->setIniConfig($this->Config('commandtransports'));
|
||||||
$form->setInstanceNames($this->backend->select()->from('instance', array('instance_name'))->fetchColumn());
|
$form->setInstanceNames(
|
||||||
|
Backend::createBackend($this->_getParam('backend'))->select()->from(
|
||||||
|
'instance', array('instance_name')
|
||||||
|
)->fetchColumn()
|
||||||
|
);
|
||||||
$form->setOnSuccess(function (TransportConfigForm $form) {
|
$form->setOnSuccess(function (TransportConfigForm $form) {
|
||||||
try {
|
try {
|
||||||
$form->add(array_filter($form->getValues()));
|
$form->add(array_filter($form->getValues()));
|
||||||
|
|
Loading…
Reference in New Issue