attributes: fix attributes mapping

This commit is contained in:
Jérôme Schneider 2013-06-07 12:30:50 +02:00
parent bb7c95c4c7
commit 143d389a1a
1 changed files with 4 additions and 3 deletions

View File

@ -53,11 +53,12 @@ function login_saml_successfull()
spip_log("[auth_saml] Traitement login SAML");
$attributes = $simplesaml->getAttributes();
spip_log("ATTRIBUTES: " . print_r($attributes, true));
$login = $attributes['uid'][0];
$first_name = $attributes['gn'][0];
$last_name = $attributes['Nom'][0];
$last_name = $attributes['sn'][0];
$email = $attributes['email'][0];
$given_name = $first_name . ' ' . $last_name;
$display_name = $first_name . ' ' . $last_name;
spip_log("[auth_saml] authentification reussi pour l'utilisateur =".$login);
@ -70,7 +71,7 @@ function login_saml_successfull()
if ($row_auteur) {
$GLOBALS['auteur_session'] = $row_auteur;
spip_log("[auth_saml] updating user [" . $login . "] attributes : ". $given_name);
spip_log("[auth_saml] updating user [" . $login . "] attributes : ". $display_name);
spip_query("UPDATE spip_auteurs SET nom=" . _q($display_name) . ", email=" . _q($email) . " WHERE login="._q($login));
$session = charger_fonction('session', 'inc');