From ab2e3ae3a197eed8030253b15319e82bac836f4f Mon Sep 17 00:00:00 2001 From: causefx Date: Fri, 27 Oct 2017 16:38:16 -0700 Subject: [PATCH] email fix on register --- user.php | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/user.php b/user.php index 6e0eb1e94..658b71339 100755 --- a/user.php +++ b/user.php @@ -558,24 +558,6 @@ function register_user($username, $email, $sha1, &$registration_callback = false $this->error("Hack attempt has been made. What are you doing? Logging your IP now..."); return false; } - if($username && User::use_mail) - { - // send email notification - $subject = "Welcome to ".DOMAIN; - $language = new setLanguage; - $domain = getServerPath(); - $body = orgEmail( - $header = $language->translate('EMAIL_NEWUSER_HEADER'), - $title = $language->translate('EMAIL_NEWUSER_TITLE'), - $user = $username, - $mainMessage =$language->translate('EMAIL_NEWUSER_MESSAGE'), - $button = $language->translate('EMAIL_NEWUSER_BUTTON'), - $buttonURL = $domain, - $subTitle = $language->translate('EMAIL_NEWUSER_SUBTITLE'), - $subMessage = $language->translate('EMAIL_NEWUSER_SUBMESSAGE') - ); - $this->startEmail($email, $username, $subject, $body); - } // Does user already exist? (see notes on safe reporting) if(User::unsafe_reporting) { $query = "SELECT username FROM users WHERE username LIKE '$username' COLLATE NOCASE"; @@ -623,7 +605,27 @@ function register_user($username, $email, $sha1, &$registration_callback = false // if there is a callback, call it if($registration_callback !== false) { $registration_callback($username, $email, $dir); } if($settings !== 'true' && $settings !== true) { $this->login_user($username, $sha1, true, '', false); } - return true; } + //send email + if($username && User::use_mail) + { + // send email notification + $subject = "Welcome to ".DOMAIN; + $language = new setLanguage; + $domain = getServerPath(); + $body = orgEmail( + $header = $language->translate('EMAIL_NEWUSER_HEADER'), + $title = $language->translate('EMAIL_NEWUSER_TITLE'), + $user = $username, + $mainMessage =$language->translate('EMAIL_NEWUSER_MESSAGE'), + $button = $language->translate('EMAIL_NEWUSER_BUTTON'), + $buttonURL = $domain, + $subTitle = $language->translate('EMAIL_NEWUSER_SUBTITLE'), + $subMessage = $language->translate('EMAIL_NEWUSER_SUBMESSAGE') + ); + $this->startEmail($email, $username, $subject, $body); + } + return true; + } $this->error = "unknown database error occured."; $this->error("unknown database error occured."); return false;