Revert "fixed IPAM config"

This reverts commit 1fe1beb930 [formerly 39b80d2ca41c21a823cdec5948e30109a81eeb2a]

Former-commit-id: e11aec8e300db083b7ce04cb74d19de276e69eb7
This commit is contained in:
daniel 2019-04-02 14:06:05 +02:00
parent 2461f826ce
commit 89bbbd2893
1 changed files with 7 additions and 10 deletions

View File

@ -81,6 +81,11 @@ function config_update_value($token, $value)
$value = ($value); $value = ($value);
} }
if (!isset($config[$token])) {
$config[$token] = $value;
return (bool) config_create_value($token, io_safe_input($value));
}
// If it has not changed. // If it has not changed.
if ($config[$token] == $value) { if ($config[$token] == $value) {
return true; return true;
@ -95,18 +100,10 @@ function config_update_value($token, $value)
['token' => $token] ['token' => $token]
); );
if ($result == 0) { if ($result === 0) {
return true; return true;
} else { } else {
if (!isset($config[$token])) { return (bool) $result;
$config[$token] = $value;
return (bool) config_create_value(
$token,
io_safe_input($value)
);
} else {
return (bool) $result;
}
} }
} }