You are here

function ip_ranges_check_ip in IP Ranges 7.2

Same name and namespace in other branches
  1. 7 ip_ranges.module \ip_ranges_check_ip()

Checks users ip first against the whitelist, then the blacklist if needed.

Parameters

$ip: Black- or whitelisted ip-address.

$current_ip: Ip to be checked against the list, usually users current ip-address.

Return value

TRUE if the ip is on the list, FALSE if it is not.

See also

ip_ranges_check_range()

1 call to ip_ranges_check_ip()
ip_ranges_boot in ./ip_ranges.module
Implements hook_boot().

File

./ip_ranges.module, line 96

Code

function ip_ranges_check_ip($ip, $current_ip) {
  $type = strpos($ip, '-') ? 'range' : 'single';
  return $type == 'single' ? $ip == $current_ip : ip_ranges_check_range($ip, $current_ip);
}