]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Oops. Accounts created via the "createaccount.cgi" page were not
authorterry%mozilla.org <>
Sat, 8 May 1999 05:07:21 +0000 (05:07 +0000)
committerterry%mozilla.org <>
Sat, 8 May 1999 05:07:21 +0000 (05:07 +0000)
getting their password emailed to them.

CGI.pl
createaccount.cgi

diff --git a/CGI.pl b/CGI.pl
index 062d023482ba2ac79927fcefee495bc2cb14f8b3..ce58c54d1247c07bda6fac2b58c49f1cdc9dd508 100644 (file)
--- a/CGI.pl
+++ b/CGI.pl
@@ -325,6 +325,39 @@ sub CheckEmailSyntax {
 
 
 
+sub MailPassword {
+    my ($login, $password) = (@_);
+    my $urlbase = Param("urlbase");
+    my $template = "From: bugzilla-daemon
+To: %s
+Subject: Your bugzilla password.
+
+To use the wonders of bugzilla, you can use the following:
+
+ E-mail address: %s
+       Password: %s
+
+ To change your password, go to:
+ ${urlbase}changepassword.cgi
+
+ (Your bugzilla and CVS password, if any, are not currently synchronized.
+ Top hackers are working around the clock to fix this, as you read this.)
+";
+    my $msg = sprintf($template, $login, $login, $password);
+
+    open SENDMAIL, "|/usr/lib/sendmail -t";
+    print SENDMAIL $msg;
+    close SENDMAIL;
+
+    print "Content-type: text/html\n\n";
+    print "<H1>Password has been emailed.</H1>\n";
+    print "The password for the e-mail address\n";
+    print "$login has been e-mailed to that address.\n";
+    print "<p>When the e-mail arrives, you can click <b>Back</b>\n";
+    print "and enter your password in the form there.\n";
+}
+
+
 sub confirm_login {
     my ($nexturl) = (@_);
 
@@ -350,35 +383,7 @@ sub confirm_login {
                        SqlQuote($enteredlogin));
                $realpwd = FetchOneColumn();
             }
-            my $urlbase = Param("urlbase");
-            my $template = "From: bugzilla-daemon
-To: %s
-Subject: Your bugzilla password.
-
-To use the wonders of bugzilla, you can use the following:
-
- E-mail address: %s
-       Password: %s
-
- To change your password, go to:
- ${urlbase}changepassword.cgi
-
- (Your bugzilla and CVS password, if any, are not currently synchronized.
- Top hackers are working around the clock to fix this, as you read this.)
-";
-            my $msg = sprintf($template, $enteredlogin, $enteredlogin,
-                             $realpwd);
-            
-           open SENDMAIL, "|/usr/lib/sendmail -t";
-           print SENDMAIL $msg;
-           close SENDMAIL;
-
-            print "Content-type: text/html\n\n";
-            print "<H1>Password has been emailed.</H1>\n";
-            print "The password for the e-mail address\n";
-            print "$enteredlogin has been e-mailed to that address.\n";
-            print "<p>When the e-mail arrives, you can click <b>Back</b>\n";
-            print "and enter your password in the form there.\n";
+            MailPassword($enteredlogin, $realpwd);
             exit;
         }
 
index c6bef90cfe7803a89e5746214ad9b86243ab054a..3d1fa4c58d29b7ac4c647c92f2d897580add276a 100755 (executable)
@@ -53,7 +53,8 @@ if (defined $login) {
        print "the <b>E-mail me a password</b> button.\n";
        exit;
     }
-    DBNameToIdAndCheck($login, 1);
+    my $password = InsertNewUser($login);
+    MailPassword($login, $password);
     print "A bugzilla account for <tt>$login</tt> has been created.  The\n";
     print "password has been e-mailed to that address.  When it is\n";
     print "received, you may <a href=query.cgi?GoAheadAndLogIn>click\n";