Fixed some problems where the server settings were not being properly loaded.

master
penguinc 2005-01-23 19:48:33 +00:00
parent 88e4f795a6
commit b0be607210
3 changed files with 9 additions and 12 deletions

View File

@ -172,13 +172,9 @@ class NWNDriver
unset($settings['module']);
$settingString = '';
foreach ($settings as $key => $val) {
if (!empty($val)) {
if (is_int($val)) {
$settingString .= sprintf(" -%s %s ", $key, $val);
} else {
$settingString .= sprintf(" -%s '%s' ", $key,
escapeshellcmd($val));
}
if (!is_null($val) && $val !== '') {
$settingString .= sprintf(" -%s '%s' ", $key,
escapeshellcmd($val));
}
}
shell_exec(NWNAdmin::getServerExecutable() .$settingString . ' > ' .

View File

@ -33,10 +33,10 @@ class ServerSettings extends Horde_Form
'1' => 'Server Characters Only')));
$this->addVariable(_("Enforce Legal Characters"), 'elc', 'enum',
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',
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,
false, null, array(array('0' => 'Action', '1' => 'Story',
'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',
'1' => 'Reload When Empty')));
$this->addVariable(_("Server Visibility"), 'publicserver', 'enum',
true, false, null, array(array('1' => 'Private',
'0' => 'Public')));
true, false, null, array(array('0' => 'Private',
'1' => 'Public')));
$this->setTitle(_("Configure Server Settings"));
$this->setButtons(_("Update Config"));

View File

@ -67,7 +67,8 @@ if ($valid) {
}
}
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');
}
}