From fb2f4c3f5f260e3a895bd8cb170143136e6d61fd Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 31 Jul 2015 16:05:09 +0000 Subject: [PATCH] (legacy) let's try not to overcomplicate that last thing.... --- src/etc/inc/auth.inc | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/src/etc/inc/auth.inc b/src/etc/inc/auth.inc index 6b5283e73..9ef5cc081 100644 --- a/src/etc/inc/auth.inc +++ b/src/etc/inc/auth.inc @@ -182,33 +182,26 @@ $userindex = index_users(); function isAuthLocalIP($http_host) { global $config; - $local_ip = false; $interface_list_ips = get_configured_ip_addresses(); foreach ($interface_list_ips as $ilips) { if (strcasecmp($http_host, $ilips) == 0) { - $local_ip = true; - break; + return true; } } - if (!$local_ip) { - $interface_list_ipv6s = get_configured_ipv6_addresses(); - foreach ($interface_list_ipv6s as $ilipv6s) { - if (strcasecmp($http_host, $ilipv6s) == 0) { - $local_ip = true; - break; - } + $interface_list_ipv6s = get_configured_ipv6_addresses(); + foreach ($interface_list_ipv6s as $ilipv6s) { + if (strcasecmp($http_host, $ilipv6s) == 0) { + return true; } - if (!$local_ip) { - if (isset($config['virtualip']['vip'])) { - foreach ($config['virtualip']['vip'] as $vip) { - if ($vip['subnet'] == $http_host) { - $local_ip = true; - } - } + } + if (isset($config['virtualip']['vip'])) { + foreach ($config['virtualip']['vip'] as $vip) { + if ($vip['subnet'] == $http_host) { + return true; } } } - return $local_ip; + return false; } function index_groups()