You are here

private function RestrictIpService::allowAccessWhitelistedIp in Restrict IP 8

Same name and namespace in other branches
  1. 8.2 src/Service/RestrictIpService.php \Drupal\restrict_ip\Service\RestrictIpService::allowAccessWhitelistedIp()
  2. 3.x src/Service/RestrictIpService.php \Drupal\restrict_ip\Service\RestrictIpService::allowAccessWhitelistedIp()

* Test to see if the current user has a whitelisted IP address

1 call to RestrictIpService::allowAccessWhitelistedIp()
RestrictIpService::testForBlock in src/Service/RestrictIpService.php
*

File

src/Service/RestrictIpService.php, line 336

Class

RestrictIpService

Namespace

Drupal\restrict_ip\Service

Code

private function allowAccessWhitelistedIp() {
  $ip_whitelist = $this
    ->buildWhitelistedIpAddresses();
  if (count($ip_whitelist)) {
    foreach ($ip_whitelist as $whitelisted_address) {
      if ($this
        ->testWhitelistedIp($whitelisted_address)) {
        return TRUE;
      }
    }
  }
  return FALSE;
}