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') %]
-
- [% 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' %]
+
+ [% 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 %]
+
Password must be at least [% minPasswordLength %] characters long.
+ [% ELSIF password_too_weak %]
+
Password must contain at least one digit, one lowercase and one uppercase.
+ [% ELSIF password_has_whitespaces %]
+
Password must not contain leading or trailing whitespaces.
+ [% 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.
+ 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.
+
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 %].