diff --git a/lib/NWNDriver.php b/lib/NWNDriver.php index 048ef5a..0831f92 100644 --- a/lib/NWNDriver.php +++ b/lib/NWNDriver.php @@ -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 . ' > ' . diff --git a/lib/ServerForms.php b/lib/ServerForms.php index e4b39e7..31de4c8 100644 --- a/lib/ServerForms.php +++ b/lib/ServerForms.php @@ -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")); diff --git a/server.php b/server.php index 7b394e0..b412bee 100644 --- a/server.php +++ b/server.php @@ -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'); } }