You are here

function ip_geoloc_debug_flag in IP Geolocation Views & Maps 7

Same name and namespace in other branches
  1. 8 ip_geoloc.module \ip_geoloc_debug_flag()

Returns whether debug is on for the current user.

@global type $user

Return value

boolean

2 calls to ip_geoloc_debug_flag()
ip_geoloc_debug in ./ip_geoloc.module
Special debug function: messages selected user names only.
ip_geoloc_plugin_style_extract_locations in views/ip_geoloc_plugin_style.inc
Extract an array of locations from the supplied views_plugin_style.

File

./ip_geoloc.module, line 864
IPGV&M is a mapping engine for Views that contain locations of entities and/or visitors. Google Maps, Leaflet and OpenLayers2 maps are all supported. and available through this module. Using a number of optional sources IPGV&M also retrieves…

Code

function ip_geoloc_debug_flag() {
  global $user;
  $user_names = explode(',', check_plain(variable_get('ip_geoloc_debug')));
  foreach ($user_names as $user_name) {
    $user_name = drupal_strtolower(trim($user_name));
    $match = isset($user->name) ? $user_name == drupal_strtolower(trim($user->name)) : $user_name == 'anon' || $user_name == 'anonymous';
    if ($match) {
      return TRUE;
    }
  }
  return FALSE;
}