mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 14:54:24 +02:00
Initiate full page reload upon CSP
config change
This commit is contained in:
parent
e3ebe109eb
commit
3b7f054534
@ -96,7 +96,18 @@ class ConfigController extends Controller
|
|||||||
$this->assertPermission('config/general');
|
$this->assertPermission('config/general');
|
||||||
$form = new GeneralConfigForm();
|
$form = new GeneralConfigForm();
|
||||||
$form->setIniConfig(Config::app());
|
$form->setIniConfig(Config::app());
|
||||||
$form->handleRequest();
|
$form->setOnSuccess(function (GeneralConfigForm $form) {
|
||||||
|
$config = Config::app();
|
||||||
|
$useStrictCsp = (bool) $config->get('security', 'use_strict_csp', false);
|
||||||
|
if ($form->onSuccess() === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$appConfigForm = $form->getSubForm('form_config_general_application');
|
||||||
|
if ($appConfigForm && (bool) $appConfigForm->getValue('security_use_strict_csp') !== $useStrictCsp) {
|
||||||
|
$this->getResponse()->setReloadWindow(true);
|
||||||
|
}
|
||||||
|
})->handleRequest();
|
||||||
|
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
$this->view->title = $this->translate('General');
|
$this->view->title = $this->translate('General');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user