]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
set nickname correctly
authorEvan Prodromou <evan@prodromou.name>
Wed, 18 Jun 2008 06:11:17 +0000 (02:11 -0400)
committerEvan Prodromou <evan@prodromou.name>
Wed, 18 Jun 2008 06:11:17 +0000 (02:11 -0400)
darcs-hash:20080618061117-84dde-6983ed79c2d0e985fc8b00ac7c270b46d92bc20d.gz

actions/finishopenidlogin.php

index af5ffdf14d6b27c9166ad666fa1d10f87b9e16c3..80663f4c95c442de04694c1c00a03c5ada2336a6 100644 (file)
@@ -278,6 +278,7 @@ class FinishopenidloginAction extends Action {
                        $profile->delete();
                }
                
+               common_set_user($user->nickname);
                common_redirect(common_local_url('profilesettings'));
        }
        
@@ -334,9 +335,13 @@ class FinishopenidloginAction extends Action {
        function best_new_nickname($display, $sreg) {
                
                # Try the passed-in nickname
-               
-               if ($sreg['nickname'] && $this->is_new_nickname($sreg['nickname'])) {
-                       return $sreg['nickname'];
+
+
+               if ($sreg['nickname']) {
+                       $nickname = $this->nicknamize($sreg['nickname']);
+                       if ($this->is_new_nickname($nickname)) {
+                               return $nickname;
+                       }
                }
 
                # Try the full name