Bugzilla – Attachment 51407 Details for
Bug 16276
When automatically deleting expired borrowers, make sure they didn't log in recently
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16276: Update borrowers.lastseen when a patron is active
Bug-16276-Update-borrowerslastseen-when-a-patron-i.patch (text/plain), 1.56 KB, created by
Nicolas Legrand
on 2016-05-11 10:27:25 UTC
(
hide
)
Description:
Bug 16276: Update borrowers.lastseen when a patron is active
Filename:
MIME Type:
Creator:
Nicolas Legrand
Created:
2016-05-11 10:27:25 UTC
Size:
1.56 KB
patch
obsolete
>From fd0827bfe719b64d44d576e2267154ed22a53542 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sun, 24 Apr 2016 16:04:16 +0100 >Subject: [PATCH] Bug 16276: Update borrowers.lastseen when a patron is active > >In order to add the ability to delete patrons who have been inactive for >more than a given time, we need to track down the last time they were >active. >To do that, we need a new DB column in the borrowers table (lastseen). >Note that the borrowers.lastseen column will not be initialised for existing >installations (set to NULL) so inactive existing patrons will never be >deleted. >A workaround would be to init them at the date when the new column will >be added. > >Test plan: >0/ Set the new pref TrackLastPatronActivity on >1/ Log in as a patron (staff or OPAC) >2/ Check that the borrowers.lastseen field has been updated with the >current time > >Sponsored-by: BULAC - http://www.bulac.fr/ >Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> > >https://bugs.koha-community.org/show_bug.cgi?id=12276 >--- > C4/Auth.pm | 9 +++++++++ > 1 file changed, 9 insertions(+) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 3081f07..3d20c85 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -1179,6 +1179,15 @@ sub checkauth { > -HttpOnly => 1 > ); > } >+ >+ if ( $userid ) { >+ $dbh->do(q| >+ UPDATE borrowers >+ SET lastseen = NOW() >+ WHERE userid = ? >+ |, undef, $userid); >+ } >+ > return ( $userid, $cookie, $sessionID, $flags ); > } > >-- >2.1.4
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 16276
:
50615
|
50616
|
50617
|
50618
|
50619
|
50620
|
51191
|
51407
|
51408
|
51409
|
51410
|
51411
|
51412
|
54588
|
54589
|
54590
|
54591
|
54592
|
54612
|
54613
|
54614
|
54615
|
54616
|
54617
|
54618
|
54619
|
54620
|
54621
|
54622
|
54623
|
54624
|
54625
|
55495
|
55496
|
55497
|
55498
|
55499
|
55500
|
55501