small bugfix

This commit is contained in:
kremsy 2014-01-24 13:11:27 +01:00 committed by Steffen Schröder
parent 0587d811c9
commit 1d644dfa18

View File

@ -100,22 +100,21 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
return false;
}
$serverSettings = $this->maniaControl->client->getServerOptions()->toArray();
$loadedSettings = array();
while($row = $result->fetch_object()) {
if(!isset($serverSettings[$row->settingName])) {
continue;
}
$loadedSettings[$row->settingName] = $row->settingValue;
settype($loadedSettings[$row->settingName], gettype($serverSettings[$row->settingName]));
$oldType = gettype($serverSettings[$row->settingName]);
$serverSettings[$row->settingName] = $row->settingValue;
settype($serverSettings[$row->settingName], $oldType);
}
$result->close();
if(!$loadedSettings) {
if(!$serverSettings) {
return true;
}
try {
$this->maniaControl->client->setServerOptions($loadedSettings);
$this->maniaControl->client->setServerOptions($serverSettings);
} catch(Exception $e) {
trigger_error('Error occured: ' . $e->getMessage());
return false;