function user_external_load

user_external_load($authname)

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.

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;
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!user!user.module/function/user_external_load/7.x