You are here

function simplesamlphp_auth_is_authenticated in simpleSAMLphp Authentication 7.2

Same name and namespace in other branches
  1. 7.3 simplesamlphp_auth.inc \simplesamlphp_auth_is_authenticated()

Determine if the current user is authenticated through SAML.

Return value

bool TRUE if the current user is authenticated through SAML. FALSE otherwise.

File

./simplesamlphp_auth.module, line 846
simpleSAMLphp authentication module for Drupal.

Code

function simplesamlphp_auth_is_authenticated() {
  global $_simplesamlphp_auth_as;

  // Assume that the user isn't authenticated until proven otherwise.
  $authenticated = FALSE;

  // If the global variable exists, and the auth flag is set, note it.
  if (isset($_simplesamlphp_auth_as) && $_simplesamlphp_auth_as
    ->isAuthenticated()) {
    $authenticated = TRUE;
  }

  // Return the result.
  return $authenticated;
}