summaryrefslogtreecommitdiffstats
path: root/usr/local/captiveportal
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2012-11-28 16:03:10 +0000
committerErmal <eri@pfsense.org>2012-11-28 16:03:10 +0000
commit007161dc9f03a8eef92dc6e4ad3d54b317e98ee8 (patch)
tree544fb7ca0d5a2a5b81365dff0b9505eefeefbd94 /usr/local/captiveportal
parentad361510f1b8ae5db756a5382e0882b6d847fd7f (diff)
downloadpfsense-007161dc9f03a8eef92dc6e4ad3d54b317e98ee8.zip
pfsense-007161dc9f03a8eef92dc6e4ad3d54b317e98ee8.tar.gz
Simplify logic
Diffstat (limited to 'usr/local/captiveportal')
-rwxr-xr-xusr/local/captiveportal/index.php15
1 files changed, 8 insertions, 7 deletions
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 */
OpenPOWER on IntegriCloud