Bug 33820 - Add hints to warn the librarian that they will be logged out if they change their username
Summary: Add hints to warn the librarian that they will be logged out if they change t...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 33815
Blocks:
  Show dependency treegraph
 
Reported: 2023-05-24 15:05 UTC by Owen Leonard
Modified: 2023-12-21 15:04 UTC (History)
12 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/801
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.02


Attachments
Bug 33820: Add hints to warn the librarian that they will be logged out if they change their username (2.14 KB, patch)
2023-05-24 15:25 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 33820: (follow-up) Add hint to member-password.tt (1.62 KB, patch)
2023-05-24 15:25 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 33820: Add hints to warn the librarian that they will be logged out if they change their username (2.18 KB, patch)
2023-05-25 14:06 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 33820: (follow-up) Add hint to member-password.tt (1.67 KB, patch)
2023-05-25 14:06 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 33820: Add hints to warn the librarian that they will be logged out if they change their username (2.23 KB, patch)
2023-05-26 00:11 UTC, David Cook
Details | Diff | Splinter Review
Bug 33820: (follow-up) Add hint to member-password.tt (1.72 KB, patch)
2023-05-26 00:11 UTC, David Cook
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2023-05-24 15:05:19 UTC
Moving this aspect of Bug 33815 to its own bug:

We should warn librarians that if they change their own username in the staff interface that they will be logged out.
Comment 1 Owen Leonard 2023-05-24 15:25:22 UTC
Created attachment 151639 [details] [review]
Bug 33820: Add hints to warn the librarian that they will be logged out if they change their username

This patch adds some JavaScript to the patron entry form which adds a
hint if the logged-in librarian tries to change their own username. It
warns them that they will be logged out.

To test, apply the patch and log into the staff interface.

- Locate and edit your own patron record.
- In the "OPAC/Staff interface login" section, change the value in the
  username field. When focus leaves that form field a hint should
  appear, "You will be logged out if you modify your username."
- Change the username field back to your original username. The hint
  should disappear.
- Confirm that submitting a username change works correctly: You should
  be logged out, and when you log in again your username should be
  updated.
Comment 2 Owen Leonard 2023-05-24 15:25:25 UTC
Created attachment 151640 [details] [review]
Bug 33820: (follow-up) Add hint to member-password.tt

This follow-up makes the same change to the "Change password" template.
Comment 3 Sam Lau 2023-05-24 19:15:03 UTC
First attachment works as expected. The problem occurs when clicking on the "Change Password" template. When editing the username, the hint occurs properly, however, if you press save changes while leaving the new password fields blank, the username doesn't change and it does not log you out. In order for the username change to take effect, you have to enter a new password which basically goes against the text that is listed at the bottom of this page:

"Koha cannot display existing passwords. Leave the field blank to leave password unchanged."
Comment 4 Owen Leonard 2023-05-25 11:55:16 UTC
(In reply to Sam Lau from comment #3)
> In
> order for the username change to take effect, you have to enter a new
> password which basically goes against the text that is listed at the bottom
> of this page:
> 
> "Koha cannot display existing passwords. Leave the field blank to leave
> password unchanged."

This issue is unrelated to the patch, so I've created Bug 33832.
Comment 5 Sam Lau 2023-05-25 14:06:46 UTC
Created attachment 151685 [details] [review]
Bug 33820: Add hints to warn the librarian that they will be logged out if they change their username

This patch adds some JavaScript to the patron entry form which adds a
hint if the logged-in librarian tries to change their own username. It
warns them that they will be logged out.

To test, apply the patch and log into the staff interface.

- Locate and edit your own patron record.
- In the "OPAC/Staff interface login" section, change the value in the
  username field. When focus leaves that form field a hint should
  appear, "You will be logged out if you modify your username."
- Change the username field back to your original username. The hint
  should disappear.
- Confirm that submitting a username change works correctly: You should
  be logged out, and when you log in again your username should be
  updated.

Signed-off-by: Sam Lau <samalau@gmail.com>
Comment 6 Sam Lau 2023-05-25 14:06:48 UTC
Created attachment 151686 [details] [review]
Bug 33820: (follow-up) Add hint to member-password.tt

This follow-up makes the same change to the "Change password" template.

Signed-off-by: Sam Lau <samalau@gmail.com>
Comment 7 David Cook 2023-05-26 00:10:18 UTC
Technically this works but the hints are very easy to miss/ignore. Even when I was looking for it, I didn't even notice it the first time or two.

I think adding color, bolding, or maybe even a prefix like "Warning!" might help this to stand out.

But perhaps that could be a follow up. Not enough of an issue to block this I think.
Comment 8 David Cook 2023-05-26 00:11:03 UTC
Created attachment 151717 [details] [review]
Bug 33820: Add hints to warn the librarian that they will be logged out if they change their username

This patch adds some JavaScript to the patron entry form which adds a
hint if the logged-in librarian tries to change their own username. It
warns them that they will be logged out.

To test, apply the patch and log into the staff interface.

- Locate and edit your own patron record.
- In the "OPAC/Staff interface login" section, change the value in the
  username field. When focus leaves that form field a hint should
  appear, "You will be logged out if you modify your username."
- Change the username field back to your original username. The hint
  should disappear.
- Confirm that submitting a username change works correctly: You should
  be logged out, and when you log in again your username should be
  updated.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 9 David Cook 2023-05-26 00:11:06 UTC
Created attachment 151718 [details] [review]
Bug 33820: (follow-up) Add hint to member-password.tt

This follow-up makes the same change to the "Change password" template.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 10 Tomás Cohen Arazi 2023-06-21 16:18:39 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 11 Martin Renvoize 2023-07-17 12:22:01 UTC
Thanks for all the hard work!

Pushed to 23.05.x for the next release
Comment 12 Pedro Amorim 2023-07-18 10:55:22 UTC
Enhancement, not backporting to 22.11.x