From cd00796d216adf82d18ed3b3a6bbcaa7b99b4619 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Wed, 11 Mar 2015 17:15:33 +0100 Subject: Bug 325315: The page to reset a forgotten password should be distinct from the login page r=dkl a=glob --- createaccount.cgi | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'createaccount.cgi') diff --git a/createaccount.cgi b/createaccount.cgi index a15396384..cd5309f05 100755 --- a/createaccount.cgi +++ b/createaccount.cgi @@ -27,10 +27,15 @@ my $vars = { doc_section => 'using/creating-an-account.html' }; print $cgi->header(); -$user->check_account_creation_enabled; my $login = $cgi->param('login'); +my $request_new_password = $cgi->param('request_new_password'); -if (defined($login)) { +if ($request_new_password) { + $template->process('account/request-new-password.html.tmpl', $vars) + || ThrowTemplateError($template->error()); +} +elsif (defined($login)) { + $user->check_account_creation_enabled; # Check the hash token to make sure this user actually submitted # the create account form. my $token = $cgi->param('token'); @@ -41,9 +46,9 @@ if (defined($login)) { $template->process("account/created.html.tmpl", $vars) || ThrowTemplateError($template->error()); - exit; } - -# Show the standard "would you like to create an account?" form. -$template->process("account/create.html.tmpl", $vars) - || ThrowTemplateError($template->error()); +else { + # Show the standard "would you like to create an account?" form. + $template->process('account/create.html.tmpl', $vars) + || ThrowTemplateError($template->error()); +} -- cgit v1.2.3-24-g4f1b