Commit 1cee8ef5 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 299572: Move MailPassword() from CGI.pl into BugMail.pm (and remove an…

Bug 299572: Move MailPassword() from CGI.pl into BugMail.pm (and remove an unused variable) - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=justdave
parent 2e473917
......@@ -658,4 +658,15 @@ sub PerformSubsts ($;$) {
return $str;
}
# Send the login name and password of the newly created account to the user.
sub MailPassword ($$) {
my ($login, $password) = (@_);
my $template = Param("passwordmail");
my $msg = PerformSubsts($template,
{"mailaddress" => $login . Param('emailsuffix'),
"login" => $login,
"password" => $password});
MessageToMTA($msg);
}
1;
......@@ -186,18 +186,6 @@ sub CheckEmailSyntax {
}
}
sub MailPassword {
my ($login, $password) = (@_);
my $urlbase = Param("urlbase");
my $template = Param("passwordmail");
my $msg = PerformSubsts($template,
{"mailaddress" => $login . Param('emailsuffix'),
"login" => $login,
"password" => $password});
Bugzilla::BugMail::MessageToMTA($msg);
}
sub PutHeader {
($vars->{'title'}, $vars->{'h1'}, $vars->{'h2'}) = (@_);
......
......@@ -32,6 +32,7 @@ require "CGI.pl";
use Bugzilla::Constants;
use Bugzilla::User;
use Bugzilla::BugMail;
# Shut up misguided -w warnings about "used only once":
use vars qw(
......@@ -81,7 +82,7 @@ if (defined($login)) {
# Create account
my $password = insert_new_user($login, $realname);
MailPassword($login, $password);
Bugzilla::BugMail::MailPassword($login, $password);
$template->process("account/created.html.tmpl", $vars)
|| ThrowTemplateError($template->error());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment