Bug 25947: (follow-up) Improve locked account message

Test plan:

To test:
1. Change system preference 'FailedLoginAttempts' to a small number,
   like 2
2. Go to a patron's account and copy their username (while you're there,
   change the password and add some fines, too)
3. In the OPAC, try to log in with the username and a wrong password 3
   times
4. Go back to the patron's account in the staff interface
5. Note that there is a message : "Patron's account has been locked (due
   to 3 failed login attempts)". Note there is a tooltip at the right
6. Click on "Change password", you go to change password page

Note: the follow-up might be unclear to understand:
1 - it moves the button outside the IF patron.login_attempt < 0
2 - Hence it requires the </li> to be moved out so button remains on the
    lane
3 - Finally the <li> must be put before the if and changed a bit

Signed-off-by: Imani Thomas <imani.thomas@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 20a87564f1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Baptiste Wojtkowski 2024-11-08 14:17:00 +01:00 committed by Fridolin Somers
parent a3284990f8
commit 2f6eb09ecc
No known key found for this signature in database
GPG Key ID: 9A8E73E2A8B96537
1 changed files with 3 additions and 4 deletions

View File

@ -53,21 +53,20 @@
[% END %]
[% IF patron.account_locked %]
<li class="blocker [% patron.login_attempts < 0 ? 'account_admin_locked' : 'account_locked' | html %]">
[% IF patron.login_attempts < 0 %]
<li class="blocker account_admin_locked">
<span class="circ-hlt">Locked: </span><span> Patron's account has been administratively locked</span>
</li>
[% ELSE %]
<li class="blocker account_locked">
<span class="circ-hlt">Locked: </span><span> Patron's account has been locked (due to [% patron.login_attempts | html %] failed login attempts)</span>
[% END %]
[% IF CAN_user_borrowers_edit_borrowers %]
<span>
<a href="/cgi-bin/koha/members/member-password.pl?member=[% patron.borrowernumber | uri %]">Change password</a>
<span data-bs-toggle="tooltip" title="Resetting password will remove lock on account" data-bs-placement="right" class="fa fa-info-circle"> </span>
</span>
[% END %]
</li>
[% END %]
[% END %]