summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorplumbeo <plumbeo@users.noreply.github.com>2016-12-03 18:03:33 +0100
committerRenato Botelho <renato@netgate.com>2016-12-06 17:48:36 -0200
commitcc99b29886559b85c0e01c8ee1ab0ac5455fef0e (patch)
tree69a930d9910562dddf10547e60ea3add8667ba71 /src
parent36868398143f7595ed2e613128fbfdbfb2987531 (diff)
downloadpfsense-cc99b29886559b85c0e01c8ee1ab0ac5455fef0e.zip
pfsense-cc99b29886559b85c0e01c8ee1ab0ac5455fef0e.tar.gz
Captive portal: add option to include idle time in total session time
Add an option to choose whether the time spent idle by a user disconnected for exceeding the idle timeout must be included in the total session time sent to the RADIUS server or not. (cherry picked from commit 1878e1c932fa467956ef44d4bd39adb7d4d21243)
Diffstat (limited to 'src')
-rw-r--r--src/etc/inc/captiveportal.inc4
-rw-r--r--src/usr/local/www/services_captiveportal.php11
2 files changed, 14 insertions, 1 deletions
diff --git a/src/etc/inc/captiveportal.inc b/src/etc/inc/captiveportal.inc
index 15f4838..b0f0444 100644
--- a/src/etc/inc/captiveportal.inc
+++ b/src/etc/inc/captiveportal.inc
@@ -723,7 +723,9 @@ function captiveportal_prune_old() {
if ($lastact && (($pruning_time - $lastact) >= $uidletimeout)) {
$timedout = true;
$term_cause = 4; // Idle-Timeout
- $stop_time = $lastact; // Entry added to comply with WISPr
+ if (!isset($config['captiveportal'][$cpzone]['includeidletime'])) {
+ $stop_time = $lastact;
+ }
}
}
diff --git a/src/usr/local/www/services_captiveportal.php b/src/usr/local/www/services_captiveportal.php
index 52edb39..8c5fd1c 100644
--- a/src/usr/local/www/services_captiveportal.php
+++ b/src/usr/local/www/services_captiveportal.php
@@ -222,6 +222,7 @@ if ($a_cp[$cpzone]) {
$pconfig['passthrumacaddusername'] = isset($a_cp[$cpzone]['passthrumacaddusername']);
$pconfig['radmac_format'] = $a_cp[$cpzone]['radmac_format'];
$pconfig['reverseacct'] = isset($a_cp[$cpzone]['reverseacct']);
+ $pconfig['includeidletime'] = isset($a_cp[$cpzone]['includeidletime']);
$pconfig['radiusnasid'] = $a_cp[$cpzone]['radiusnasid'];
$pconfig['page'] = array();
if ($a_cp[$cpzone]['page']['htmltext']) {
@@ -462,6 +463,7 @@ if ($_POST) {
$newcp['passthrumacaddusername'] = $_POST['passthrumacaddusername'] ? true : false;
$newcp['radmac_format'] = $_POST['radmac_format'] ? $_POST['radmac_format'] : false;
$newcp['reverseacct'] = $_POST['reverseacct'] ? true : false;
+ $newcp['includeidletime'] = $_POST['includeidletime'] ? true : false;
$newcp['radiusnasid'] = trim($_POST['radiusnasid']);
if (!is_array($newcp['page'])) {
@@ -1018,6 +1020,15 @@ $section->addInput(new Form_Checkbox(
))->setHelp('When enabled, data counts for RADIUS accounting packets will be taken from the client perspective, not the NAS. ' .
'Acct-Input-Octets will represent download, and Acct-Output-Octets will represent upload.');
+$section->addInput(new Form_Checkbox(
+ 'includeidletime',
+ 'Idle time accounting',
+ 'Include idle time in session time',
+ $pconfig['includeidletime']
+))->setHelp('When enabled, if a client is disconnected for exceeding the idle timeout the time spent idle is included in the total session time. ' .
+ 'Otherwise the session time reported to the RADIUS server is the time between when the session started and when the last ' .
+ 'activity was recorded.');
+
$section->addInput(new Form_Input(
'radiusnasid',
'NAS Identifier',
OpenPOWER on IntegriCloud