[Koha-bugs] [Bug 15504] Track Patron's Last Activity

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Dec 28 12:55:23 CET 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15504

--- Comment #31 from Magnus Enger <magnus at libriotech.no> ---
Relevat code:

C4/SIP/ILS/Patron.pm:

476 =head2 update_lastseen
477 
478     $patron->update_lastseen();
479 
480     Patron method to update lastseen field in borrower
481     to record that patron has been seen via sip connection
482 
483 =cut
484 
485 sub update_lastseen {
486     my $self = shift;
487     my $kohaobj = Koha::Patrons->find( $self->{borrowernumber} );
488     $kohaobj->track_login if $kohaobj; # track_login checks the pref
489 }

Koha/Patron.pm:

910 =head3 track_login
911 
912     $patron->track_login;
913     $patron->track_login({ force => 1 });
914 
915     Tracks a (successful) login attempt.
916     The preference TrackLastPatronActivity must be enabled. Or you
917     should pass the force parameter.
918 
919 =cut
920 
921 sub track_login {
922     my ( $self, $params ) = @_;
923     return if
924         !$params->{force} &&
925         !C4::Context->preference('TrackLastPatronActivity');
926     $self->lastseen( dt_from_string() )->store;
927 }

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list