Bug 37691: Improve visibility of password expiration reset link

This patch moves the password expiration reset link into the error box
so that it is more prominent.

To test, apply the patch and rebuild the staff interface
CSS:
https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface

Try to log in to the staff interface as a user whose password has
expired. You will probably have to use SQL to update a patron record
directly, e.g.

UPDATE borrowers SET password_expiration_date = '2022-01-01' WHERE borrowernumber = X;

When you submit your login details the page should reload with an error
message: "Error: Your password has expired." Within the red dialog you
should see the "You must reset your password" link.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Owen Leonard 2024-08-21 10:31:09 +00:00 committed by Katrin Fischer
parent 068d0c43c1
commit 8deb7f7795
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834
2 changed files with 20 additions and 12 deletions

View file

@ -71,11 +71,13 @@ label {
#login #login_error a:link,
#login #login_error a:visited {
color : #FFC;
text-decoration: underline;
}
#login #login_error a:hover,
#login #login_error a:active {
color : #FCFC4D;
text-decoration: underline;
}
#login h1 {

View file

@ -70,19 +70,25 @@
[% END %]
[% IF too_many_login_attempts %]
<div id="login_error"><strong>Error: </strong>This account has been locked!</div>
[% IF Categories.can_any_reset_password && Koha.Preference('OpacBaseURL') %]
<a href="[% Koha.Preference('OpacBaseURL') | url %]/cgi-bin/koha/opac-password-recovery.pl">You must reset your password</a>.
[% END %]
<div id="login_error">
<strong>Error: </strong>
This account has been locked!
[% IF Categories.can_any_reset_password && Koha.Preference('OpacBaseURL') %]
<a href="[% Koha.Preference('OpacBaseURL') | url %]/cgi-bin/koha/opac-password-recovery.pl">Reset your password</a>.
[% END %]
</div>
[% ELSIF password_has_expired %]
<div id="login_error"><strong>Error: </strong>Your password has expired!</div>
[% IF Koha.Preference('EnableExpiredPasswordReset') && Koha.Preference('OpacBaseURL') %]
<a href="[% Koha.Preference('OpacBaseURL') | url %]/cgi-bin/koha/opac-reset-password.pl">You must reset your password</a>.
[% ELSIF Categories.can_any_reset_password && Koha.Preference('OpacBaseURL') %]
<a href="[% Koha.Preference('OpacBaseURL') | url %]/cgi-bin/koha/opac-password-recovery.pl">You must reset your password</a>.
[% ELSE %]
<p>You must contact the library to reset your password</p>
[% END %]
<div id="login_error">
<strong>Error: </strong>
Your password has expired!
[% IF Koha.Preference('EnableExpiredPasswordReset') && Koha.Preference('OpacBaseURL') %]
<a href="[% Koha.Preference('OpacBaseURL') | url %]/cgi-bin/koha/opac-reset-password.pl">Reset your password</a>.
[% ELSIF Categories.can_any_reset_password && Koha.Preference('OpacBaseURL') %]
<a href="[% Koha.Preference('OpacBaseURL') | url %]/cgi-bin/koha/opac-password-recovery.pl">Reset your password</a>.
[% ELSE %]
<p>You must contact the library to reset your password</p>
[% END %]
</div>
[% ELSIF invalid_username_or_password %]
<div id="login_error"><strong>Error: </strong>Invalid username or password</div>
[% ELSIF is_anonymous_patron %]