From 62e0baa92af2fab28d9a0e41010d4bee9a70fc3c Mon Sep 17 00:00:00 2001 From: tonnesen Date: Thu, 4 Jul 2002 19:42:48 +0000 Subject: [PATCH] Minor changes --- C4/Auth.pm | 4 ++++ shelves.pl | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 3e08534ba0..0908b85fa0 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -59,6 +59,10 @@ sub checkauth { my $sti=$dbh->prepare("insert into sessions (sessionID, userid, ip,lasttime) values (?, ?, ?, ?)"); $sti->execute($sessionID, $userid, $ENV{'REMOTE_ADDR'}, time()); return ($userid, $sessionID, $sessionID); + } elsif ($userid eq 'patron' && $password eq 'koha') { + my $sti=$dbh->prepare("insert into sessions (sessionID, userid, ip,lasttime) values (?, ?, ?, ?)"); + $sti->execute($sessionID, $userid, $ENV{'REMOTE_ADDR'}, time()); + return ($userid, $sessionID, $sessionID); } else { if ($userid) { $message="Invalid userid or password entered."; diff --git a/shelves.pl b/shelves.pl index 3ea9688e69..87a13ccf55 100755 --- a/shelves.pl +++ b/shelves.pl @@ -14,7 +14,7 @@ use C4::Auth; my $env; my $query = new CGI; -my ($userid, $cookie, $sessionID) = checkauth($query); +my ($loggedinuser, $cookie, $sessionID) = checkauth($query); print $query->header(-cookie => $cookie); my $headerbackgroundcolor='#663266'; my $circbackgroundcolor='#555555'; @@ -26,7 +26,7 @@ print startpage(); print startmenu('catalogue'); -print "SessionID: $sessionID
\n"; +print "Logged in as: $loggedinuser Log Out
\n"; my ($shelflist) = GetShelfList(); @@ -169,6 +169,9 @@ EOF # # $Log$ +# Revision 1.5 2002/07/04 19:42:48 tonnesen +# Minor changes +# # Revision 1.4 2002/07/04 19:21:29 tonnesen # Beginning of authentication api. Applied to shelves.pl for now as a test case. # -- 2.39.5