Skip to content

Commit

Permalink
Replaced &requireDBI with C4::Context->dbh, thus making the "use
Browse files Browse the repository at this point in the history
Database" statement unnecessary.
Replaced a prepare()/execute() with a do().
  • Loading branch information
arensb committed Oct 11, 2002
1 parent 82cd94b commit d582d90
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions opac/opac-logout.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl

use CGI;
use C4::Database;
use C4::Context;
use C4::Output;

my $query=new CGI;
Expand All @@ -27,6 +27,7 @@

my $sessions;
open (S, "/tmp/sessions");
# FIXME - Come up with a better logging mechanism
while (my ($sid, $u, $lasttime) = split(/:/, <S>)) {
chomp $lasttime;
(next) unless ($sid);
Expand All @@ -41,7 +42,7 @@
print S "$_:$userid:$lasttime\n";
}

my $dbh=C4Connect;
my $dbh = C4::Context->dbh;

# Check that this is the ip that created the session before deleting it

Expand All @@ -56,8 +57,7 @@
}
}

$sth=$dbh->prepare("delete from sessions where sessionID=?");
$sth->execute($sessionID);
$dbh->do("delete from sessions where sessionID=?", $sessionID);
open L, ">>/tmp/sessionlog";
my $time=localtime(time());
printf L "%20s from %16s logged out at %30s (manual log out).\n", $userid, $ip, $time;
Expand Down

0 comments on commit d582d90

Please sign in to comment.