Commit fc6da409 authored by terry%mozilla.org's avatar terry%mozilla.org

Oops. Accounts created via the "createaccount.cgi" page were not

getting their password emailed to them.
parent 08c985ad
...@@ -325,31 +325,8 @@ sub CheckEmailSyntax { ...@@ -325,31 +325,8 @@ sub CheckEmailSyntax {
sub confirm_login { sub MailPassword {
my ($nexturl) = (@_); my ($login, $password) = (@_);
# Uncommenting the next line can help debugging...
# print "Content-type: text/plain\n\n";
ConnectToDatabase();
if (defined $::FORM{"Bugzilla_login"} &&
defined $::FORM{"Bugzilla_password"}) {
my $enteredlogin = $::FORM{"Bugzilla_login"};
my $enteredpwd = $::FORM{"Bugzilla_password"};
CheckEmailSyntax($enteredlogin);
my $realcryptpwd = PasswordForLogin($::FORM{"Bugzilla_login"});
if (defined $::FORM{"PleaseMailAPassword"}) {
my $realpwd;
if ($realcryptpwd eq "") {
$realpwd = InsertNewUser($enteredlogin);
} else {
SendSQL("select password from profiles where login_name = " .
SqlQuote($enteredlogin));
$realpwd = FetchOneColumn();
}
my $urlbase = Param("urlbase"); my $urlbase = Param("urlbase");
my $template = "From: bugzilla-daemon my $template = "From: bugzilla-daemon
To: %s To: %s
...@@ -366,8 +343,7 @@ To use the wonders of bugzilla, you can use the following: ...@@ -366,8 +343,7 @@ To use the wonders of bugzilla, you can use the following:
(Your bugzilla and CVS password, if any, are not currently synchronized. (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.) Top hackers are working around the clock to fix this, as you read this.)
"; ";
my $msg = sprintf($template, $enteredlogin, $enteredlogin, my $msg = sprintf($template, $login, $login, $password);
$realpwd);
open SENDMAIL, "|/usr/lib/sendmail -t"; open SENDMAIL, "|/usr/lib/sendmail -t";
print SENDMAIL $msg; print SENDMAIL $msg;
...@@ -376,9 +352,38 @@ To use the wonders of bugzilla, you can use the following: ...@@ -376,9 +352,38 @@ To use the wonders of bugzilla, you can use the following:
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
print "<H1>Password has been emailed.</H1>\n"; print "<H1>Password has been emailed.</H1>\n";
print "The password for the e-mail address\n"; print "The password for the e-mail address\n";
print "$enteredlogin has been e-mailed to that 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 "<p>When the e-mail arrives, you can click <b>Back</b>\n";
print "and enter your password in the form there.\n"; print "and enter your password in the form there.\n";
}
sub confirm_login {
my ($nexturl) = (@_);
# Uncommenting the next line can help debugging...
# print "Content-type: text/plain\n\n";
ConnectToDatabase();
if (defined $::FORM{"Bugzilla_login"} &&
defined $::FORM{"Bugzilla_password"}) {
my $enteredlogin = $::FORM{"Bugzilla_login"};
my $enteredpwd = $::FORM{"Bugzilla_password"};
CheckEmailSyntax($enteredlogin);
my $realcryptpwd = PasswordForLogin($::FORM{"Bugzilla_login"});
if (defined $::FORM{"PleaseMailAPassword"}) {
my $realpwd;
if ($realcryptpwd eq "") {
$realpwd = InsertNewUser($enteredlogin);
} else {
SendSQL("select password from profiles where login_name = " .
SqlQuote($enteredlogin));
$realpwd = FetchOneColumn();
}
MailPassword($enteredlogin, $realpwd);
exit; exit;
} }
......
...@@ -53,7 +53,8 @@ if (defined $login) { ...@@ -53,7 +53,8 @@ if (defined $login) {
print "the <b>E-mail me a password</b> button.\n"; print "the <b>E-mail me a password</b> button.\n";
exit; 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 "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 "password has been e-mailed to that address. When it is\n";
print "received, you may <a href=query.cgi?GoAheadAndLogIn>click\n"; print "received, you may <a href=query.cgi?GoAheadAndLogIn>click\n";
......
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