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 ++-- skins/standard/global.css | 17 ++++ .../en/default/account/auth/login-small.html.tmpl | 2 +- template/en/default/account/auth/login.html.tmpl | 105 +++++++++++---------- .../default/account/request-new-password.html.tmpl | 35 +++++++ 5 files changed, 119 insertions(+), 59 deletions(-) create mode 100644 template/en/default/account/request-new-password.html.tmpl 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()); +} diff --git a/skins/standard/global.css b/skins/standard/global.css index 6d0e64a86..6e3b41fd7 100644 --- a/skins/standard/global.css +++ b/skins/standard/global.css @@ -254,6 +254,23 @@ } /* generic (end) */ +#login_form { + border: solid; + margin: 2em auto; + padding: 1em; + width: 35em; +} + +#login_form #Bugzilla_login, #login_form #Bugzilla_password, +#forgot_password #loginname { + width: 25em; +} + +#login_form .links { + text-align: center; + padding: 1em; +} + /* Links that control whether or not something is visible. */ a.controller { font-size: 115%; diff --git a/template/en/default/account/auth/login-small.html.tmpl b/template/en/default/account/auth/login-small.html.tmpl index 790c135bf..508151241 100644 --- a/template/en/default/account/auth/login-small.html.tmpl +++ b/template/en/default/account/auth/login-small.html.tmpl @@ -58,7 +58,7 @@
  • | - Forgot Password
    diff --git a/template/en/default/account/auth/login.html.tmpl b/template/en/default/account/auth/login.html.tmpl index 0af84542d..85b3be8fb 100644 --- a/template/en/default/account/auth/login.html.tmpl +++ b/template/en/default/account/auth/login.html.tmpl @@ -20,12 +20,12 @@ [% USE Bugzilla %] -

    - [% terms.Bugzilla %] needs a legitimate login and password to continue. -

    +

    + [% terms.Bugzilla %] needs a legitimate login and password to continue +

    - + + [% IF Param('rememberlogin') == 'defaulton' || Param('rememberlogin') == 'defaultoff' %] - - + [% END %] - - + + + + + +
    @@ -33,44 +33,54 @@ [% IF Param('emailsuffix') %] Login: [% ELSE %] - Your Email Address: + Email Address: [% END %] - [% Param('emailsuffix') FILTER html %]
    - +
      + - + +
      + +
      + +
    [% PROCESS "global/hidden-fields.html.tmpl" @@ -78,49 +88,42 @@ - -

    - (Note: you should make sure cookies are enabled for this site. - Otherwise, you will be required to log in frequently.) -

    -
    - -[% Hook.process('additional_methods') %] + [% Hook.process('additional_methods') %] -[%# Allow the user to create a new account, or request a token to change - # their password, assuming that our auth method allows that. - #%] + +
    +

    - If you don't have a [% terms.Bugzilla %] account, you can - create a new account. - [% IF Param("requirelogin") %] - A user account is required because this Bugzilla - installation is only accessible to authenticated users. - [% ELSIF target.match("_bug\.cgi$") %] - A user account is required to file a new [% terms.bug %] or to comment - into existing ones so that you can be contacted if more information is - needed. - [% END %] + Note: you should make sure cookies are enabled for this site. + Otherwise, you will be required to log in frequently.

    - [% END %] - - [% IF user.authorizer.can_change_password %] -
    - -
    - - If you have an account, but have forgotten your password, - enter your login name below and submit a request - to change your password.
    - - - -
    - [% END %] + + [% IF can_create_account %] +

    + [% IF Param("requirelogin") %] + A user account is required because this Bugzilla + installation is only accessible to authenticated users. + [% ELSIF target.match("_bug\.cgi$") %] + A user account is required to file a new [% terms.bug %] or to comment + into existing ones so that you can be contacted if more information is + needed. + [% END %] +

    + [% END %] +
    + [% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/account/request-new-password.html.tmpl b/template/en/default/account/request-new-password.html.tmpl new file mode 100644 index 000000000..a94b3a114 --- /dev/null +++ b/template/en/default/account/request-new-password.html.tmpl @@ -0,0 +1,35 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + +[% PROCESS global/header.html.tmpl title = "Reset Password" %] + +[% IF user.authorizer.can_change_password %] +

    + If you have an account, but have forgotten your password, enter your + [% IF Param('emailsuffix') %] + login name + [% ELSE %] + email address + [% END %] + below and submit a request to change your password. An email with details + on how to reset your password will be sent. +

    + +
    + + + + +
    +[% ELSE %] +

    Sorry, but you cannot reset your password.

    +[% END %] + +[% PROCESS global/footer.html.tmpl %] -- cgit v1.2.3-24-g4f1b