From 92158ec27436ea907845b76f0120e6fdde666099 Mon Sep 17 00:00:00 2001 From: Jenny Way Date: Wed, 17 Jan 2018 03:34:07 +0000 Subject: [PATCH] Bug 19660: Set password after self registration Test plan: 1. Enable PatronSelfRegistration 2. Add a PatronSelfRegistrationDefaultCategory too 3. In OPAC register a user 4. Without patch after hitting submit, password is displayed onscreen 5. After applying patch, password is changed afterwards by sending a email 6. Note how primary email is required Notes - Email is now required for this to work since a unique key was needed for password-recovery.pl to work - A password is randomly generated for the user Signed-off-by: Laurence Rault Signed-off-by: Mark Tompsett --- .../bootstrap/en/modules/opac-memberentry.tt | 44 +-------- .../bootstrap/en/modules/opac-password-recovery.tt | 2 +- .../en/modules/opac-registration-confirmation.tt | 108 ++++++++++++++++++--- 3 files changed, 99 insertions(+), 55 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt index c903453..8fdd5e8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -510,14 +510,9 @@ [% UNLESS hidden.defined('email') %]
  • - [% IF mandatory.defined('email') %] - - [% ELSE %] - - [% END %] - + - [% IF mandatory.defined('email') %]Required[% END %] + Required
  • [% END %] @@ -803,40 +798,6 @@ [% END %] - [% UNLESS action == 'edit' || hidden.defined('password') %] -
    - Password -
    -

    Your password must be at least [% Koha.Preference('minPasswordLength') %] characters long.

    - [% UNLESS mandatory.defined('password') %] -
    If you do not enter a password a system generated password will be created.
    - [% END %] -
    - - [% IF mandatory.defined('password') %] -
      -
    1. - - Required -
    2. -
    3. - - Required -
    4. -
    - [% ELSE %] -
      -
    1. - -
    2. -
    3. - -
    4. -
    - [% END %] -
    - [% END %] - [% IF ( Koha.Preference('ExtendedPatronAttributes') && patron_attribute_classes.size && !Koha.Preference('PatronSelfRegistrationVerifyByEmail') ) %] [% FOREACH pa_class IN patron_attribute_classes %] [% IF pa_class.class %] @@ -893,6 +854,7 @@ [% END %] [% UNLESS action == 'edit' %] + Confirm:
      diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt index c9beb40..e03f545 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt @@ -122,7 +122,7 @@
      Please click the link in this email to finish the process of resetting your password.
      This link is valid for 2 days starting now.

      - Return to the main page + Return to the main page [% ELSIF (password_reset_done) %]
      diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt index 464505d..4dc95c6 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt @@ -40,10 +40,90 @@ Username: [% borrower.userid %]

      -

      - Password: - [% password_cleartext | html %] -

      + [% IF (hasError) %] +
      +

      Error

      +

      + [% IF (sendmailError) %] + An error has occurred while sending you the password recovery link. +
      Please try again later. + [% ELSIF (errNoBorrowerFound) %] + No account was found with the provided information. + [% ELSIF (errMultipleAccountsForEmail) %] + Account identification with this email address only is ambiguous. +
      Please use the field 'Login' as well. + [% ELSIF (errAlreadyStartRecovery) %] + The process of changing passwords has already been started for this account + [% IF username %] + ("[% username %]") + [% ELSIF email %] + ("[% email %]") + [% END %] +
      You should have received an email with a link to reset your password. +
      If you did not receive this email, you can request a new one: Get new password link + [% ELSIF (errPassNotMatch) %] + The passwords do not match. + [% ELSIF password_too_short %] +

    1. Password must be at least [% minPasswordLength %] characters long.
    2. + [% ELSIF password_too_weak %] +
    3. Password must contain at least one digit, one lowercase and one uppercase.
    4. + [% ELSIF password_has_whitespaces %] +
    5. Password must not contain leading or trailing whitespaces.
    6. + [% ELSIF (errLinkNotValid) %] + The link you clicked is either invalid, or expired. +
      Be sure you used the link from the email, or contact library staff for assistance. + [% END %] +

      +

      Please contact the library if you need further assistance.

      +
      + [% END %] + + +
      +
      + +
      +

      You have been assigned a randomly generated password. To change your password, enter your email address.

      + + +
      + +
      +
      +
      + [% ELSIF (new_password) %] +
      + +
      +
      The password must contain at least [% minPasswordLength %] characters.
      + + + + +
      + + + +
      +
      +
      + [% ELSIF (mail_sent) %] +
      +

      + You will receive an email shortly. +
      Please click the link in this email to finish the process of resetting your password. +
      This link is valid for 2 days starting now. +

      + Return to the main page +
      + [% ELSIF (password_reset_done) %] +
      +

      The password has been changed for user "[% username %]".

      + Click here to login. +
      + [% END %] +
      + [% IF borrower.cardnumber %]

      @@ -53,7 +133,6 @@ [% END %]

      For your convenience, the login box on this page has been pre-filled with this data. Please log in[% IF OpacPasswordChange %] and change your password[% END %].

      - [% END %]
      [% PatronSelfRegistrationAdditionalInstructions %]
      @@ -76,16 +155,19 @@ [% ELSE %] [% END %] - - [% IF Koha.Preference('PatronSelfRegistrationPrefillForm') %] - - [% ELSE %] - - [% END %] -
      +

      + Password: + [% password_cleartext | html %] +

      + +
      - [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]

      Don't have an account? Register here.

      [% END %] + [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %] +
      +

      Don't have an account? Register here.

      +
      + [% END %]
      -- 2.1.4