summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Auth/Login/WWW/CGI.pm3
-rw-r--r--Bugzilla/Auth/Login/WWW/CGI/Cookie.pm2
-rwxr-xr-xchecksetup.pl9
3 files changed, 11 insertions, 3 deletions
diff --git a/Bugzilla/Auth/Login/WWW/CGI.pm b/Bugzilla/Auth/Login/WWW/CGI.pm
index 3b90ec6ad..6b1761959 100644
--- a/Bugzilla/Auth/Login/WWW/CGI.pm
+++ b/Bugzilla/Auth/Login/WWW/CGI.pm
@@ -68,7 +68,8 @@ sub login {
trick_taint($ipaddr);
my $dbh = Bugzilla->dbh;
- $dbh->do("INSERT INTO logincookies (userid, ipaddr) VALUES (?, ?)",
+ $dbh->do("INSERT INTO logincookies (userid, ipaddr, lastused)
+ VALUES (?, ?, NOW())",
undef,
$userid, $ipaddr);
my $logincookie = $dbh->selectrow_array("SELECT LAST_INSERT_ID()");
diff --git a/Bugzilla/Auth/Login/WWW/CGI/Cookie.pm b/Bugzilla/Auth/Login/WWW/CGI/Cookie.pm
index 84f2b27a8..a8ba4f777 100644
--- a/Bugzilla/Auth/Login/WWW/CGI/Cookie.pm
+++ b/Bugzilla/Auth/Login/WWW/CGI/Cookie.pm
@@ -76,7 +76,7 @@ sub authenticate {
if ($userid) {
# If we logged in successfully, then update the lastused time on the
# login cookie
- $dbh->do("UPDATE logincookies SET lastused=NULL WHERE cookie=?",
+ $dbh->do("UPDATE logincookies SET lastused=NOW() WHERE cookie=?",
undef,
$login_cookie);
diff --git a/checksetup.pl b/checksetup.pl
index 33ad92539..0d1ca477a 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -1782,7 +1782,7 @@ $table{logincookies} =
'cookie mediumint not null auto_increment primary key,
userid mediumint not null,
ipaddr varchar(40) NOT NULL,
- lastused timestamp,
+ lastused DATETIME NOT NULL,
index(lastused)';
@@ -4465,6 +4465,13 @@ if (! $sth->rows) {
"VALUES(1,'Unclassified','Unassigned to any classifications')");
}
+# 2004-08-29 - Tomas.Kopal@altap.cz, bug 257303
+# Change logincookies.lastused type from timestamp to datetime
+if (($fielddef = GetFieldDef("logincookies", "lastused")) &&
+ $fielddef->[1] =~ /^timestamp/) {
+ ChangeFieldType ('logincookies', 'lastused', 'DATETIME NOT NULL');
+}
+
#
# Final checks...