Add inRanges() and validateRanges() methods to IpFilter class

This commit is contained in:
Kijin Sung 2016-03-13 10:18:52 +09:00
parent 2effbea06f
commit 0adb13ca30
7 changed files with 52 additions and 77 deletions

View file

@ -1478,13 +1478,9 @@ class Context
}
// Allow if the current user is in the list of allowed IPs.
$allowed_list = config('lock.allow');
foreach ($allowed_list as $allowed_ip)
if (Rhymix\Framework\IpFilter::inRanges(RX_CLIENT_IP, config('lock.allow')))
{
if (Rhymix\Framework\IpFilter::inRange(RX_CLIENT_IP, $allowed_ip))
{
return;
}
return;
}
// Set headers and constants for backward compatibility.