summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Auth
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-02-20 16:53:16 +0100
committermkanat%kerio.com <>2005-02-20 16:53:16 +0100
commite547dd6d7b7b9a3c2135c56dd6b7a433743fd4b1 (patch)
tree179cd1f21b8e26b2cf2feec6ebfe30ddbd33afdd /Bugzilla/Auth
parent335b8c125f821a96ddfd769163c92c1d74ce62f6 (diff)
downloadbugzilla-e547dd6d7b7b9a3c2135c56dd6b7a433743fd4b1.tar.gz
bugzilla-e547dd6d7b7b9a3c2135c56dd6b7a433743fd4b1.tar.xz
Bug 280499: Replace "TO_DAYS()" with Bugzilla::DB function call
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=mkanat, a=justdave
Diffstat (limited to 'Bugzilla/Auth')
-rw-r--r--Bugzilla/Auth/Login/WWW/CGI.pm7
1 files changed, 4 insertions, 3 deletions
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;
}