diff options
author | Ermal <eri@pfsense.org> | 2010-05-28 19:16:24 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-05-28 19:16:24 +0000 |
commit | 1c291e64f1273d2dc9a9d0ef5f714468b4ed49e7 (patch) | |
tree | f9198d53be0125898dd43a82fe3cc9c376043369 /usr/local/captiveportal | |
parent | 9a31a1cefa6f0437bd5e2ac3bec39e0defc688b7 (diff) | |
download | pfsense-1c291e64f1273d2dc9a9d0ef5f714468b4ed49e7.zip pfsense-1c291e64f1273d2dc9a9d0ef5f714468b4ed49e7.tar.gz |
Add the username to the auto added mac passthrough entry. Add an option to services->captiveportal page to activate/deactivate the auto-saving of username with the auto added mac passthrough.
Diffstat (limited to 'usr/local/captiveportal')
-rwxr-xr-x | usr/local/captiveportal/index.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php index b019b00..52d177a 100755 --- a/usr/local/captiveportal/index.php +++ b/usr/local/captiveportal/index.php @@ -286,7 +286,18 @@ function portal_allow($clientip,$clientmac,$username,$password = null, $attribut $remaining_time = $attributes['session_timeout']; /* Find an existing session */ - for ($i = 0; $i < count($cpdb); $i++) { + if ((isset($config['captiveportal']['noconcurrentlogins'])) && $passthrumac) { + if (isset($config['captiveportal']['passthrumacadd'])) { + $mac = captiveportal_passthrumac_findbyname($username); + if (!empty($mac)) { + portal_reply_page($redirurl, "error", "Username: {$username} is known with another mac address."); + exit; + } + } + } + + $nousers = count($cpdb); + for ($i = 0; $i < $nousers; $i++) { /* on the same ip */ if($cpdb[$i][2] == $clientip) { captiveportal_logportalauth($cpdb[$i][4],$cpdb[$i][3],$cpdb[$i][2],"CONCURRENT LOGIN - REUSING OLD SESSION"); @@ -342,6 +353,8 @@ function portal_allow($clientip,$clientmac,$username,$password = null, $attribut if ($passthrumac) { $mac = array(); $mac['mac'] = $clientmac; + if (isset($config['captiveportal']['passthrumacaddusername'])) + $mac['username'] = $username; $mac['descr'] = "Auto added pass-through MAC for user {$username}"; if (!empty($bw_up)) $mac['bw_up'] = $bw_up; |