summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-05-07 11:39:54 +0000
committerDries Buytaert <dries@buytaert.net>2005-05-07 11:39:54 +0000
commit39d0fe9a3882f26ff1abe2bca2c28f94b0a8cec0 (patch)
treeb2186e04ba329254abd00b8a866d16e47b9e64b3 /includes
parent898e2b668879e584a13202e38a2366a0de2aabb5 (diff)
downloadbrdo-39d0fe9a3882f26ff1abe2bca2c28f94b0a8cec0.tar.gz
brdo-39d0fe9a3882f26ff1abe2bca2c28f94b0a8cec0.tar.bz2
- User module improvements: added an 'access' column to the users-table to
keep track of the user's last access. In turn, this allowed me to: 1. Optimize the "Who's online" block. On drupal.org, the "Who's online" block requires 32 SQL queries. With this patch, only 2 queries are left (eliminated 30 SQL queries), and one of the two remaining queries became appr. 20 times faster. 2. Correct the "Last access" column in the user administration overview table. The presented data was not accurate, which led to the column being removed. You can now sort users by 'last access'.
Diffstat (limited to 'includes')
-rw-r--r--includes/session.inc1
1 files changed, 1 insertions, 0 deletions
diff --git a/includes/session.inc b/includes/session.inc
index 517651704..126c56f02 100644
--- a/includes/session.inc
+++ b/includes/session.inc
@@ -46,6 +46,7 @@ function sess_write($key, $value) {
global $user;
db_query("UPDATE {sessions} SET uid = %d, cache = %d, hostname = '%s', session = '%s', timestamp = %d WHERE sid = '%s'", $user->uid, $user->cache, $_SERVER["REMOTE_ADDR"], $value, time(), $key);
+ db_query("UPDATE {users} SET access = %d WHERE uid = %d", time(), $user->uid);
return '';
}