function 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.

1 call to user_get_authmaps()
UserAuthmapAssignmentTest::testAuthmapAssignment in drupal/core/modules/user/lib/Drupal/user/Tests/UserAuthmapAssignmentTest.php
Test authmap assignment and retrieval.

File

drupal/core/modules/user/user.module, line 1423
Enables the user registration and login system.

Code

function user_get_authmaps($authname = NULL) {
  $authmaps = db_query("SELECT module, authname FROM {authmap} WHERE authname = :authname", array(
    ':authname' => $authname,
  ))
    ->fetchAllKeyed();
  return count($authmaps) ? $authmaps : 0;
}