From 061e95f4b170053b395830e29d9c959abcb0bd43 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 22 Mar 2019 12:57:31 +0000 Subject: [PATCH] Bug 22561: Forgotten password requirements hint doesn't list all rules for new passwords This patch modifies a few templates in the OPAC so that all available information on password requirements is displayed for each case where the patron is setting a password: - If the RequireStrongPassword system preference is set, a message should appear listing strong password requirements and minimum password length. - If RequireStrongPassword is not set, the message should only ask for a minimum password length. To test, apply the patch and enable the PatronSelfRegistration and OpacResetPassword preferences. On the following pages, test with RequireStrongPassword both on and off. The correct messages should appear. - OPAC -> Forgot password. Follow the process to reset your password until you reach the step where you are entering the new password. - OPAC -> Register here. Check the password section of the registration form. - OPAC -> Log in -> Change your password. Signed-off-by: Liz Rea Signed-off-by: Tomas Cohen Arazi Signed-off-by: Nick Clemens (cherry picked from commit 50be1c4006e0a1d7e3b537bd849bc77f7a6bb56f) Signed-off-by: Martin Renvoize (cherry picked from commit e3e64974d830a8699e8648a82d21a7ffce502955) Signed-off-by: Lucas Gass --- .../opac-tmpl/bootstrap/en/modules/opac-memberentry.tt | 8 ++++++-- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-passwd.tt | 7 ++++++- .../bootstrap/en/modules/opac-password-recovery.tt | 8 ++++++-- 3 files changed, 18 insertions(+), 5 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 7b391960af..330e146b4c 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -808,9 +808,13 @@
Password
-

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

+ [% IF ( Koha.Preference('RequireStrongPassword') ) %] +

Your password must contain at least [% Koha.Preference('minPasswordLength') | html %] characters, including UPPERCASE, lowercase and numbers.

+ [% ELSE %] +

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

+ [% END %] [% UNLESS mandatory.defined('password') %] -
If you do not enter a password a system generated password will be created.
+

If you do not enter a password a system generated password will be created.

[% END %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-passwd.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-passwd.tt index f34b9193a7..b62192365b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-passwd.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-passwd.tt @@ -53,9 +53,14 @@ [% IF ( OpacPasswordChange ) %] [% IF ( Ask_data ) %] +
- [% UNLESS ( ShortPass ) %]
Your password must be at least [% minPasswordLength%] characters long.
[% END %] + [% IF ( Koha.Preference('RequireStrongPassword') ) %] +
Your password must contain at least [% Koha.Preference('minPasswordLength') | html %] characters, including UPPERCASE, lowercase and numbers.
+ [% ELSE %] +
Your password must be at least [% Koha.Preference('minPasswordLength') | html %] characters long.
+ [% END %] 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 e1b4ba0a06..aca5a532a3 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 @@ -103,7 +103,11 @@
-
The password must contain at least [% minPasswordLength %] characters.
+ [% IF ( Koha.Preference('RequireStrongPassword') ) %] +
Your password must contain at least [% Koha.Preference('minPasswordLength') | html %] characters, including UPPERCASE, lowercase and numbers.
+ [% ELSE %] +
Your password must be at least [% Koha.Preference('minPasswordLength') | html %] characters long.
+ [% END %] @@ -122,7 +126,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) %]
-- 2.39.5