summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_captiveportal_vouchers.php
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2014-03-12 16:03:22 +0000
committerErmal <eri@pfsense.org>2014-03-12 16:03:39 +0000
commitf3f04169f860542904f4cb833f0b9da9e5f424a8 (patch)
tree5ccd7385fc19b90ce9caf576d670bb50a3e6f089 /usr/local/www/services_captiveportal_vouchers.php
parent055fa9e3549806ac347971567abb79007bf40112 (diff)
downloadpfsense-f3f04169f860542904f4cb833f0b9da9e5f424a8.zip
pfsense-f3f04169f860542904f4cb833f0b9da9e5f424a8.tar.gz
Use descr prepended to voucher fields containing descriptions to have them encoded as CDATA. Fixes #3441
Diffstat (limited to 'usr/local/www/services_captiveportal_vouchers.php')
-rw-r--r--usr/local/www/services_captiveportal_vouchers.php26
1 files changed, 12 insertions, 14 deletions
diff --git a/usr/local/www/services_captiveportal_vouchers.php b/usr/local/www/services_captiveportal_vouchers.php
index 1decac5..5794ee1 100644
--- a/usr/local/www/services_captiveportal_vouchers.php
+++ b/usr/local/www/services_captiveportal_vouchers.php
@@ -126,10 +126,10 @@ if (!isset($config['voucher'][$cpzone]['publickey'])) {
}
// Check for invalid or expired vouchers
-if (!isset($config['voucher'][$cpzone]['msgnoaccess']))
- $config['voucher'][$cpzone]['msgnoaccess'] = gettext("Voucher invalid");
-if (!isset($config['voucher'][$cpzone]['msgexpired']))
- $config['voucher'][$cpzone]['msgexpired'] = gettext("Voucher expired");
+if (!isset($config['voucher'][$cpzone]['descrmsgnoaccess']))
+ $config['voucher'][$cpzone]['descrmsgnoaccess'] = gettext("Voucher invalid");
+if (!isset($config['voucher'][$cpzone]['descrmsgexpired']))
+ $config['voucher'][$cpzone]['descrmsgexpired'] = gettext("Voucher expired");
$a_roll = &$config['voucher'][$cpzone]['roll'];
@@ -185,8 +185,8 @@ $pconfig['magic'] = $config['voucher'][$cpzone]['magic'];
$pconfig['exponent'] = $config['voucher'][$cpzone]['exponent'];
$pconfig['publickey'] = base64_decode($config['voucher'][$cpzone]['publickey']);
$pconfig['privatekey'] = base64_decode($config['voucher'][$cpzone]['privatekey']);
-$pconfig['msgnoaccess'] = $config['voucher'][$cpzone]['msgnoaccess'];
-$pconfig['msgexpired'] = $config['voucher'][$cpzone]['msgexpired'];
+$pconfig['msgnoaccess'] = $config['voucher'][$cpzone]['descrmsgnoaccess'];
+$pconfig['msgexpired'] = $config['voucher'][$cpzone]['descrmsgexpired'];
$pconfig['vouchersyncdbip'] = $config['voucher'][$cpzone]['vouchersyncdbip'];
$pconfig['vouchersyncport'] = $config['voucher'][$cpzone]['vouchersyncport'];
$pconfig['vouchersyncpass'] = $config['voucher'][$cpzone]['vouchersyncpass'];
@@ -260,8 +260,8 @@ if ($_POST) {
$newvoucher['exponent'] = $_POST['exponent'];
$newvoucher['publickey'] = base64_encode($_POST['publickey']);
$newvoucher['privatekey'] = base64_encode($_POST['privatekey']);
- $newvoucher['msgnoaccess'] = $_POST['msgnoaccess'];
- $newvoucher['msgexpired'] = $_POST['msgexpired'];
+ $newvoucher['descrmsgnoaccess'] = $_POST['msgnoaccess'];
+ $newvoucher['descrmsgexpired'] = $_POST['msgexpired'];
$config['voucher'][$cpzone] = $newvoucher;
write_config();
voucher_configure_zone();
@@ -340,12 +340,10 @@ EOF;
$newvoucher['publickey'] = $toreturn['voucher']['publickey'];
if($toreturn['voucher']['privatekey'])
$newvoucher['privatekey'] = $toreturn['voucher']['privatekey'];
- if($toreturn['voucher']['msgnoaccess'])
- $newvoucher['msgnoaccess'] = $toreturn['voucher']['msgnoaccess'];
- if($toreturn['voucher']['msgexpired'])
- $newvoucher['msgexpired'] = $toreturn['voucher']['msgexpired'];
- if($toreturn['voucher']['msgnoaccess'])
- $newvoucher['msgnoaccess'] = $toreturn['voucher']['msgnoaccess'];
+ if($toreturn['voucher']['descrmsgnoaccess'])
+ $newvoucher['descrmsgnoaccess'] = $toreturn['voucher']['descrmsgnoaccess'];
+ if($toreturn['voucher']['descrmsgexpired'])
+ $newvoucher['descrmsgexpired'] = $toreturn['voucher']['descrmsgexpired'];
$savemsg = gettext("Voucher database has been synchronized from {$url}:{$port}");
$config['voucher'][$cpzone] = $newvoucher;
OpenPOWER on IntegriCloud