diff --git a/include/class_config.inc b/include/class_config.inc index ae152d3c022606d85f96ccfd0d8bb24a8e6184a7..c0b77230207064c28110e31b202b12bfb9cee3b8 100644 --- a/include/class_config.inc +++ b/include/class_config.inc @@ -513,10 +513,13 @@ class config private function loadManagementConfig() { if (isset($this->current['MANAGEMENTCONFIG'])) { + if (!is_array($this->current['MANAGEMENTCONFIG'])) { + $this->current['MANAGEMENTCONFIG'] = array($this->current['MANAGEMENTCONFIG']); + } $value = array(); - foreach ($this->current['MANAGEMENTCONFIG'] as $value) { - list($class, $config) = explode(':', $value, 2); - $value[$class] = $config; + foreach ($this->current['MANAGEMENTCONFIG'] as $config) { + list($class, $json) = explode(':', $config, 2); + $value[$class] = $json; } $this->current['MANAGEMENTCONFIG'] = $value; } @@ -552,6 +555,8 @@ class config if (!$ldap->modify_batch($changes)) { return array($ldap->get_error()); } + $this->current['MANAGEMENTCONFIG'][$managementClass] = $managementConfig; + return array(); } /*!