]> git.mxchange.org Git - friendica.git/blobdiff - mod/register.php
Merge remote-tracking branch 'upstream/develop' into 1502-contacts-in-scrape
[friendica.git] / mod / register.php
index eb6fda737fc69cf22e8216e9ac8e9a3643658671..4c0860e6e3f3362a9ace2b2a732886114e95a85b 100644 (file)
@@ -48,8 +48,6 @@ function register_post(&$a) {
        }
 
 
-       require_once('include/user.php');
-
        $arr = $_POST;
 
        $arr['blocked'] = $blocked;
@@ -81,20 +79,25 @@ function register_post(&$a) {
                        set_pconfig($user['uid'],'system','invites_remaining',$num_invites);
                }
 
-               send_register_open_eml(
+               $res = send_register_open_eml(
                        $user['email'],
                        $a->config['sitename'],
                        $a->get_baseurl(),
                        $user['username'],
                        $result['password']);
 
-
                if($res) {
                        info( t('Registration successful. Please check your email for further instructions.') . EOL ) ;
                        goaway(z_root());
                }
                else {
-                       notice( t('Failed to send email message. Here is the message that failed.') . $email_tpl . EOL );
+                       notice(
+                               sprintf(
+                                       t('Failed to send email message. Here your accout details:<br> login: %s<br> password: %s<br><br>You can change your password after login.'),
+                                        $user['email'],
+                                        $result['password']
+                                        ). EOL
+                       );
                }
        }
        elseif($a->config['register_policy'] == REGISTER_APPROVE) {
@@ -135,7 +138,7 @@ function register_post(&$a) {
                                'source_link' => $a->get_baseurl()."/admin/users/",
                                'link' => $a->get_baseurl()."/admin/users/",
                                'source_photo' => $a->get_baseurl() . "/photo/avatar/".$user['uid'].".jpg",
-                               'to_email' => $admin['mail'],
+                               'to_email' => $admin['email'],
                                'uid' => $admin['uid'],
                                'language' => ($admin['language']?$admin['language']:'en'))
                        );