Koha-clms/Koha/REST/V1
CJ Lynce ba43483f4d
Bug 36536: Make REST APIs validateUserAndPassword update borrowers.lastseen
This patch added the option to update borrowers.lastseen when a patron username
    and password is verified via the REST API. This can be enabled or disabled
    selectively using the TrackLastPatronActivityTriggers system preference
    using the [ ] Patron authentication via API option..

To test:
1.  Create a new user, ensuring to set the Username and password fields.
	    *Import to do this first*
2.  Edit the TrackLastPatronActivityTriggers syspref and check all options.
3.  Ensure the RESTBasicAuth syspref is set to Enable.
4.  Check the lastseen date of your new user using a SQL report
        SELECT borrowernumber, userid, lastseen FROM borrowers WHERE userid = 'USERNAME'
        (Replace USERNAME with your chosen username for the new patron)
        NOTE: **Ensure the cache expiry of the SQL report is set to 0**
5.  The lastseen for your new user should be null
6.  'restart_all' Koha services to clear plack cache.
7.  Run the attached api_verify_lastseen.pl test script
        **Change P_USERNAME and P_PASSWORD to the username and password of your new user.
        (script contains expected output for successful verification)
8.  Re-check the lastseen date of your new user again via SQL (step 4)
        The lastseen should still be null.

9.  Apply Patch
10. 'restart_all' Koha services

11. Edit the TrackLastPatronActivityTriggers syspref and check the '[ ] Patron authentication via API' option
12. Rerun the api_verify_lastseen.pl
13. Re-check the lastseen date of your new user again via SQL (step 4)
        The lastseen should now be updated to the time of the last script run.

For good measure:
14. Edit the TrackLastPatronActivityTriggers syspref and **UNcheck** the '[ ] Patron authentication via API' option
15. 'restart_all' Koha services to clear plack cache.
16. Rerun the api_verify_lastseen.pl
17. Re-check the lastseen date of your new user again via SQL (step 4)
        The lastseen should have remained the same as previous.

Sponsored-by: Westlake Porter Public Library <https://westlakelibrary.org>
Signed-off-by: Bernard Scaife <bernard.scaife@openfifth.co.uk>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-29 11:08:44 -06:00
..
Acquisitions Bug 38010: Fix vendor deletion tests 2025-05-02 17:19:31 +02:00
Auth Bug 36536: Make REST APIs validateUserAndPassword update borrowers.lastseen 2025-08-29 11:08:44 -06:00
Biblios Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
CashRegisters Bug 39091: Add cash registers list REST API endpoint 2025-07-23 16:36:40 -06:00
Clubs Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Config/SMTP Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ERM Bug 39319: Fixes for Pod::Checker 2025-04-14 08:51:21 +02:00
ILL Bug 39600: Rewrite API controllers 2025-04-25 19:23:41 +02:00
OAuth Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Patrons Bug 28907: REST - Remove allow-owner from public patron hold cancellation 2025-03-06 13:54:32 +01:00
Preservation Bug 37686: Fix render_resource_not_found() and render_resource_deleted() misses 2024-08-29 18:16:19 +02:00
StockRotation Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
AdditionalContents.pm Bug 39900: REST API specs and class changes 2025-08-14 16:05:54 -06:00
AdvancedEditorMacro.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ArticleRequests.pm Bug 28907: REST - Remove allow-owner from public article requests cancel route 2025-03-06 13:54:33 +01:00
Auth.pm Bug 40423: Add helper to stash x-koha-request-id header value 2025-07-23 16:36:37 -06:00
AuthorisedValueCategories.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
AuthorisedValues.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Authorities.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
BackgroundJobs.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Biblios.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Bookings.pm Bug 38175: (QA follow-up) DRY out PATCH handling 2024-10-24 18:27:24 +02:00
Checkouts.pm Bug 28907: REST - Remove allow-owner from public checkout availability route 2025-03-06 13:54:33 +01:00
CirculationRules.pm Bug 40419: Fix wrong license 2025-07-18 11:09:54 -06:00
Cities.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
DeletedBiblios.pm Bug 37791: Fix 'Biblio not found' messages on the API 2024-10-11 12:21:29 +02:00
ERM.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ExtendedAttributeTypes.pm Bug 37577: Add additional fields for ERM packages 2024-11-08 16:09:19 +01:00
Holds.pm Bug 40395: Preparation: suspension_bulk REST API endpoint 2025-08-20 13:43:09 -06:00
ImportBatchProfiles.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ImportRecordMatches.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ItemTypes.pm
…
Items.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Libraries.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Lists.pm Bug 28965: (QA follow-up) Fix misc qa issues 2024-11-08 16:09:22 +01:00
OAuth.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Patrons.pm Bug 28907: REST - Remove allow-owner from public guarantors can see charges and checkouts 2025-03-06 13:54:31 +01:00
Preservation.pm
…
Quotes.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
RecordSources.pm Bug 37513: Handle Koha::Exceptions::Object::FKConstraintDeletio in controller 2024-08-27 12:14:24 +02:00
ReturnClaims.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
SearchFilter.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Static.pm Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
Suggestions.pm Bug 40419: Fix wrong license 2025-07-18 11:09:54 -06:00
Tickets.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
TransferLimits.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
TwoFactorAuth.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00