]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Register.php
Merge pull request #10627 from annando/like-announce
[friendica.git] / src / Module / Register.php
index 3e50de8972f732d617fc5c9e7526c0367403911e..6e36023f3837bd35ca5375cfbfe708f83fc2d784 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -248,10 +248,6 @@ class Register extends BaseModule
                        DI::baseUrl()->redirect('register/');
                }
 
-
-               // Overwriting the "tar pit" field with the real one
-               $arr['email'] = $arr['field1'];
-
                if ($additional_account) {
                        $user = DBA::selectFirst('user', ['email'], ['uid' => local_user()]);
                        if (!DBA::isResult($user)) {
@@ -264,6 +260,9 @@ class Register extends BaseModule
 
                        $arr['password1'] = $arr['confirm'] = $arr['parent_password'];
                        $arr['repeat'] = $arr['email'] = $user['email'];
+               } else {
+                       // Overwriting the "tar pit" field with the real one
+                       $arr['email'] = $arr['field1'];
                }
 
                if ($arr['email'] != $arr['repeat']) {
@@ -365,7 +364,7 @@ class Register extends BaseModule
                        // send notification to admins
                        while ($admin = DBA::fetch($admins_stmt)) {
                                \notification([
-                                       'type'         => Model\Notify\Type::SYSTEM,
+                                       'type'         => Model\Notification\Type::SYSTEM,
                                        'event'        => 'SYSTEM_REGISTER_REQUEST',
                                        'uid'          => $admin['uid'],
                                        'link'         => $base_url . '/admin/users/',