You are here

function system_status_access_callback in System Status 6.2

Same name and namespace in other branches
  1. 8.2 system_status.module \system_status_access_callback()
  2. 8 system_status.module \system_status_access_callback()
  3. 7 system_status.module \system_status_access_callback()

Access callback: Check authorized IP.

See also

system_status_menu()

1 string reference to 'system_status_access_callback'
system_status_menu in ./system_status.module
Implements hook_menu().

File

./system_status.module, line 64
Drupal system status

Code

function system_status_access_callback($token = FALSE) {
  if ($token !== variable_get('system_status_token', "")) {
    return FALSE;
  }
  $ip_address = ip_address();
  if (variable_get('system_status_service_allow_drupalstatus', 1) == 1) {
    if ($ip_address == gethostbyname("status.drupalstatus.org.")) {
      return TRUE;
    }
  }
  return FALSE;
}