You are here

function user_get_authmaps in Drupal 6

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

Discover which external authentication module(s) authenticated a username.

Parameters

$authname: A username used by an external authentication module.

Return value

An associative array with module as key and username as value.

File

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

Code

function user_get_authmaps($authname = NULL) {
  $result = db_query("SELECT authname, module FROM {authmap} WHERE authname = '%s'", $authname);
  $authmaps = array();
  $has_rows = FALSE;
  while ($authmap = db_fetch_object($result)) {
    $authmaps[$authmap->module] = $authmap->authname;
    $has_rows = TRUE;
  }
  return $has_rows ? $authmaps : 0;
}