We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 220f8771 authored by Evan Prodromou's avatar Evan Prodromou

store boolean values correctly in siteadminpanel

parent 4258f99d
......@@ -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]);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment