You are here

function maintenance_exempt_ip_match in Maintenance Exempt 7

Check whether an IP address should be exempt from maintenance mode.

Return value

bool TRUE if the address is in the IP list, either directly or in CIDR notation.

1 call to maintenance_exempt_ip_match()
maintenance_exempt_menu_site_status_alter in ./maintenance_exempt.module
Implements hook_menu_site_status_alter().

File

./maintenance_exempt.module, line 125
Allow exemption of maintenance mode based on either certain set IP addresses or matching a set query string value.

Code

function maintenance_exempt_ip_match() {
  $address = ip_address();
  if (in_array($address, maintenance_exempt_get_ips())) {
    return TRUE;
  }
  if (maintenance_exempt_by_cidr_notation($address)) {
    return TRUE;
  }
  return FALSE;
}