DokuWiki

It's better when it's simple

User Tools

Site Tools


tips:change_user_name_after_authentication

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revisionBoth sides next revision
tips:change_user_name_after_authentication [2012-04-19 14:43] – created 81.83.17.184tips:change_user_name_after_authentication [2012-04-19 14:45] 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: 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:
  
-'' + 
-function checkPass(&$user,$pass) +  function checkPass(&$user,$pass) 
-{+  {
     if(user_authenticated($user,$pass)){     if(user_authenticated($user,$pass)){
-        $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{
-        return false;+      return false;
     }     }
-+  
-''+
tips/change_user_name_after_authentication.txt · Last modified: 2012-04-19 14:50 by 81.83.17.184

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki