attributes: fix attributes mapping
This commit is contained in:
parent
bb7c95c4c7
commit
143d389a1a
|
@ -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');
|
||||
|
|
Reference in New Issue