diff options
author | jim-p <jimp@pfsense.org> | 2011-04-15 12:11:52 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-04-15 12:11:52 -0400 |
commit | 7b2fdeb3c5d4fecc23ce2f9a7e1fa1a4c3af63be (patch) | |
tree | a188f5f45757a84e5ce42db2a2181a2f3d767464 | |
parent | b9bbae047ad11cfc54328fbc8f6619141ac5c480 (diff) | |
download | pfsense-7b2fdeb3c5d4fecc23ce2f9a7e1fa1a4c3af63be.zip pfsense-7b2fdeb3c5d4fecc23ce2f9a7e1fa1a4c3af63be.tar.gz |
Properly set/unset voucher enable/disable bit.
-rw-r--r-- | usr/local/www/services_captiveportal_vouchers.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr/local/www/services_captiveportal_vouchers.php b/usr/local/www/services_captiveportal_vouchers.php index d6ffc55..203906a 100644 --- a/usr/local/www/services_captiveportal_vouchers.php +++ b/usr/local/www/services_captiveportal_vouchers.php @@ -167,7 +167,7 @@ if ($_POST) { $pconfig = $_POST; /* input validation */ - if ($_POST['enable']) { + if ($_POST['enable'] == "yes") { if (!$_POST['vouchersyncusername']) { $reqdfields = explode(" ", "charset rollbits ticketbits checksumbits publickey magic saveinterval"); $reqdfieldsn = array(gettext("charset"),gettext("rollbits"),gettext("ticketbits"),gettext("checksumbits"),gettext("publickey"),gettext("magic"),gettext("saveinterval")); @@ -202,8 +202,11 @@ if ($_POST) { } if (!$input_errors) { - $config['voucher']['enable'] = $_POST['enable'] ? true : false; - if (!$_POST['vouchersyncusername']) { + if ($_POST['enable'] == "yes") + $config['voucher']['enable'] = true; + else + unset($config['voucher']['enable']); + if (empty($_POST['vouchersyncusername'])) { $config['voucher']['charset'] = $_POST['charset']; $config['voucher']['rollbits'] = $_POST['rollbits']; $config['voucher']['ticketbits'] = $_POST['ticketbits']; |