summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--UPGRADING7
-rw-r--r--support/schema/aur-schema.sql1
-rw-r--r--web/lib/acctfuncs.inc.php5
3 files changed, 12 insertions, 1 deletions
diff --git a/UPGRADING b/UPGRADING
index c0866e5e..863fbd84 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -1,6 +1,13 @@
Upgrading
=========
+From 1.9.0 to 1.9.X
+-------------------
+
+1. Add new "Users" table login date column:
+
+ALTER TABLE Users ADD COLUMN LastLogin BIGINT NOT NULL DEFAULT 0;
+
From 1.8.2 to 1.9.0
-------------------
diff --git a/support/schema/aur-schema.sql b/support/schema/aur-schema.sql
index 544ed941..6c8feca8 100644
--- a/support/schema/aur-schema.sql
+++ b/support/schema/aur-schema.sql
@@ -32,6 +32,7 @@ CREATE TABLE Users (
LangPreference VARCHAR(5) NOT NULL DEFAULT 'en',
IRCNick VARCHAR(32) NOT NULL DEFAULT '',
LastVoted BIGINT UNSIGNED NOT NULL DEFAULT 0,
+ LastLogin BIGINT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (ID),
UNIQUE (Username),
UNIQUE (Email),
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php
index 087aea3b..969fb60f 100644
--- a/web/lib/acctfuncs.inc.php
+++ b/web/lib/acctfuncs.inc.php
@@ -637,8 +637,11 @@ function try_login() {
}
if ($logged_in) {
- # set our SID cookie
+ $q = "UPDATE Users SET LastLogin = UNIX_TIMESTAMP() ";
+ $q.= "WHERE ID = '$userID'";
+ db_query($q, $dbh);
+ # set our SID cookie
if (isset($_POST['remember_me']) &&
$_POST['remember_me'] == "on") {
# Set cookies for 30 days.