mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Fix various issues reported on http://forum.pfsense.org/index.php/topic,8672.0.html.
This commit is contained in:
parent
3e0621caec
commit
156487ed7d
@ -40,6 +40,7 @@ require_once("util.inc");
|
||||
require_once("radius_authentication.inc");
|
||||
require_once("radius_accounting.inc");
|
||||
require_once("radius.inc");
|
||||
require_once("voucher.inc");
|
||||
|
||||
$lockfile = "{$g['varrun_path']}/captiveportal.lock";
|
||||
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
|
||||
/* include all configuration functions */
|
||||
require_once("config.inc");
|
||||
$dirtyfile = "{$g['varrun_path']}/voucher.dirty";
|
||||
|
||||
/*
|
||||
*Authenticate a voucher and return the remaining time credit in minutes
|
||||
@ -397,8 +398,8 @@ function voucher_save_db_to_config() {
|
||||
}
|
||||
$rollent['active'] = $db;
|
||||
}
|
||||
unlock($voucherlck);
|
||||
unlink($dirtyfile);
|
||||
unlock($voucherlck);
|
||||
write_config();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ foreach($a_roll as $rollent) {
|
||||
$minutes = $rollent['minutes'];
|
||||
$active_vouchers = file("{$g['vardb_path']}/voucher_active_$roll.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
foreach($active_vouchers as $voucher => $line) {
|
||||
list($timestamp, $minutes) = explode(",", $line);
|
||||
list($voucher,$timestamp, $minutes) = explode(",", $line);
|
||||
$remaining = (($timestamp + 60*$minutes) - time());
|
||||
if ($remaining > 0) {
|
||||
$dbent[0] = $voucher;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user