tips:change_user_name_after_authentication
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
tips:change_user_name_after_authentication [2012-04-19 14:45] – 81.83.17.184 | tips:change_user_name_after_authentication [2012-04-19 14:50] (current) – 81.83.17.184 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | If you implemented a custom authentication backend and want to change the username provide by the user after authentication. Then implement your checkPass function with the $user parameter passed by reference: | + | ====== Change user name after authentication ====== |
+ | |||
+ | If you implemented a custom authentication backend and want to change the username provide by the user after authentication, e.g. you want to allow login via a unique id that could change sometime (e.g. email address), but use another unmodifiable unique id as permanent identifier in Dokuwiki. Then implement your checkPass function with the $user parameter passed by reference: | ||
Line 5: | Line 7: | ||
{ | { | ||
if(user_authenticated($user, | if(user_authenticated($user, | ||
- | $user = $some_unique_id_fetched_from_your_own_user_db; | + | $user = $some_unique_id_fetched_from_your_own_user_db; |
return true; | return true; | ||
}else{ | }else{ |
tips/change_user_name_after_authentication.1334839501.txt.gz · Last modified: 2012-04-19 14:45 by 81.83.17.184