Bug 25947 - Improve locked account message
Summary: Improve locked account message
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on: 23979
Blocks:
  Show dependency treegraph
 
Reported: 2020-07-07 19:46 UTC by Caroline Cyr La Rose
Modified: 2023-01-31 14:32 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Warning messages in the patron details (28.92 KB, image/png)
2020-07-07 19:46 UTC, Caroline Cyr La Rose
Details
Bug 25947: Improve locked account message (5.10 KB, patch)
2023-01-20 06:53 UTC, Fridolin Somers
Details | Diff | Splinter Review
Screenshot of feature (53.55 KB, image/png)
2023-01-20 07:09 UTC, Fridolin Somers
Details
Bug 25947: Improve locked account message (5.15 KB, patch)
2023-01-23 16:14 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 25947: Improve locked account message (5.20 KB, patch)
2023-01-31 14:32 UTC, solene.ngamga
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2020-07-07 19:46:40 UTC
Created attachment 106643 [details]
Warning messages in the patron details

When using FailedLoginAttempts, a patron's account is blocked after X many failed login attempts on the OPAC. When that happens, a message 'Account has been locked.' appears on the patron account details page.

This message does not indicate why or how it was blocked.

I suggest we change it to 'Account has been locked due to too many failed login attempts'.

Furthermore, the font is dark red whereas the font for other warnings (such as wrong category or unpaid fines) is bright red and bold.

To test:
1. Change 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 several times
4. Go back to the patron's account in the staff interface
5. Note that there is no indication as to why the patron's account is locked and that the font color and weight does not match the other warnings.

Also, there is no button to change the password next to the warning. When a patron has unpaid fines or is in the wrong category, there is a button to either pay/writeoff the fines or change the category next to the warning. I would add a button that says 'Change password' next to the locked account warning. This might be outside the scope of this bug, but I think it would improve usability.
Comment 1 Caroline Cyr La Rose 2020-07-07 19:51:30 UTC
Again, this might be outside the scope, but I also think the OPAC message could be improved.

Right now, it says

'You entered an incorrect username or password. Please try again! But note that passwords are case sensitive and that your account will be locked out after a fixed number of failed login attempts. Please contact a library staff member if you continue to have problems.'

I would add the number of failed attempts rather than 'after a fixed number of failed login attempts'

And I would also change the message once the account is blocked. Right now, even if FailedLoginAttempts is at 2, you can try to log in 10 times and it will never tell you that your account is now blocked.
Comment 2 David Cook 2020-07-08 03:14:23 UTC
I don't 100% understand these comments. 

I think that I agree that the Staff Client could be more descriptive about why the account is locked.

As for the OPAC, we shouldn't indicate that the account has been locked, as that indicates to an attacker that the account exists, which is not a good idea from a security perspective.
Comment 3 Fridolin Somers 2023-01-20 01:28:48 UTC
We have the same demand.
I'm on it
Comment 4 Fridolin Somers 2023-01-20 06:53:15 UTC
Created attachment 145502 [details] [review]
Bug 25947: Improve locked account message

When using system preference 'FailedLoginAttempts', a patron's account is blocked after X many failed login attempts on the OPAC.

This patch adds, like for "Patron's card has expired" message :
  * a message "Patron's account has been locked (due to X failed login attempts)" on the patron details and circulation pages
  * a link to change password
  * a link to reset login attempts to 0
Links are only displayed if libarian has permission to edit patrons.

For administrative lock, only a message is displayed :
"Patron's account has been administratively locked"

Reset login attempts to 0 feature uses members/setstatus.pl with
resetloginattempts=y like reregistration=y for an expired patron

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)"
6. Click on "Change password", you go to change password page
7. Click on "Reset login attempts", page reloads and you see patron in unlocked
Comment 5 Fridolin Somers 2023-01-20 07:09:36 UTC
Created attachment 145503 [details]
Screenshot of feature
Comment 6 Fridolin Somers 2023-01-20 07:12:50 UTC
You may ask to improve the text.

We may add some text explaining the value of syspref FailedLoginAttempts, but maybe message would be too long.

Reset login attempts as been asked by the library, this is a new feature.
I hope it makes sens, otherwise I may create a new bug report.
Comment 7 ByWater Sandboxes 2023-01-23 16:14:47 UTC
Created attachment 145589 [details] [review]
Bug 25947: Improve locked account message

When using system preference 'FailedLoginAttempts', a patron's account is blocked after X many failed login attempts on the OPAC.

This patch adds, like for "Patron's card has expired" message :
  * a message "Patron's account has been locked (due to X failed login attempts)" on the patron details and circulation pages
  * a link to change password
  * a link to reset login attempts to 0
Links are only displayed if libarian has permission to edit patrons.

For administrative lock, only a message is displayed :
"Patron's account has been administratively locked"

Reset login attempts to 0 feature uses members/setstatus.pl with
resetloginattempts=y like reregistration=y for an expired patron

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)"
6. Click on "Change password", you go to change password page
7. Click on "Reset login attempts", page reloads and you see patron in unlocked

Signed-off-by: Amaury GAU <amaury.gau@bulac.fr>
Comment 8 solene.ngamga 2023-01-31 14:32:59 UTC
Created attachment 145878 [details] [review]
Bug 25947: Improve locked account message

When using system preference 'FailedLoginAttempts', a patron's account is blocked after X many failed login attempts on the OPAC.

This patch adds, like for "Patron's card has expired" message :
  * a message "Patron's account has been locked (due to X failed login attempts)" on the patron details and circulation pages
  * a link to change password
  * a link to reset login attempts to 0
Links are only displayed if libarian has permission to edit patrons.

For administrative lock, only a message is displayed :
"Patron's account has been administratively locked"

Reset login attempts to 0 feature uses members/setstatus.pl with
resetloginattempts=y like reregistration=y for an expired patron

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)"
6. Click on "Change password", you go to change password page
7. Click on "Reset login attempts", page reloads and you see patron in unlocked

Signed-off-by: Amaury GAU <amaury.gau@bulac.fr>
Signed-off-by: Solene Ngamga <solene.ngamga@inLibro.com>