summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-04-15 12:11:52 -0400
committerjim-p <jimp@pfsense.org>2011-04-15 12:11:52 -0400
commit7b2fdeb3c5d4fecc23ce2f9a7e1fa1a4c3af63be (patch)
treea188f5f45757a84e5ce42db2a2181a2f3d767464
parentb9bbae047ad11cfc54328fbc8f6619141ac5c480 (diff)
downloadpfsense-7b2fdeb3c5d4fecc23ce2f9a7e1fa1a4c3af63be.zip
pfsense-7b2fdeb3c5d4fecc23ce2f9a7e1fa1a4c3af63be.tar.gz
Properly set/unset voucher enable/disable bit.
-rw-r--r--usr/local/www/services_captiveportal_vouchers.php9
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'];
OpenPOWER on IntegriCloud