From 39d0fe9a3882f26ff1abe2bca2c28f94b0a8cec0 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 7 May 2005 11:39:54 +0000 Subject: - 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'. --- includes/session.inc | 1 + 1 file changed, 1 insertion(+) (limited to 'includes') 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 ''; } -- cgit v1.2.3