Koha-clms/C4
Sam Lau aa0e914e81
Bug 33462: Add ability to force password change for new patrons entered by staff
This patch attempts to force a password change for new staff created patrons.
This is done by setting the password_expiration_date to an expired date when
adding a new patron. This patch adds a new system preference
'ForcePasswordResetWhenSetByStaff' and a new column to the categories table
'force_password_reset_when_set_by_staff.

To test:
1) Apply patch, restart_all, updatedatabase, and also be sure to update schema.
2) Visit Administration->Sytem Preferences and search for 'EnableExpiredPasswordReset'.
   Make sure this is set to enable. Now search for  'ForcePasswordResetWhenSetByStaff'.
   This should be defaulted to 'Don't force'.
3) Keep that tab open and visit Administration->Patron categories. Click on edit
   on the Board category. Noitce that there is a now a 'Force new patron password reset'
   section. Notice that the by default, this is set to follow the
   ForcePasswordResetWhenSetByStaff system preference (currently set to don't force).
   Click on the dropdown and change it to 'Force'. Save changes
4) Click on the Patrons tab to visit members-home.pl and then click 'New Patron'.
   Select on Patron. Fill in the required information and also enter a password.
5) Submit this form and notice that the patron's password expiration date is set
   to never. This should be the case because the default for 'Force new patron
   password reset' follows the sys. pref. which is still set to 'Don't force' (You
   could have some expiry date in this step, but it should at least be set to a
   date that is not expired. this depends on whether or not you have a defalut
   password expiration date set in patron categories )
6) Log into the OPAC with this patron and notice it works as expected and log in
   was successful.
7) Go back to the patron home page and click to add a new patron. This time select
   'Board'. Once again fill out the required info, enter a password, and then save
   the form.
8) Notice that for this patron, the password expiration date is set for today's
   date. This is because we changed the setting for the 'Board' patron category to
   force.
9) Log into the OPAC with this patron. You should be redirected to a page with an
   error that says: "It's your first login! You need to reset your password." Click
   on the reset password link below this message.
10) You should be sent to a page where you can reset your password. Fill in the
    form and click 'Update password'. Attempt to sign into the OPAC with this new
    password. Everything works as expected.
11) Go back to the staff interface and view this patron's detail page. Notice the
    password expiration date is now set to what the default is in the patron
    category.
12) Edit this patrons information and set their password expiration date to
    yesterday. Go back to the OPAC and try to sign in with this patron again. Note
    that this time, you are also redirected but the message says "Error: Your
    password has expired!"
13) Go back to the staff interface and visit the sys. pref tab we left open. Set
    it to the 'Force' option and save changes.
14) Visit the patron home page and click add patron, now select the patron
    category again. Fill in required info and enter password. Submit form and note
    that the patron's password expiration date is set to today. Try to login to
    the OPAC with this patron, you should be redirected to the page with the error
    that says "Error: It's your first login! You need to reset your password."
