summaryrefslogtreecommitdiffstats
path: root/etc/inc/voucher.inc
diff options
context:
space:
mode:
authorbcyrill <cyrill@bannwart.info>2013-01-19 05:16:14 +0100
committerbcyrill <cyrill@bannwart.info>2013-01-19 05:16:14 +0100
commita18eeb5173d5936604ee808ca62a18d7445d88d8 (patch)
treecb1c82e3d71816b08b9b064efbd52254607e7495 /etc/inc/voucher.inc
parent1489e8c8a8a46c763eb89f160f4ed59cd6c0cc8d (diff)
downloadpfsense-a18eeb5173d5936604ee808ca62a18d7445d88d8.zip
pfsense-a18eeb5173d5936604ee808ca62a18d7445d88d8.tar.gz
Update /etc/inc/voucher.inc
Diffstat (limited to 'etc/inc/voucher.inc')
-rw-r--r--etc/inc/voucher.inc19
1 files changed, 10 insertions, 9 deletions
diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc
index a0455d2..92ac804 100644
--- a/etc/inc/voucher.inc
+++ b/etc/inc/voucher.inc
@@ -50,8 +50,8 @@ function xmlrpc_sync_voucher_expire($vouchers, $syncip, $port, $password, $usern
$execcmd = <<<EOF
require_once('/etc/inc/captiveportal.inc');
require_once('/etc/inc/voucher.inc');
- \$cpzone = $cpzone;
- voucher_expire($vouchers);
+ \$cpzone = "$cpzone";
+ voucher_expire("$vouchers");
EOF;
@@ -85,7 +85,7 @@ EOF;
return $toreturn;
}
-function xmlrpc_sync_voucher_disconnect($dbent, $syncip, $port, $password, $username, $term_cause = "1", $stop_time = null) {
+function xmlrpc_sync_voucher_disconnect($dbent, $syncip, $port, $password, $username, $term_cause = 1, $stop_time = null) {
global $g, $config, $cpzone;
require_once("xmlrpc.inc");
if($port == "443")
@@ -95,14 +95,15 @@ function xmlrpc_sync_voucher_disconnect($dbent, $syncip, $port, $password, $user
/* Construct code that is run on remote machine */
$dbent_str = serialize($dbent);
+ $stop_time_str = (isset($stop_time)) ? $stop_time : "null";
$method = 'pfsense.exec_php';
$execcmd = <<<EOF
require_once('/etc/inc/captiveportal.inc');
require_once('/etc/inc/voucher.inc');
- \$cpzone = $cpzone;
+ \$cpzone = "$cpzone";
\$radiusservers = captiveportal_get_radius_servers();
- \$dbent = unserialize($dbent_str);
- captiveportal_disconnect(\$dbent, \$radiusservers, $term_cause, $stop_time);
+ \$dbent = unserialize("$dbent_str");
+ captiveportal_disconnect(\$dbent, \$radiusservers, $term_cause, $stop_time_str);
EOF;
@@ -148,11 +149,11 @@ function xmlrpc_sync_used_voucher($voucher_received, $syncip, $port, $password,
$method = 'pfsense.exec_php';
$execcmd = <<<EOF
require_once('/etc/inc/voucher.inc');
- \$cpzone = $cpzone;
- \$timeleft = voucher_auth({$voucher_received});
+ \$cpzone = "$cpzone";
+ \$timeleft = voucher_auth("$voucher_received");
\$toreturn = array();
\$toreturn['timeleft'] = \$timeleft;
- \$toreturn['voucher']['roll'] = \$config['voucher'][$cpzone]['roll'];
+ \$toreturn['voucher']['roll'] = \$config['voucher']["$cpzone"]['roll'];
EOF;
OpenPOWER on IntegriCloud