mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
parent
c06db7495b
commit
644b3a1628
@ -366,23 +366,25 @@ class ConfigController extends BaseConfigController
|
|||||||
|
|
||||||
$configArray = IcingaConfig::app('authentication', true)->toArray();
|
$configArray = IcingaConfig::app('authentication', true)->toArray();
|
||||||
$authBackend = $this->getParam('auth_backend');
|
$authBackend = $this->getParam('auth_backend');
|
||||||
if (!isset($configArray[$authBackend])) {
|
if (false === array_key_exists($authBackend, $configArray)) {
|
||||||
Notification::error('Can\'t perform removal: Unknown Authentication Backend Provided');
|
$this->addErrorMessage(
|
||||||
$this->render('authentication/remove');
|
$this->translate('Can\'t perform removal: Unknown authentication backend provided')
|
||||||
return;
|
);
|
||||||
|
$this->redirectNow('config/configurationerror');
|
||||||
}
|
}
|
||||||
|
|
||||||
$form = new ConfirmRemovalForm();
|
$form = new ConfirmRemovalForm();
|
||||||
$form->setRequest($this->getRequest());
|
$request = $this->getRequest();
|
||||||
$form->setRemoveTarget('auth_backend', $authBackend);
|
|
||||||
|
|
||||||
if ($form->isSubmittedAndValid()) {
|
if ($request->isPost() && $form->isValid($request->getPost())) {
|
||||||
unset($configArray[$authBackend]);
|
unset($configArray[$authBackend]);
|
||||||
if ($this->writeAuthenticationFile($configArray)) {
|
if ($this->writeAuthenticationFile($configArray)) {
|
||||||
Notification::success('Authentication Backend "' . $authBackend . '" Removed');
|
Notification::success(sprintf(
|
||||||
$this->redirectNow("config/authentication");
|
$this->translate('Authentication Backend "%s" Removed'),
|
||||||
|
$authBackend
|
||||||
|
));
|
||||||
|
$this->redirectNow('config/authentication');
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
<h4>
|
<h4>
|
||||||
<i class="icinga-icon-remove"></i>
|
<?php printf(
|
||||||
Remove Backend "<?= $this->escape($this->name); ?>"
|
$this->translate('Remove Backend "%s"'),
|
||||||
|
$this->escape($name)
|
||||||
|
); ?>
|
||||||
</h4>
|
</h4>
|
||||||
|
<?= $messageBox ?>
|
||||||
<?php if (isset($this->messageBox)): ?>
|
<?= $form ?>
|
||||||
<?= $this->messageBox->render() ?>
|
|
||||||
<?php endif ?>
|
|
||||||
|
|
||||||
<?= $this->form ?>
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user