Use strftime to format sessionlog times

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
MJ Ray 2009-06-15 13:51:43 +01:00 committed by Galen Charlton
parent bfbd5dc61d
commit d3c734c750

View file

@ -28,6 +28,7 @@ use C4::Members;
use C4::Koha;
use C4::Branch; # GetBranches
use C4::VirtualShelves;
use POSIX qw/strftime/;
# use utf8;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $debug $ldap);
@ -575,7 +576,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,(strftime "%c",localtime));
$sessionID = undef;
$userid = undef;
}
@ -584,7 +585,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,(strftime "%c",localtime));
$userid = undef;
$sessionID = undef;
}
@ -595,7 +596,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,(strftime "%c",localtime), $info{'newip'});
$sessionID = undef;
$userid = undef;
}
@ -622,7 +623,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'},(strftime "%c",localtime));
if ( $flags = haspermission($userid, $flagsrequired) ) {
$loggedin = 1;
}