summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2014-02-17 10:36:59 +0000
committerErmal <eri@pfsense.org>2014-02-17 10:37:13 +0000
commite8b05b83ed12ae7f65021c14686826b5aac96e00 (patch)
tree037992e2c9ba0b40cffa97ed8c6de7b68798bf72 /etc
parentec96f17d627ab524048ed1f713c61e664d731705 (diff)
downloadpfsense-e8b05b83ed12ae7f65021c14686826b5aac96e00.zip
pfsense-e8b05b83ed12ae7f65021c14686826b5aac96e00.tar.gz
Consider setting of noconcurrent login for passthrough expiry of users. Fixes #3340
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/captiveportal.inc41
1 files changed, 22 insertions, 19 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index e71a2ec..bb13da5 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -775,27 +775,29 @@ function captiveportal_prune_old_automac() {
$writecfg = false;
foreach ($config['captiveportal'][$cpzone]['passthrumac'] as $eid => $emac) {
if ($emac['logintype'] == "voucher") {
- if (isset($tmpvoucherdb[$emac['username']])) {
- $temac = $config['captiveportal'][$cpzone]['passthrumac'][$tmpvoucherdb[$emac['username']]];
- $ruleno = captiveportal_get_ipfw_passthru_ruleno($temac['mac']);
- $pipeno = captiveportal_get_dn_passthru_ruleno($temac['mac']);
- if ($ruleno) {
- captiveportal_free_ipfw_ruleno($ruleno);
- $macrules .= "delete {$ruleno}";
- ++$ruleno;
- $macrules .= "delete {$ruleno}";
- }
- if ($pipeno) {
- captiveportal_free_dn_ruleno($pipeno);
- $macrules .= "pipe delete {$pipeno}\n";
- ++$pipeno;
- $macrules .= "pipe delete {$pipeno}\n";
+ if (isset($config['captiveportal'][$cpzone]['noconcurrentlogins'])) {
+ if (isset($tmpvoucherdb[$emac['username']])) {
+ $temac = $config['captiveportal'][$cpzone]['passthrumac'][$tmpvoucherdb[$emac['username']]];
+ $ruleno = captiveportal_get_ipfw_passthru_ruleno($temac['mac']);
+ $pipeno = captiveportal_get_dn_passthru_ruleno($temac['mac']);
+ if ($ruleno) {
+ captiveportal_free_ipfw_ruleno($ruleno);
+ $macrules .= "delete {$ruleno}";
+ ++$ruleno;
+ $macrules .= "delete {$ruleno}";
+ }
+ if ($pipeno) {
+ captiveportal_free_dn_ruleno($pipeno);
+ $macrules .= "pipe delete {$pipeno}\n";
+ ++$pipeno;
+ $macrules .= "pipe delete {$pipeno}\n";
+ }
+ $writecfg = true;
+ captiveportal_logportalauth($temac['username'], $temac['mac'], $temac['ip'], "DUPLICATE {$temac['username']} LOGIN - TERMINATING OLD SESSION");
+ unset($config['captiveportal'][$cpzone]['passthrumac'][$tmpvoucherdb[$emac['username']]]);
}
- $writecfg = true;
- captiveportal_logportalauth($temac['username'], $temac['mac'], $temac['ip'], "DUPLICATE {$temac['username']} LOGIN - TERMINATING OLD SESSION");
- unset($config['captiveportal'][$cpzone]['passthrumac'][$tmpvoucherdb[$emac['username']]]);
+ $tmpvoucherdb[$emac['username']] = $eid;
}
- $tmpvoucherdb[$emac['username']] = $eid;
if (voucher_auth($emac['username']) <= 0) {
$ruleno = captiveportal_get_ipfw_passthru_ruleno($emac['mac']);
$pipeno = captiveportal_get_dn_passthru_ruleno($emac['mac']);
@@ -817,6 +819,7 @@ function captiveportal_prune_old_automac() {
}
}
}
+ unset($tmpvoucherdb);
if (!empty($macrules)) {
@file_put_contents("{$g['tmp_path']}/macentry.prunerules.tmp", $macrules);
unset($macrules);
OpenPOWER on IntegriCloud