From 1cee8ef54bf9806b30f39c1984275c1d82bfbf2c Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Mon, 11 Jul 2005 07:40:58 +0000 Subject: =?UTF-8?q?Bug=20299572:=20Move=20MailPassword()=20from=20CGI.pl?= =?UTF-8?q?=20into=20BugMail.pm=20(and=20remove=20an=20unused=20variable)?= =?UTF-8?q?=20-=20Patch=20by=20Fr=C3=A9d=C3=A9ric=20Buclin=20=20r=3Dmkanat=20a=3Djustdave?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/BugMail.pm | 11 +++++++++++ CGI.pl | 12 ------------ createaccount.cgi | 3 ++- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index faa30b090..a1fdefde0 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -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; diff --git a/CGI.pl b/CGI.pl index e00881ade..27e9fab26 100644 --- a/CGI.pl +++ b/CGI.pl @@ -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'}) = (@_); diff --git a/createaccount.cgi b/createaccount.cgi index 9d9f55d8a..499e200e7 100755 --- a/createaccount.cgi +++ b/createaccount.cgi @@ -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()); -- cgit v1.2.1