You are here

function ldap_authentication_ldap_authenticated in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 8.3 ldap_authentication/ldap_authentication.module \ldap_authentication_ldap_authenticated()
  2. 7.2 ldap_authentication/ldap_authentication.module \ldap_authentication_ldap_authenticated()
  3. 7 ldap_authentication/ldap_authentication.module \ldap_authentication_ldap_authenticated()

Parameters

object $user:

Return value

boolean true if user is recorded as ldap authenticated and identified (ldap_authentified)

5 calls to ldap_authentication_ldap_authenticated()
ldap_authentication_show_ldap_help_link in ldap_authentication/ldap_authentication.module
ldap_authentication_show_reset_pwd in ldap_authentication/ldap_authentication.module
ldap_authentication_user_pass_validate in ldap_authentication/ldap_authentication.module
_ldap_authentication_form_user_profile_form_alter in ldap_authentication/ldap_authentication.inc
alter user editing form (profile form) based on ldap authentication configuration
_ldap_authorizations_user_authorizations in ldap_authorization/ldap_authorization.inc
return all desired authorizations for a given user

File

ldap_authentication/ldap_authentication.module, line 181
This module injects itself into Drupal's Authentication stack.

Code

function ldap_authentication_ldap_authenticated($user) {
  if (is_numeric($user)) {
    $user = @user_load((int) $user);
  }
  if (!is_object($user) || $user->uid == 0) {
    return FALSE;
  }
  $authmaps = db_query("SELECT module, authname FROM {authmap} WHERE uid = :uid", array(
    ':uid' => $user->uid,
  ))
    ->fetchAllKeyed();
  return isset($authmaps['ldap_user']);
}