15) Sign-off :)

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Olivier V <olivier.vezina@inLibro.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-10-31 13:23:39 +01:00
..
AuthoritiesMarc
…
Barcodes Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
ClassSortRoutine
…
ClassSplitRoutine
…
Creators Bug 37720: Prevent XSS in label creator 2024-10-18 12:07:51 +02:00
External
…
Form Bug 30318: Don't reset messaging preferences when form is empty 2024-04-26 08:52:51 +02:00
Heading Bug 36917: (follow-up) Remove Elasticsearch warnings and tidy 2024-05-24 15:36:42 +02:00
ILSDI Bug 38233: respect OPAC visibility for ILS-DI GetRecords 2024-10-29 16:14:35 +01:00
Installer Bug 30731: Remove Readonly::XS::MAGIC_COOKIE 2022-06-01 16:15:26 -03:00
Labels Bug 10762: (QA follow-up) Perltidy 2023-10-25 10:35:31 -03:00
Linker Bug 35125: Respect LinkerConsiderThesaurus in update_cache 2024-07-01 18:55:42 +02:00
Members Bug 29194: Create logical ordering of patron messaging preferences 2024-10-11 11:13:56 +02:00
OAI Bug 30308: Fix bulkmarcimport.pl broken by OAI-PMH:AutoUpdateSets(EmbedItemData) 2022-07-29 15:43:39 -03:00
Output
…
Patroncards Bug 34532: Silence warns in Patroncard.pm 2023-09-15 11:57:08 -03:00
Reports Bug 37508: (QA follow-up) Use ->check_columns 2024-08-16 16:22:26 +02:00
SIP Bug 37582: Tidy write_msg 2024-10-29 08:46:49 +01:00
Search Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
Serials
…
Utils/DataTables Bug 33484: Remove state settings from column level 2024-10-29 16:14:31 +01:00
Accounts.pm Bug 29184: Fix warn about undefined replacecost 2022-09-08 10:50:30 -07:00
Acquisition.pm Bug 36002: Remove unused subroutine GetParcels 2024-04-30 17:09:43 +02:00
Auth.pm Bug 33462: Add ability to force password change for new patrons entered by staff 2024-10-31 13:23:39 +01:00
Auth_cas_servers.yaml.sample
…
Auth_with_cas.pm Bug 34893: (QA follow-up) Tidy code for qa script 2024-02-02 17:31:47 +01:00
Auth_with_ldap.pm Bug 36575: (bug 34893 follow-up) Return patron from LDAP 2024-06-20 17:55:32 +02:00
Auth_with_shibboleth.pm Bug 36575: (QA follow-up) Shibboleth POD and checkpw_internal call 2024-06-20 17:55:34 +02:00
AuthoritiesMarc.pm Bug 35989: (QA follow-up): Fix QA tests 2024-06-06 15:18:43 +01:00
Barcodes.pm Bug 37070: (QA follow-up) Fix qa script issues 2024-10-18 14:26:05 +02:00
Biblio.pm Bug 30648: Tidy 2024-10-29 08:46:45 +01:00
Breeding.pm Bug 28166: (QA follow-up) Fix and tidy tests and code 2023-10-23 11:33:50 -03:00
Budgets.pm Bug 31631: Optionally use tax-exclusive values for calculating fund values 2023-10-18 15:41:35 -03:00
Calendar.pm Bug 32048: Added clear cache routine to delete_holiday_range_repeatable 2023-09-18 15:31:50 -03:00
Charset.pm
…
Circulation.pm Bug 28575: (QA follow-up) Tidy and test count 2024-10-24 10:45:36 +02:00
ClassSortRoutine.pm Bug 29951: Fix EXPORT for C4::ClassS*Routine modules 2022-07-08 15:29:56 -03:00
ClassSource.pm Bug 23387: Add caching to C4::ClassSource 2024-08-26 17:39:31 +02:00
ClassSplitRoutine.pm Bug 29951: Fix EXPORT for C4::ClassS*Routine modules 2022-07-08 15:29:56 -03:00
Context.pm Bug 36367: Set to undef when unsetting 2024-06-14 11:17:18 +01:00
Contract.pm
…
CourseReserves.pm Bug 30016: Remove GetOpenIssue subroutine 2022-08-31 08:50:37 -03:00
Creators.pm
…
HTML5Media.pm
…
Heading.pm Bug 30047: (follow-up) Fix failing tests 2024-05-13 16:24:18 +02:00
HoldsQueue.pm Bug 28833: Speed up holds queue builder via parallel processing 2024-10-25 11:09:53 +02:00
ImportBatch.pm Bug 35438: Remove skip_intermediate_commit parameter 2024-01-16 12:06:08 +01:00
ImportExportFramework.pm Bug 37606: Fix framework export module to escape double quotes 2024-10-18 14:26:04 +02:00
InstallAuth.pm Bug 36367: Remove _new_userenv 2024-06-14 11:17:17 +01:00
Installer.pm Bug 27490: More instances of changing language syspref to StaffInterfaceLanguages 2024-09-13 13:54:25 +02:00
ItemCirculationAlertPreference.pm
…
Items.pm Bug 35100: Revert change to request_transfer 2024-09-19 12:41:53 +01:00
Koha.pm Bug 36750: Use the same label for Zebra 2024-05-07 17:41:19 +02:00
Labels.pm
…
Languages.pm Bug 27490: More instances of changing language syspref to StaffInterfaceLanguages 2024-09-13 13:54:25 +02:00
Letters.pm Bug 37869: Tidy code 2024-10-29 08:46:36 +01:00
Linker.pm
…
Log.pm Bug 37944: Log object delete as JSON diff, implement for items 2024-10-30 11:57:25 +01:00
MarcModificationTemplates.pm
…
Matcher.pm Bug 26611: Make authority record matching use required match checks 2023-05-24 11:21:31 -03:00
Members.pm Bug 37845: Remove C4::Members::DeleteExpiredOpacRegistrations 2024-10-21 15:10:31 +02:00
Message.pm Bug 18398: (follow-up) Update POD & Unit tests 2023-03-31 13:13:35 +02:00
Output.pm Bug 34478: Remove check_csrf from pl files 2024-03-01 10:56:01 +01:00
Overdues.pm Bug 38303: Set item's replacement price to defaultreplacecost if 0.00 2024-10-31 11:03:26 +01:00
Patroncards.pm
…
Record.pm Bug 33431: Make C4::Record use C4::Context->yaml_preference 2024-03-18 11:03:38 +01:00
Reports.pm
…
Reserves.pm Bug 37868: Remove C4::Reserves::ToggleSuspend 2024-10-21 15:10:35 +02:00
Ris.pm Bug 33431: Fix remaining cases 2024-03-18 11:03:39 +01:00
RotatingCollections.pm Bug 35100: (follow-up) Tidy 2024-09-19 12:41:58 +01:00
SMS.pm Bug 36051: (QA follow-up): Use yaml_preference 2024-04-12 11:26:12 +02:00
Scheduler.pm
…
Scrubber.pm Bug 36328: (QA follow-up) Expand tests and reorder elements to clarify differences 2024-04-22 12:39:20 +02:00
Search.pm Bug 37004: Add branchcode as HTML class to each grouped result in search results 2024-09-02 12:13:42 +02:00
Serials.pm Bug 37480: Make addroutingmember use Koha::Subscription::Routinglists 2024-09-16 10:41:06 +02:00
Service.pm
…
ShelfBrowser.pm Bug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record 2022-07-22 15:24:11 -03:00
SocialData.pm Bug 33833: Add two FIXMEs to SocialData::get_report 2023-09-05 14:35:35 -03:00
Stats.pm Bug 33608: (QA follow-up) Remove ->insert method 2023-10-25 11:07:59 -03:00
Suggestions.pm Bug 35597: Move modification logging to Koha::Suggestion 2024-06-13 14:08:33 +01:00
TTParser.pm Bug 36171: Fix template toolkit tags split by HTML parser 2024-10-24 13:38:12 +02:00
Tags.pm Bug 36785: Typo unreconized and bilbio in tags code 2024-05-17 10:36:35 +02:00
Templates.pm Bug 35070: Tidy 2024-01-04 16:51:45 +01:00
TmplToken.pm
…
TmplTokenType.pm
…
UsageStats.pm Bug 34185: Capitalized OPAC in OpacItemLocation syspref 2024-09-02 12:13:43 +02:00
XISBN.pm Bug 30813: (QA follow-up) Adjust three use statements 2022-06-08 11:40:32 -03:00
XSLT.pm Bug 33217: Tidy 2023-11-08 17:52:42 -03:00