Bugzilla – Attachment 185582 Details for
Bug 36536
Make REST API's validateUserAndPassword update borrowers.lastseen
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36536: Make REST APIs validateUserAndPassword update borrowers.lastseen
Bug-36536-Make-REST-APIs-validateUserAndPassword-u.patch (text/plain), 3.49 KB, created by
CJ Lynce
on 2025-08-19 20:58:35 UTC
(
hide
)
Description:
Bug 36536: Make REST APIs validateUserAndPassword update borrowers.lastseen
Filename:
MIME Type:
Creator:
CJ Lynce
Created:
2025-08-19 20:58:35 UTC
Size:
3.49 KB
patch
obsolete
>From dfbbd5dfe2ee806d2e447dc7bcb5c3f1ef928193 Mon Sep 17 00:00:00 2001 >From: CJ Lynce <cj.lynce@westlakelibrary.org> >Date: Mon, 18 Aug 2025 19:02:41 +0000 >Subject: [PATCH] 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> >--- > Koha/REST/V1/Auth/Password.pm | 3 +++ > .../prog/en/modules/admin/preferences/patrons.pref | 1 + > 2 files changed, 4 insertions(+) > >diff --git a/Koha/REST/V1/Auth/Password.pm b/Koha/REST/V1/Auth/Password.pm >index d1af05f962..20a5e550c1 100644 >--- a/Koha/REST/V1/Auth/Password.pm >+++ b/Koha/REST/V1/Auth/Password.pm >@@ -80,6 +80,9 @@ sub validate { > ); > } > >+ #record patron activity >+ $patron->update_lastseen('api_verify'); >+ > return $c->render( > status => 201, > openapi => { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >index 5a84a24557..2cf9001222 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >@@ -110,6 +110,7 @@ Patrons: > check_in: "Checking in an item" > hold: "Placing a hold on an item" > article: "Placing an article request" >+ api_verify: "Patron authentication via API" > - > - pref: AutoApprovePatronProfileSettings > choices: >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36536
:
185532
|
185534
| 185582