Returns whether an IP address is blocked.
string $ip: The IP address to check.
bool TRUE if access is denied, FALSE if access is allowed.
public function isDenied($ip) {
$denied = $this->connection
->query('SELECT 1 FROM {ban_ip} WHERE ip = :ip', array(
':ip' => $ip,
))
->fetchField();
return (bool) $denied;
}