public function BanIpManager::isBanned

Returns if this IP address is banned.

Parameters

string $ip: The IP address to check.

Return value

bool TRUE if the IP address is banned, FALSE otherwise.

File

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

Class

BanIpManager
Ban IP manager.

Namespace

Drupal\ban

Code

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