diff options
author | Ermal <eri@pfsense.org> | 2010-05-03 18:14:27 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-05-03 18:14:27 +0000 |
commit | d5ae560d8396f81a6f73667bf53df046b71ace35 (patch) | |
tree | c6cfd26b90561531d05d36fa320b809a94de14e6 /usr | |
parent | b01792a0a3df6795d21ca205cf57b371b41bf195 (diff) | |
download | pfsense-d5ae560d8396f81a6f73667bf53df046b71ace35.zip pfsense-d5ae560d8396f81a6f73667bf53df046b71ace35.tar.gz |
Ticket #565. Correct deleting passthru mac entries. revert back to always allow a passthru mac as with allowed ips. Remove the check during login for passthru mac entries they will never make it to the login page.
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/captiveportal/index.php | 16 | ||||
-rwxr-xr-x | usr/local/www/services_captiveportal_mac.php | 14 | ||||
-rwxr-xr-x | usr/local/www/services_captiveportal_mac_edit.php | 2 |
3 files changed, 7 insertions, 25 deletions
diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php index 7d51fc3..4f68026 100755 --- a/usr/local/captiveportal/index.php +++ b/usr/local/captiveportal/index.php @@ -119,12 +119,6 @@ setTimeout('window.close();',5000) ; EOD; exit; -/* The $macfilter can be removed safely since we first check if the $clientmac is present, if not we fail */ -} else if ($clientmac && portal_mac_fixed($clientmac)) { - /* punch hole in ipfw for pass thru mac addresses */ - portal_allow($clientip, $clientmac, "unauthenticated"); - exit; - } else if ($clientmac && $radmac_enable && portal_mac_radius($clientmac,$clientip)) { /* radius functions handle everything so we exit here since we're done */ exit; @@ -322,19 +316,11 @@ function portal_allow($clientip,$clientmac,$username,$password = null, $attribut */ $peruserbw = isset($config['captiveportal']['peruserbw']); $passthrumacadd = isset($config['captiveportal']['passthrumacadd']); - $portalmac = NULL; - if (!empty($clientmac)) { - $portalmac = portal_mac_fixed($clientmac); - if ($portalmac) { - $attributes['bw_up'] = $portalmac['bw_up']; - $attributes['bw_down'] = $portalmac['bw_down']; - } - } $bw_up = isset($attributes['bw_up']) ? trim($attributes['bw_up']) : $config['captiveportal']['bwdefaultup']; $bw_down = isset($attributes['bw_down']) ? trim($attributes['bw_down']) : $config['captiveportal']['bwdefaultdn']; - if ($passthrumacadd && $portalmac == NULL) { + if ($passthrumacadd) { $mac = array(); $mac['mac'] = $clientmac; $mac['descr'] = "Auto added pass-through MAC for user {$username}"; diff --git a/usr/local/www/services_captiveportal_mac.php b/usr/local/www/services_captiveportal_mac.php index dd5fdfe..7c40b85 100755 --- a/usr/local/www/services_captiveportal_mac.php +++ b/usr/local/www/services_captiveportal_mac.php @@ -74,13 +74,12 @@ if ($_POST) { } } if ($found == true) { - $ip = captiveportal_get_ipfw_ruleno_byvalue($_POST['delmac']); - if ($ip) { - captiveportal_disconnect_client($ip); + $ruleno = captiveportal_get_ipfw_passthru_ruleno($_POST['delmac']); + if ($ruleno) { + mwexec("/sbin/ipfw delete {$ruleno}; /sbin/ipfw delete " . ++$ruleno); } unset($a_passthrumacs[$idx]); write_config(); - captiveportal_passthrumac_configure(true); } } exit; @@ -89,14 +88,13 @@ if ($_POST) { if ($_GET['act'] == "del") { if ($a_passthrumacs[$_GET['id']]) { - $ip = captiveportal_get_ipfw_ruleno_byvalue($a_passthrumacs[$_GET['id']]['mac']); - if ($ip) { - captiveportal_disconnect_client($ip); + $ruleno = captiveportal_get_ipfw_passthru_ruleno($a_passthrumacs[$_GET['id']]['mac']); + if ($ruleno) { + mwexec("/sbin/ipfw delete {$ruleno}; /sbin/ipfw delete " . ++$ruleno); } unset($a_passthrumacs[$_GET['id']]); write_config(); header("Location: services_captiveportal_mac.php"); - mark_subsystem_dirty('passthrumac'); exit; } } diff --git a/usr/local/www/services_captiveportal_mac_edit.php b/usr/local/www/services_captiveportal_mac_edit.php index 89e2757..ac7b341 100755 --- a/usr/local/www/services_captiveportal_mac_edit.php +++ b/usr/local/www/services_captiveportal_mac_edit.php @@ -120,8 +120,6 @@ if ($_POST) { write_config(); - mark_subsystem_dirty('passthrumac'); - header("Location: services_captiveportal_mac.php"); exit; } |