diff options
author | jim-p <jimp@pfsense.org> | 2016-02-04 15:57:19 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2016-02-04 16:02:33 -0500 |
commit | 00de7de690df0beb8fff755518890878c1c7e41c (patch) | |
tree | 9304f202a1bf1099798cb6b80fc5e3ac90646417 /src/etc | |
parent | b8463d3b783ef444e3b24cc2269742c7b3d63cc7 (diff) | |
download | pfsense-00de7de690df0beb8fff755518890878c1c7e41c.zip pfsense-00de7de690df0beb8fff755518890878c1c7e41c.tar.gz |
Fix multi-session time counting for the FreeRADIUS start/stop case. Ticket #2164
Diffstat (limited to 'src/etc')
-rw-r--r-- | src/etc/inc/captiveportal.inc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/etc/inc/captiveportal.inc b/src/etc/inc/captiveportal.inc index 1d173fe..1714a40 100644 --- a/src/etc/inc/captiveportal.inc +++ b/src/etc/inc/captiveportal.inc @@ -905,10 +905,17 @@ function captiveportal_disconnect($dbent, $radiusservers, $term_cause = 1, $stop /* this client needs to be deleted - remove ipfw rules */ if (isset($config['captiveportal'][$cpzone]['radacct_enable']) && !empty($radiusservers)) { + if ($config['captiveportal'][$cpzone]['reauthenticateacct'] == "stopstartfreeradius") { + /* Interim updates are on so the session time must be reported as the elapsed time since the previous interim update. */ + $session_time = ($stop_time - $dbent[0]) % 60; + $start_time = $stop_time - $session_time; + } else { + $start_time = $dbent[0]; + } RADIUS_ACCOUNTING_STOP($dbent[1], // ruleno $dbent[4], // username $dbent[5], // sessionid - $dbent[0], // start time + $start_time, // start time $radiusservers, $dbent[2], // clientip $dbent[3], // clientmac |