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

This commit is contained in:
lpsolit%gmail.com 2005-07-11 00:40:59 +00:00
parent 47e87d82ac
commit 7c91495902
3 changed files with 13 additions and 13 deletions

View File

@ -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;

View File

@ -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'}) = (@_);

View File

@ -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());