Description
Martin Renvoize (ashimema)
2022-04-25 15:22:21 UTC
Should this be part of the 'WELCOME' notice, or should it be it's own notice entirely which can be triggered independently from the various places the welcome notice can be triggered? Perhaps it could be an optional part of the welcome notice that is picked at the trigger time? I think maybe it would make sense to have an option to trigger the password reset email manually instead. The validity of the password reset URLs is limited, so it might be better to point people to the feature itself, maybe by including a direct link to the password request form. Created attachment 134357 [details] [review] Bug 30611: Add STAFF_PASSWORD_RESET notice This patch adds a new STAFF_PASSWORD_RESET notice template for password recoveries initiated via the staff client as aposed for those initiated by the end user. Created attachment 134358 [details] [review] Bug 30611: Add ability for staff to send password reset emails This patch adds the ability for staff with the edit_borrowers permission to send password reset emails to users. The staff initiated password reset has it's own notice, STAFF_PASSWORD_RESET, and the reset link produced has an extended timeout of 5 days, as apposed to the usual 2 day limit. Test plan 1) Apply patch and run the database update 2) Login to the staff client with a user who has the 'edit_borrowers' permission. 3) Note that a new, 'Send password reset' option appears under the 'More' menu on the patron details page. 4) Clicking the button will queue the STAFF_PASSWORD_RESET notice and redirect the user to the Notices tab. I think this should perhaps target 22.05 as it adds back in an alternative to the functionality lost with bug 27812. Created attachment 134378 [details] [review] Bug 30611: Add STAFF_PASSWORD_RESET notice This patch adds a new STAFF_PASSWORD_RESET notice template for password recoveries initiated via the staff client as aposed for those initiated by the end user. Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Created attachment 134379 [details] [review] Bug 30611: Add ability for staff to send password reset emails This patch adds the ability for staff with the edit_borrowers permission to send password reset emails to users. The staff initiated password reset has it's own notice, STAFF_PASSWORD_RESET, and the reset link produced has an extended timeout of 5 days, as apposed to the usual 2 day limit. Test plan 1) Apply patch and run the database update 2) Login to the staff client with a user who has the 'edit_borrowers' permission. 3) Note that a new, 'Send password reset' option appears under the 'More' menu on the patron details page. 4) Clicking the button will queue the STAFF_PASSWORD_RESET notice and redirect the user to the Notices tab. Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Works brilliantly, thanks Martin. This is a great feature - saves me from having to load the OPAC repeatedly throughout the day. QAing + my $days = $staff ? 5 : 2; No blocker. But these should at least be constants, but probably pref or config controlled. I think we should check at least pref OpacResetPassword to make the link we are sending to be working. Good call.. I had completely overlooked that. Created attachment 134719 [details] [review] Bug 30611: (QA follow-up) Only show reset option for allowed categories This patch adds a check that the patron can reach the password reset page using category.effective_reset_password which handles fallback to OpacResetPassword system preference transparently. Test plan 1) Set at least one patron category to dissallow patron password resets 2) Search for a patron of that category 3) Confirm the 'Send password reset' option no longer appears Created attachment 134720 [details] [review] Bug 30611: (follow-up) Use constants Update ternary for token timeout to use perl constants Another victim of Attempt to reload Koha/Template/Plugin/Branches.pm aborted. Ignoring it :) Always linked to includes btw Created attachment 134774 [details] [review] Bug 30611: Add STAFF_PASSWORD_RESET notice This patch adds a new STAFF_PASSWORD_RESET notice template for password recoveries initiated via the staff client as aposed for those initiated by the end user. Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Chmod 755 on atomic update file. Created attachment 134775 [details] [review] Bug 30611: Add ability for staff to send password reset emails This patch adds the ability for staff with the edit_borrowers permission to send password reset emails to users. The staff initiated password reset has it's own notice, STAFF_PASSWORD_RESET, and the reset link produced has an extended timeout of 5 days, as apposed to the usual 2 day limit. Test plan 1) Apply patch and run the database update 2) Login to the staff client with a user who has the 'edit_borrowers' permission. 3) Note that a new, 'Send password reset' option appears under the 'More' menu on the patron details page. 4) Clicking the button will queue the STAFF_PASSWORD_RESET notice and redirect the user to the Notices tab. Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 134776 [details] [review] Bug 30611: (QA follow-up) Only show reset option for allowed categories This patch adds a check that the patron can reach the password reset page using category.effective_reset_password which handles fallback to OpacResetPassword system preference transparently. Test plan 1) Set at least one patron category to dissallow patron password resets 2) Search for a patron of that category 3) Confirm the 'Send password reset' option no longer appears Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 134777 [details] [review] Bug 30611: (follow-up) Use constants Update ternary for token timeout to use perl constants Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Pushed to master for 22.05, thanks to everybody involved [U+1F984] Arf this breaks unit test : kohadev-koha@kohadevbox:/kohadevbox/koha$ prove xt/sample_notices.t xt/sample_notices.t .. 1/? # Failed test 'No sample notice to add' # at xt/sample_notices.t line 84. # Sample notices to add in fr-FR/1-Obligatoire/sample_notices.sql: STAFF_PASSWORD_RESET # Looks like you failed 1 test of 6. Note there is Bug 27619 On it.. :) Ah yes, I think I kind of assumed bug 27619 would be in before this one.. I was happy to wait. It's easy to fix this by adding the sample notice to the fr SQL.. but maybe it's more pertinent for me to QA 27619 to get that in? (In reply to Martin Renvoize from comment #24) > Ah yes, I think I kind of assumed bug 27619 would be in before this one.. I > was happy to wait. > > It's easy to fix this by adding the sample notice to the fr SQL.. but maybe > it's more pertinent for me to QA 27619 to get that in? I prefer a quick fix on sample notices to the fr in order to calm jenkins In the end, bug 27619 was pushed. All good here. |