You are here

private function LoginFirewall::checkGlobalRestriction in Restrict Login or Role Access by IP Address 8.4

Validates the global IP restrictions, if set.

Return value

null|bool Null if there is no global restrictions. True/False whether the current users IP is in global IP whitelist.

1 call to LoginFirewall::checkGlobalRestriction()
LoginFirewall::isLoginAllowed in src/LoginFirewall.php
Checks that a user is allowed to login based on IP whitelists.

File

src/LoginFirewall.php, line 96

Class

LoginFirewall
Class LoginFirewall.

Namespace

Drupal\restrict_by_ip

Code

private function checkGlobalRestriction() {
  $global_data = $this->config
    ->get('login_range');

  // If there is no global IP restriction configured, we allow all.
  if (strlen($global_data) == 0) {
    return NULL;
  }
  return $this
    ->checkIpRestriction($global_data);
}