summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-11-11 01:43:34 -0500
committerEvan Prodromou <evan@status.net>2009-11-11 01:43:34 -0500
commit220f8771c6570849e2ffd510b14ea4b6197e2366 (patch)
treeb84af593ed79db44013fd36abd8e24b403982c1a
parent4258f99d2f44aebb9794a354e9614733a97e43c4 (diff)
store boolean values correctly in siteadminpanel
-rw-r--r--actions/siteadminpanel.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/actions/siteadminpanel.php b/actions/siteadminpanel.php
index 6dae12e08..e4deea962 100644
--- a/actions/siteadminpanel.php
+++ b/actions/siteadminpanel.php
@@ -91,8 +91,8 @@ class SiteadminpanelAction extends AdminPanelAction
function saveSettings()
{
static $settings = array('name', 'broughtby', 'broughtbyurl',
- 'email', 'timezone', 'language',
- 'closed', 'inviteonly', 'private');
+ 'email', 'timezone', 'language');
+ static $booleans = array('closed', 'inviteonly', 'private');
$values = array();
@@ -100,6 +100,10 @@ class SiteadminpanelAction extends AdminPanelAction
$values[$setting] = $this->trimmed($setting);
}
+ foreach ($booleans as $setting) {
+ $values[$setting] = ($this->boolean($setting)) ? 1 : 0;
+ }
+
// This throws an exception on validation errors
$this->validate($values);
@@ -110,7 +114,7 @@ class SiteadminpanelAction extends AdminPanelAction
$config->query('BEGIN');
- foreach ($settings as $setting) {
+ foreach (array_merge($settings, $booleans) as $setting) {
Config::save('site', $setting, $values[$setting]);
}