You are here

function geoip_ctools_plugin_region_ctools_access_check in GeoIP API 7.2

Same name in this branch
  1. 7.2 plugins/access/region.inc \geoip_ctools_plugin_region_ctools_access_check()
  2. 7.2 plugins/access/continent.inc \geoip_ctools_plugin_region_ctools_access_check()
  3. 7.2 plugins/access/country.inc \geoip_ctools_plugin_region_ctools_access_check()

Check for access.

3 string references to 'geoip_ctools_plugin_region_ctools_access_check'
continent.inc in plugins/access/continent.inc
country.inc in plugins/access/country.inc
region.inc in plugins/access/region.inc

File

plugins/access/region.inc, line 40

Code

function geoip_ctools_plugin_region_ctools_access_check($conf, $contexts) {

  // Ensure sane defaults.
  $conf += array(
    'regions' => '',
  );

  // Split the regions by new lines and remove left over spaces / carriage
  // returns.
  $regions = explode("\n", $conf['regions']);
  array_walk($regions, 'trim');
  return in_array(geoip_region_code(), $regions);
}