diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2010-08-30 22:20:22 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2010-08-30 22:20:22 -0400 |
commit | 2f384448b09eb135e44d7881e93e0798b3009eec (patch) | |
tree | 71add6737f3091a0755a1b4f313d6906f447a146 | |
parent | 6c9ca678257d05513ee8fa2881104624c676ec07 (diff) | |
download | pfsense-2f384448b09eb135e44d7881e93e0798b3009eec.zip pfsense-2f384448b09eb135e44d7881e93e0798b3009eec.tar.gz |
Check for less time available on remote node
-rw-r--r-- | etc/inc/voucher.inc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc index 58da262..3b8e1ac 100644 --- a/etc/inc/voucher.inc +++ b/etc/inc/voucher.inc @@ -61,7 +61,7 @@ EOF; log_error("Captive Portal Voucher XMLRPC sync data {$url}:{$port}."); $msg = new XML_RPC_Message($method, $params); $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port); - $cli->setCredentials('admin', $password); + $cli->setCredentials($username, $password); $resp = $cli->send($msg, "250"); if(!$resp) { $error = "A communications error occurred while attempting CaptivePortalVoucherSync XMLRPC sync with {$url}:{$port} (pfsense.exec_php)."; @@ -107,7 +107,7 @@ function voucher_auth($voucher_received, $test = 0) { $syncip = $a_voucher['vouchersyncdbip']; $syncport = $a_voucher['vouchersyncport']; $syncpass = $a_voucher['vouchersyncpass']; - $syncpass = $a_voucher['vouchersyncusername']; + $vouchersyncusername = $a_voucher['vouchersyncusername']; $remote_time_used = xmlrpc_sync_used_voucher($voucher_received, $syncip, $syncport, $syncpass, $vouchersyncusername); } @@ -191,7 +191,7 @@ function voucher_auth($voucher_received, $test = 0) { } else { $test_result[] = "Access granted for $total_minutes Minutes in total."; } - unlock($voucherlck); + unlock($voucherlck); return $test_result; } @@ -208,7 +208,7 @@ function voucher_auth($voucher_received, $test = 0) { // If we did a XMLRPC sync earlier check the timeleft if($a_voucher['vouchersyncdbip']) - if($remote_time_used['timeleft'] < 1) + if($remote_time_used['timeleft'] < $total_minutes) $total_minutes = $remote_time_used['timeleft']; // All given vouchers were valid and this isn't simply a test. |