From f282e03653d6267d6e9a105ac78f8ca34ee6e226 Mon Sep 17 00:00:00 2001 From: Astrologies Date: Fri, 31 Dec 2021 14:31:26 -0500 Subject: [PATCH] Revert "Everything IP!" This reverts commit 23f608e173fed01b4bfe8f10fcc9851ef722d196. --- globals/Dependencies/Web/IpRange.php | 3 --- globals/Dependencies/Web/WebContextManager.php | 3 +-- globals/config.php | 2 -- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/globals/Dependencies/Web/IpRange.php b/globals/Dependencies/Web/IpRange.php index 1b75d4a..9d04ec0 100644 --- a/globals/Dependencies/Web/IpRange.php +++ b/globals/Dependencies/Web/IpRange.php @@ -182,9 +182,6 @@ namespace Alphaland\Web { */ public static function IsIpInCidrRange(string $ip, string $cidr) { - if (strpos($cidr, '/') === false) - $cidr = "$cidr/32"; - list($subnet, $bits) = explode('/', $cidr); if ($bits === null) { $bits = 32; diff --git a/globals/Dependencies/Web/WebContextManager.php b/globals/Dependencies/Web/WebContextManager.php index ca6f0e0..1d23d5a 100644 --- a/globals/Dependencies/Web/WebContextManager.php +++ b/globals/Dependencies/Web/WebContextManager.php @@ -3,7 +3,6 @@ namespace Alphaland\Web { use PDO; - use Alphaland\Web\IpHelper; class WebContextManager { @@ -17,7 +16,7 @@ namespace Alphaland\Web { $currentIp = WebContextManager::GetCurrentIPAddress(); $ipWhitelist = explode(";", $GLOBALS['ws']->webservice_whitelist); - return IpHelper::IsIpInCidrNetmaskOrRangeList($currentIp, $ipWhitelist); + return in_array($currentIp, $ipWhitelist); } public static function CanBypassMaintenance() diff --git a/globals/config.php b/globals/config.php index 3b1183e..ab6124c 100644 --- a/globals/config.php +++ b/globals/config.php @@ -126,8 +126,6 @@ try include "C:/Webserver/nginx/Alphaland/globals/Dependencies/Economy/EconomyHelper.php"; include "C:/Webserver/nginx/Alphaland/globals/Dependencies/Groups/Group.php"; include "C:/Webserver/nginx/Alphaland/globals/Dependencies/Web/WebsiteSettings.php"; - include "C:/Webserver/nginx/Alphaland/globals/Dependencies/Web/IpRange.php"; - include "C:/Webserver/nginx/Alphaland/globals/Dependencies/Client/ClientSettings.php"; //authenticator $authenticator = new PHPGangsta_GoogleAuthenticator();