]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
get email for code
authorEvan Prodromou <evan@status.net>
Sun, 17 Apr 2011 23:28:22 +0000 (19:28 -0400)
committerEvan Prodromou <evan@status.net>
Sun, 17 Apr 2011 23:28:22 +0000 (19:28 -0400)
plugins/EmailRegistration/emailregister.php

index 6d5adf62ba9ec48b0a35f886fd6c644b8b276bcd..e87fd60faa8985fb9514196066506a7d509519df 100644 (file)
@@ -236,11 +236,17 @@ class EmailregisterAction extends Action
 
     function confirmRegistration()
     {
-        $nickname = $this->nicknameFromEmail($this->email);
+        if (!empty($this->invitation)) {
+            $email = $this->invitation->address;
+        } else if (!empty($this->confirmation)) {
+            $email = $this->confirmation->address;
+        }
+        
+        $nickname = $this->nicknameFromEmail($email);
 
         $this->form = new ConfirmRegistrationForm($this,
                                                   $nickname,
-                                                  $this->email,
+                                                  $email,
                                                   $this->invitation->code);
         $this->showPage();
     }
@@ -356,7 +362,7 @@ class EmailregisterAction extends Action
         
         $nickname = preg_replace('/[^A-Za-z0-9]/', '', $str);
 
-        $nickname = Nickname::normalize($parts[0]);
+        $nickname = Nickname::normalize($nickname);
 
         $original = $nickname;