From 0852838c4153b0a20e26b5c48ad817d2c0010afd Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 20 Apr 2010 21:31:34 +0000 Subject: Warn the user when we cannot get the MAC address on pass through auto add case. Also when a user does a logout through clicking the logout form exit after showing sending info on logout successful. --- usr/local/captiveportal/index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'usr/local/captiveportal') diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php index 17e3c2f..f02814e 100755 --- a/usr/local/captiveportal/index.php +++ b/usr/local/captiveportal/index.php @@ -81,10 +81,11 @@ if ($_POST['redirurl']) $redirurl = $_POST['redirurl']; $macfilter = !isset($config['captiveportal']['nomacfilter']); +$passthrumac = isset($config['captiveportal']['passthrumacadd']); /* find MAC address for client */ $clientmac = arp_get_mac_by_ip($clientip); -if (!$clientmac && $macfilter) { +if (!$clientmac && ($macfilter || $passthrumac)) { /* unable to find MAC address - shouldn't happen! - bail out */ captiveportal_logportalauth("unauthenticated","noclientmac",$clientip,"ERROR"); echo "An error occurred. Please check the system logs for more information."; @@ -117,6 +118,7 @@ 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 */ -- cgit v1.1