| Versionen | |
|---|---|
| drupal6 – drupal7 | user_get_authmaps($authname = NULL) |
Discover which external authentication module(s) authenticated a username.
$authname A username used by an external authentication module.
An associative array with module as key and username as value.
modules/
<?php
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;
}
?>
Kommentare
Kommentar hinzufügen