public function BanIpManager::isDenied

Returns whether an IP address is blocked.

Parameters

string $ip: The IP address to check.

Return value

bool TRUE if access is denied, FALSE if access is allowed.

File

drupal/core/modules/ban/lib/Drupal/ban/BanIpManager.php, line 43
Definition of Drupal\ban\BanIpManager.

Class

BanIpManager
Ban IP manager.

Namespace

Drupal\ban

Code

public function isDenied($ip) {
  $denied = $this->connection
    ->query('SELECT 1 FROM {ban_ip} WHERE ip = :ip', array(
    ':ip' => $ip,
  ))
    ->fetchField();
  return (bool) $denied;
}