mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-25 18:59:04 +02:00
general config: Don't keep unused configuration directives
This commit is contained in:
parent
92b4f4fbec
commit
f9e7e6d888
@ -40,13 +40,16 @@ class GeneralConfigForm extends ConfigForm
|
|||||||
*/
|
*/
|
||||||
public function onSuccess(Request $request)
|
public function onSuccess(Request $request)
|
||||||
{
|
{
|
||||||
|
$sections = array();
|
||||||
foreach ($this->getValues() as $sectionAndPropertyName => $value) {
|
foreach ($this->getValues() as $sectionAndPropertyName => $value) {
|
||||||
list($section, $property) = explode('_', $sectionAndPropertyName);
|
list($section, $property) = explode('_', $sectionAndPropertyName);
|
||||||
if (isset($this->config->{$section})) {
|
if (! isset($sections[$section])) {
|
||||||
$this->config->{$section}->{$property} = $value;
|
$sections[$section] = array();
|
||||||
} else {
|
|
||||||
$this->config->{$section} = array($property => $value);
|
|
||||||
}
|
}
|
||||||
|
$sections[$section][$property] = $value;
|
||||||
|
}
|
||||||
|
foreach ($sections as $section => $config) {
|
||||||
|
$this->config->{$section} = $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->save()) {
|
if ($this->save()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user