From 26c031034a62e69d51b19a0a43f98feb864cf324 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Thu, 5 Apr 2018 16:58:33 +0000 Subject: [PATCH] Bug 18821: [DO NOT PUSH] Print STDERR Scaffolding Tests must trigger all STDERRs added. prove t/db_dependent/Members.t prove t/db_dependent/Auth.t Patrons 3 and 4 not triggered. Signed-off-by: Mark Tompsett --- C4/Auth.pm | 3 +++ Koha/Patron.pm | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/C4/Auth.pm b/C4/Auth.pm index 7a5b4e4..f182318 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -802,6 +802,7 @@ sub checkauth { my $q_userid = $query->param('userid') // ''; my $session; + print STDERR "Auth 1\n"; # Basic authentication is incompatible with the use of Shibboleth, # as Shibboleth may return REMOTE_USER as a Shibboleth attribute, @@ -828,6 +829,7 @@ sub checkauth { } elsif ( $sessionID = $query->cookie("CGISESSID") ) { # assignment, not comparison + print STDERR "Auth 2\n"; $session = get_session($sessionID); C4::Context->_new_userenv($sessionID); my ( $ip, $lasttime, $sessiontype ); @@ -1221,6 +1223,7 @@ sub checkauth { if ( $userid ) { # track_login also depends on pref TrackLastPatronActivity my $patron = Koha::Patrons->find({ userid => $userid }); + print STDERR "Auth 3: $userid\n"; $patron->track_login( { session => $session } ) if $patron; } diff --git a/Koha/Patron.pm b/Koha/Patron.pm index fa02865..442cf03 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -404,15 +404,20 @@ sub has_overdues { sub track_login { my ( $self, $params ) = @_; + print STDERR "Patron 1\n"; my $session = $params->{session}; return unless C4::Context->preference('TrackLastPatronActivity') || $params->{force}; + print STDERR "Patron 2\n"; if ( $session ) { + print STDERR "Patron 3\n"; return if $session->param('tracked_for_session') && !$params->{force}; + print STDERR "Patron 4\n"; $session->param('tracked_for_session', 1); } + print STDERR "Patron 5\n"; $self->lastseen( dt_from_string() )->store; } -- 2.1.4