]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 299572: Move MailPassword() from CGI.pl into BugMail.pm (and remove an unused...
authorlpsolit%gmail.com <>
Mon, 11 Jul 2005 07:40:58 +0000 (07:40 +0000)
committerlpsolit%gmail.com <>
Mon, 11 Jul 2005 07:40:58 +0000 (07:40 +0000)
Bugzilla/BugMail.pm
CGI.pl
createaccount.cgi

index faa30b09029d79dd3facd4dc4179d28512cb48cc..a1fdefde04bb6a191a06feed71c9ce57bb1ce503 100644 (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;
diff --git a/CGI.pl b/CGI.pl
index e00881ade29276cae1ae8007a494f5da330ea820..27e9fab2651effaca780d762d6ad05fb9dcbefb9 100644 (file)
--- 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'}) = (@_);
      
index 9d9f55d8ad78cebbbd2776fb06cfae0a942d6561..499e200e7198de747365c3329bcb104cf40e235f 100755 (executable)
@@ -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());