From a6d477d3ed744789598ccb300a7a244cbe2481a7 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 28 Jul 2010 14:01:59 +0000 Subject: [PATCH] Bug 5066 (Incorrect use of localtime function when calling _session_log) for 3.0.x only This patch applies to 3.0.x only and solves a little bug in using the localtime function when writing to tmp/sessionlog. It should be called in scalar context iinstead of list context. --- C4/Auth.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index c50658c9bf..108d9e3f4e 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -564,7 +564,7 @@ sub checkauth { $session->flush; $session->delete(); C4::Context->_unset_userenv($sessionID); - _session_log(sprintf "%20s from %16s logged out at %30s (manually).\n", $userid,$ip,localtime); + _session_log(sprintf "%20s from %16s logged out at %30s (manually).\n", $userid,$ip,scalar localtime); $sessionID = undef; $userid = undef; } @@ -573,7 +573,7 @@ sub checkauth { $info{'timed_out'} = 1; $session->delete(); C4::Context->_unset_userenv($sessionID); - _session_log(sprintf "%20s from %16s logged out at %30s (inactivity).\n", $userid,$ip,localtime); + _session_log(sprintf "%20s from %16s logged out at %30s (inactivity).\n", $userid,$ip,scalar localtime); $userid = undef; $sessionID = undef; } @@ -584,7 +584,7 @@ sub checkauth { $info{'different_ip'} = 1; $session->delete(); C4::Context->_unset_userenv($sessionID); - _session_log(sprintf "%20s from %16s logged out at %30s (ip changed to %16s).\n", $userid,$ip,localtime, $info{'newip'}); + _session_log(sprintf "%20s from %16s logged out at %30s (ip changed to %16s).\n", $userid,$ip,scalar localtime, $info{'newip'}); $sessionID = undef; $userid = undef; } @@ -611,7 +611,7 @@ sub checkauth { my $password = $query->param('password'); my ( $return, $cardnumber ) = checkpw( $dbh, $userid, $password ); if ($return) { - _session_log(sprintf "%20s from %16s logged in at %30s.\n", $userid,$ENV{'REMOTE_ADDR'},localtime); + _session_log(sprintf "%20s from %16s logged in at %30s.\n", $userid,$ENV{'REMOTE_ADDR'},scalar localtime); if ( $flags = haspermission($userid, $flagsrequired) ) { $loggedin = 1; } -- 2.39.5