Fixed some problems where the server settings were not being properly loaded.
parent
88e4f795a6
commit
b0be607210
|
@ -172,15 +172,11 @@ class NWNDriver
|
||||||
unset($settings['module']);
|
unset($settings['module']);
|
||||||
$settingString = '';
|
$settingString = '';
|
||||||
foreach ($settings as $key => $val) {
|
foreach ($settings as $key => $val) {
|
||||||
if (!empty($val)) {
|
if (!is_null($val) && $val !== '') {
|
||||||
if (is_int($val)) {
|
|
||||||
$settingString .= sprintf(" -%s %s ", $key, $val);
|
|
||||||
} else {
|
|
||||||
$settingString .= sprintf(" -%s '%s' ", $key,
|
$settingString .= sprintf(" -%s '%s' ", $key,
|
||||||
escapeshellcmd($val));
|
escapeshellcmd($val));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
shell_exec(NWNAdmin::getServerExecutable() .$settingString . ' > ' .
|
shell_exec(NWNAdmin::getServerExecutable() .$settingString . ' > ' .
|
||||||
$this->_getLog() . ' 2>&1 < ' . $this->_checkFifo() . ' &');
|
$this->_getLog() . ' 2>&1 < ' . $this->_checkFifo() . ' &');
|
||||||
$this->_settingsbackend->setData($settings);
|
$this->_settingsbackend->setData($settings);
|
||||||
|
|
|
@ -33,10 +33,10 @@ class ServerSettings extends Horde_Form
|
||||||
'1' => 'Server Characters Only')));
|
'1' => 'Server Characters Only')));
|
||||||
$this->addVariable(_("Enforce Legal Characters"), 'elc', 'enum',
|
$this->addVariable(_("Enforce Legal Characters"), 'elc', 'enum',
|
||||||
true, false, null, array(array(
|
true, false, null, array(array(
|
||||||
'0' => 'Enforce Legal Characters', '1' => 'Any Characters')));
|
'1' => 'Enforce Legal Characters', '0' => 'Any Characters')));
|
||||||
$this->addVariable(_("Item Level Restrictions"), 'ilr', 'enum',
|
$this->addVariable(_("Item Level Restrictions"), 'ilr', 'enum',
|
||||||
true, false, null, array(array(
|
true, false, null, array(array(
|
||||||
'0' => 'Enforce Item Restrictions', '1' => 'Any Items')));
|
'1' => 'Enforce Item Restrictions', '0' => 'Any Items')));
|
||||||
$this->addVariable(_("Game Type"), 'gametype', 'enum', true,
|
$this->addVariable(_("Game Type"), 'gametype', 'enum', true,
|
||||||
false, null, array(array('0' => 'Action', '1' => 'Story',
|
false, null, array(array('0' => 'Action', '1' => 'Story',
|
||||||
'2' => 'Story Lite', '3' => 'Role Play', '4' => 'Team',
|
'2' => 'Story Lite', '3' => 'Role Play', '4' => 'Team',
|
||||||
|
@ -55,8 +55,8 @@ class ServerSettings extends Horde_Form
|
||||||
true, false, null, array(array('0' => 'Persistent Module',
|
true, false, null, array(array('0' => 'Persistent Module',
|
||||||
'1' => 'Reload When Empty')));
|
'1' => 'Reload When Empty')));
|
||||||
$this->addVariable(_("Server Visibility"), 'publicserver', 'enum',
|
$this->addVariable(_("Server Visibility"), 'publicserver', 'enum',
|
||||||
true, false, null, array(array('1' => 'Private',
|
true, false, null, array(array('0' => 'Private',
|
||||||
'0' => 'Public')));
|
'1' => 'Public')));
|
||||||
|
|
||||||
$this->setTitle(_("Configure Server Settings"));
|
$this->setTitle(_("Configure Server Settings"));
|
||||||
$this->setButtons(_("Update Config"));
|
$this->setButtons(_("Update Config"));
|
||||||
|
|
|
@ -67,7 +67,8 @@ if ($valid) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!is_a($result, 'PEAR_Error')) {
|
if (!is_a($result, 'PEAR_Error')) {
|
||||||
$notification->push(_("Server settings loaded successfully."),
|
$notification->push(_("Server settings loaded successfully. " .
|
||||||
|
"Some settings require a server restart to take effect!"),
|
||||||
'horde.success');
|
'horde.success');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue