summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-03-25 22:33:52 +0000
committerErmal <eri@pfsense.org>2011-03-25 22:33:52 +0000
commit2fe347eb723969d83ed57fc12bbeff9dabde36c8 (patch)
tree23363c0b139bf973a3979285eaba8abeae25d39c /etc
parent3e404e0c6d1cf65bd95d3fbc5e4eedb38ee1feef (diff)
downloadpfsense-2fe347eb723969d83ed57fc12bbeff9dabde36c8.zip
pfsense-2fe347eb723969d83ed57fc12bbeff9dabde36c8.tar.gz
Actually correctly report the timeleft in log messages. This is mostly cosmetic.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/voucher.inc18
1 files changed, 9 insertions, 9 deletions
diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc
index 5ff95ac..55c0343 100644
--- a/etc/inc/voucher.inc
+++ b/etc/inc/voucher.inc
@@ -89,15 +89,15 @@ function xmlrpc_sync_used_voucher($voucher_received, $syncip, $port, $password,
global $g, $config;
require_once("xmlrpc.inc");
if($port == "443")
- $url = "https://{$syncip}:{$port}";
+ $url = "https://{$syncip}";
else
- $url = "http://{$syncip}:{$port}";
+ $url = "http://{$syncip}";
/* Construct code that is run on remote machine */
$method = 'pfsense.exec_php';
$execcmd = <<<EOF
require_once('/etc/inc/voucher.inc');
- \$timeleft = voucher_auth($voucher_received);
+ \$timeleft = voucher_auth({$voucher_received});
\$toreturn = array();
\$toreturn['timeleft'] = \$timeleft;
\$toreturn['voucher']['roll'] = \$config['voucher']['roll'];
@@ -132,7 +132,7 @@ EOF;
if(count($toreturn['voucher']['roll']) <> count($config['voucher']['roll'])) {
$config['voucher']['roll'] = $toreturn['voucher']['roll'];
write_config("Captive Portal Voucher database synchronized with {$url}");
- voucher_configure();
+ voucher_configure(true);
}
return $toreturn['timeleft'];
@@ -230,12 +230,12 @@ function voucher_auth($voucher_received, $test = 0) {
}
} else {
$test_result[] = "$voucher ($roll/$nr): not found on any registererd Roll";
- captiveportal_syslog("$voucher ($roll/$nr): not found on any registererd Roll");
+ captiveportal_syslog("$voucher ($roll/$nr): not found on any registererd Roll");
}
} else {
// hmm, thats weird ... not what I expected
$test_result[] = "$voucher invalid: $result !!";
- captiveportal_syslog("$voucher invalid: $result !!");
+ captiveportal_syslog("$voucher invalid: $result !!");
$error++;
}
}
@@ -247,7 +247,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;
}
@@ -264,8 +264,8 @@ function voucher_auth($voucher_received, $test = 0) {
// If we did a XMLRPC sync earlier check the timeleft
if(!empty($a_voucher['vouchersyncdbip']))
- if($remote_time_used['timeleft'] < $total_minutes)
- $total_minutes = $remote_time_used['timeleft'];
+ if($remote_time_used < $total_minutes)
+ $total_minutes = $remote_time_used;
// All given vouchers were valid and this isn't simply a test.
// Write back the used DB's
OpenPOWER on IntegriCloud