You are here

function user_external_load in Drupal 7

Same name and namespace in other branches
  1. 4 modules/user.module \user_external_load()
  2. 5 modules/user/user.module \user_external_load()
  3. 6 modules/user/user.module \user_external_load()

Fetches a user object based on an external authentication source.

Parameters

string $authname: The external authentication username.

Return value

A fully-loaded user object if the user is found or FALSE if not found.

3 calls to user_external_load()
openid_authentication in modules/openid/openid.module
Authenticate a user or attempt registration.
user_external_login_register in modules/user/user.module
Helper function for authentication modules. Either logs in or registers the current user, based on username. Either way, the global $user object is populated and login tasks are performed.
_openid_invalid_openid_transition in modules/openid/openid.inc
Provides transition for accounts with possibly invalid OpenID identifiers in authmap.

File

modules/user/user.module, line 249
Enables the user registration and login system.

Code

function user_external_load($authname) {
  $uid = db_query("SELECT uid FROM {authmap} WHERE authname = :authname", array(
    ':authname' => $authname,
  ))
    ->fetchField();
  if ($uid) {
    return user_load($uid);
  }
  else {
    return FALSE;
  }
}