From 295fb5373ae0a37bfbc36a4461dc3ed2c3cbf9cb Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Fri, 4 Sep 2009 14:53:35 +0000 Subject: - fixed bug #44975 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10103 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/session.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'phpBB/includes/session.php') diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 112cf4e2fd..dcfde14159 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -1361,6 +1361,20 @@ class session WHERE user_id = ' . (int) $user_id; $db->sql_query($sql); + // Update last visit info first before deleting sessions + $sql = 'SELECT session_time, session_page + FROM ' . SESSIONS_TABLE . ' + WHERE session_user_id = ' . (int) $user_id . ' + ORDER BY session_time DESC'; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_lastvisit = ' . (int) $row['session_time'] . ", user_lastpage = '" . $db->sql_escape($row['session_page']) . "' + WHERE user_id = " . (int) $user_id; + $db->sql_query($sql); + // Let's also clear any current sessions for the specified user_id // If it's the current user then we'll leave this session intact $sql_where = 'session_user_id = ' . (int) $user_id; -- cgit v1.2.1