diff options
author | Ermal <eri@pfsense.org> | 2014-03-07 17:34:55 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2014-03-07 17:34:55 +0000 |
commit | be11dd7075bdd3c449ad093a726a0404912348f0 (patch) | |
tree | 8af0c13275db97ec30a54a689961a3a065fe8617 | |
parent | 3d38041ead6f8fbf7581c2fc5b39ae43a886e21a (diff) | |
download | pfsense-be11dd7075bdd3c449ad093a726a0404912348f0.zip pfsense-be11dd7075bdd3c449ad093a726a0404912348f0.tar.gz |
Make the voucher auth through xmlrpc work.
-rw-r--r-- | etc/inc/voucher.inc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc index 695857d..79929c2 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); |