Skip to content

Commit

Permalink
Merge pull request #692 from causefx/cero-dev
Browse files Browse the repository at this point in the history
email fix on register
  • Loading branch information
causefx authored Oct 27, 2017
2 parents 2d9ab3b + ab2e3ae commit 47e41b9
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions user.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 47e41b9

Please sign in to comment.