summaryrefslogtreecommitdiffstats
path: root/etc/inc/voucher.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2014-03-07 17:34:55 +0000
committerErmal <eri@pfsense.org>2014-03-07 17:49:54 +0000
commitfac36dfddf251bb9ab8c412add7772e4a6cdf048 (patch)
tree5ea5b2f6df4a479adfcf03c50d431ad81ef2a430 /etc/inc/voucher.inc
parente327358bb40a614e7dc3b79993cded70f38d48f6 (diff)
downloadpfsense-fac36dfddf251bb9ab8c412add7772e4a6cdf048.zip
pfsense-fac36dfddf251bb9ab8c412add7772e4a6cdf048.tar.gz
Make the voucher auth through xmlrpc work.
Diffstat (limited to 'etc/inc/voucher.inc')
-rw-r--r--etc/inc/voucher.inc5
1 files changed, 4 insertions, 1 deletions
diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc
index e4fc23e..56329df 100644
--- a/etc/inc/voucher.inc
+++ b/etc/inc/voucher.inc
@@ -53,6 +53,7 @@ function xmlrpc_sync_voucher_expire($vouchers, $syncip, $port, $password, $usern
/* Construct code that is run on remote machine */
$method = 'pfsense.exec_php';
$execcmd = <<<EOF
+ global \$cpzone;
require_once('/etc/inc/captiveportal.inc');
require_once('/etc/inc/voucher.inc');
\$cpzone = "$cpzone";
@@ -108,6 +109,7 @@ function xmlrpc_sync_voucher_disconnect($dbent, $syncip, $port, $password, $user
$tmp_stop_time = (isset($stop_time)) ? $stop_time : "null";
$method = 'pfsense.exec_php';
$execcmd = <<<EOF
+ global \$cpzone;
require_once('/etc/inc/captiveportal.inc');
require_once('/etc/inc/voucher.inc');
\$cpzone = "$cpzone";
@@ -163,6 +165,7 @@ function xmlrpc_sync_used_voucher($voucher_received, $syncip, $port, $password,
/* Construct code that is run on remote machine */
$method = 'pfsense.exec_php';
$execcmd = <<<EOF
+ global \$cpzone;
require_once('/etc/inc/voucher.inc');
\$cpzone = "$cpzone";
\$timeleft = voucher_auth("$voucher_received");
@@ -201,7 +204,7 @@ EOF;
if (!is_array($config['voucher']))
$config['voucher'] = array();
- if (is_array($toreturn['voucher']) && (count($toreturn['voucher']['roll']) <> count($config['voucher'][$cpzone]['roll']))) {
+ if (is_array($toreturn['voucher']) && is_array($toreturn['voucher']['roll'])) {
$config['voucher'][$cpzone]['roll'] = $toreturn['voucher']['roll'];
write_config("Captive Portal Voucher database synchronized with {$url}");
voucher_configure_zone(true);
OpenPOWER on IntegriCloud