diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-06-13 23:31:31 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-06-13 23:31:31 +0000 |
commit | 3f83de3de379652a1bd5a521f30e4a5ed922ccb8 (patch) | |
tree | 98420f37a31627c09746a13466b3fd740898e12e /usr/local/www/wizard.php | |
parent | e8a5cbf5abd3f7a40615aedc196d88c3b22abf6c (diff) | |
download | pfsense-3f83de3de379652a1bd5a521f30e4a5ed922ccb8.zip pfsense-3f83de3de379652a1bd5a521f30e4a5ed922ccb8.tar.gz |
Correctly handle checkboxes in the wizard
Diffstat (limited to 'usr/local/www/wizard.php')
-rwxr-xr-x | usr/local/www/wizard.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php index 943d2dc..a213129 100755 --- a/usr/local/www/wizard.php +++ b/usr/local/www/wizard.php @@ -81,7 +81,7 @@ if ($_POST) { if($field['unsetfield'] <> "") $unset_fields = "yes"; if($field['arraynum'] <> "") $arraynum = $field['arraynum']; if($field['bindstofield']) - update_config_field( $field['bindstofield'], $_POST[$fieldname], $unset_fields, $arraynum); + update_config_field( $field['bindstofield'], $_POST[$fieldname], $unset_fields, $arraynum, $field['type']); } } @@ -97,11 +97,20 @@ if ($_POST) { $title = $pkg['step'][$stepid]['title']; $description = $pkg['step'][$stepid]['description']; -function update_config_field($field, $updatetext, $unset, $arraynum) { +function update_config_field($field, $updatetext, $unset, $arraynum, $field_type) { global $config; $field_split = split("->",$field); foreach ($field_split as $f) $field_conv .= "['" . $f . "']"; if($field_conv == "") return; + if($field_type == "checkbox" and $updatetext <> "on") { + /* + item is a checkbox, it should have the value "on" + if it was checked + */ + $text = "unset(\$config" . $field_conv . ");"; + eval($text); + return; + } if($unset <> "") { $text = "unset(\$config" . $field_conv . ");"; eval($text); |