From 007161dc9f03a8eef92dc6e4ad3d54b317e98ee8 Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 28 Nov 2012 16:03:10 +0000 Subject: Simplify logic --- usr/local/captiveportal/index.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'usr/local/captiveportal') diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php index c0936b7..d325835 100755 --- a/usr/local/captiveportal/index.php +++ b/usr/local/captiveportal/index.php @@ -95,14 +95,15 @@ $macfilter = !isset($config['captiveportal'][$cpzone]['nomacfilter']); $passthrumac = isset($config['captiveportal'][$cpzone]['passthrumacadd']); /* find MAC address for client */ -if ($macfilter || $passthrumac) +if ($macfilter || $passthrumac) { $clientmac = arp_get_mac_by_ip($clientip); -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."; - log_error("Captive portal could not determine client's MAC address. Disable MAC address filtering in captive portal if you do not need this functionality."); - exit; + if (!$clientmac) { + /* 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."; + log_error("Captive portal could not determine client's MAC address. Disable MAC address filtering in captive portal if you do not need this functionality."); + exit; + } } /* find out if we need RADIUS + RADIUSMAC or not */ -- cgit v1.1