You are here

function maintenance_exempt_by_cidr_notation in Maintenance Exempt 7

Same name and namespace in other branches
  1. 8 maintenance_exempt.module \maintenance_exempt_by_cidr_notation()

Helper function to go through array looking in an attempt to match netmask.

1 call to maintenance_exempt_by_cidr_notation()
maintenance_exempt_ip_match in ./maintenance_exempt.module
Check whether an IP address should be exempt from maintenance mode.

File

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

Code

function maintenance_exempt_by_cidr_notation($ip) {
  $exploded_entries = maintenance_exempt_get_ips();
  foreach ($exploded_entries as $entry) {
    if (strstr($entry, "/")) {
      if (maintenance_exempt_ipCIDRCheck($ip, $entry)) {
        return TRUE;
      }
    }
  }
  return FALSE;
}