From e547dd6d7b7b9a3c2135c56dd6b7a433743fd4b1 Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Sun, 20 Feb 2005 15:53:16 +0000 Subject: Bug 280499: Replace "TO_DAYS()" with Bugzilla::DB function call Patch By Tomas Kopal r=mkanat, a=justdave --- Bugzilla/Auth/Login/WWW/CGI.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Bugzilla/Auth') diff --git a/Bugzilla/Auth/Login/WWW/CGI.pm b/Bugzilla/Auth/Login/WWW/CGI.pm index 98999a368..42e454f86 100644 --- a/Bugzilla/Auth/Login/WWW/CGI.pm +++ b/Bugzilla/Auth/Login/WWW/CGI.pm @@ -45,6 +45,7 @@ sub login { } my $cgi = Bugzilla->cgi; + my $dbh = Bugzilla->dbh; # First, try the actual login method against form variables my $username = $cgi->param("Bugzilla_login"); @@ -67,7 +68,6 @@ sub login { # subsequent login trick_taint($ipaddr); - my $dbh = Bugzilla->dbh; $dbh->do("INSERT INTO logincookies (userid, ipaddr, lastused) VALUES (?, ?, NOW())", undef, @@ -159,8 +159,9 @@ sub login { # This seems like as good as time as any to get rid of old # crufty junk in the logincookies table. Get rid of any entry # that hasn't been used in a month. - Bugzilla->dbh->do("DELETE FROM logincookies " . - "WHERE TO_DAYS(NOW()) - TO_DAYS(lastused) > 30"); + $dbh->do("DELETE FROM logincookies WHERE " . + $dbh->sql_to_days('NOW()') . " - " . + $dbh->sql_to_days('lastused') . " > 30"); exit; } -- cgit v1.2.3-24-g4f1b