You are here

function autoban_can_banned in Automatic IP ban (Autoban) 7

May IP address can be banned

Parameters

string $ip: IP address.

string $hostname: Original IP address.

Return value

bool IP address can be banned.

2 calls to autoban_can_banned()
autoban_ban in ./autoban.module
Ban IP's for rules.
autoban_ban_manual in ./autoban.module
Ban IP manually.

File

./autoban.module, line 935
Main file for autoban module.

Code

function autoban_can_banned($ip, $hostname = NULL) {
  if (empty($hostname)) {
    $hostname = $ip;
  }
  $is_own_ip = _autoban_is_own_ip($ip);
  if ($is_own_ip) {
    return FALSE;
  }
  $ip_in_whitelist = autoban_whitelist_ip($hostname);
  if ($ip_in_whitelist) {
    return FALSE;
  }
  return TRUE;
}