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

index e87fd60faa8985fb9514196066506a7d509519df..85ab762bb3a9012e0496e32f4d4cdc6e6fd09691 100644 (file)
@@ -253,14 +253,6 @@ class EmailregisterAction extends Action
 
     function setPassword()
     {
-        if (!$this->tos) {
-            $this->error = _('You must accept the terms of service and privacy policy to register.');
-            $nickname = $this->nicknameFromEmail($this->email);
-            $this->form = new ConfirmRegistrationForm($this, $nickname, $this->email, $this->code);
-            $this->showPage();
-            return;
-        }
-
         if (!empty($this->invitation)) {
             $email = $this->invitation->address;
         } else if (!empty($this->confirmation)) {
@@ -269,6 +261,14 @@ class EmailregisterAction extends Action
             throw new Exception('No confirmation thing.');
         }
 
+        if (!$this->tos) {
+            $this->error = _('You must accept the terms of service and privacy policy to register.');
+            $nickname = $this->nicknameFromEmail($email);
+            $this->form = new ConfirmRegistrationForm($this, $nickname, $this->email, $this->code);
+            $this->showPage();
+            return;
+        }
+
         $nickname = $this->nicknameFromEmail($email);
 
         $this->user = User::registerNew(array('nickname' => $nickname,
@@ -360,7 +360,7 @@ class EmailregisterAction extends Action
         
         $nickname = $parts[0];
         
-        $nickname = preg_replace('/[^A-Za-z0-9]/', '', $str);
+        $nickname = preg_replace('/[^A-Za-z0-9]/', '', $nickname);
 
         $nickname = Nickname::normalize($nickname);