You are here

function maintenance_exempt_get_ips in Maintenance Exempt 8

Same name and namespace in other branches
  1. 7 maintenance_exempt.module \maintenance_exempt_get_ips()

Get list of exempt IP addresses from settings.

Return value

array URLs that should be exempt from maintenance mode.

2 calls to maintenance_exempt_get_ips()
MaintenanceModeExempt::exempt in src/MaintenanceModeExempt.php
Determines whether a user has access to the site in maintenance mode.
maintenance_exempt_by_cidr_notation in ./maintenance_exempt.module
Check if an IP address using CIDR notation should be exempt.

File

./maintenance_exempt.module, line 105
Allow exemption from maintenance mode.

Code

function maintenance_exempt_get_ips() {
  $config = \Drupal::config('maintenance_exempt.settings');
  $allowed_ips = $config
    ->get('exempt_ips');
  return array_map('trim', explode("\n", $allowed_ips));
}