aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCullen Walsh <brainy@phpbb.com>2010-01-25 18:19:18 +0000
committerCullen Walsh <brainy@phpbb.com>2010-01-25 18:19:18 +0000
commitfe98d43bb5c74d9939a60a2b7c9202b19b410d21 (patch)
treeacd5dc98e0feb8403bd256bb2c71d28cb8a200d9
parent4eda4855efa2392226f9267b25094402886a64d2 (diff)
downloadforums-fe98d43bb5c74d9939a60a2b7c9202b19b410d21.tar
forums-fe98d43bb5c74d9939a60a2b7c9202b19b410d21.tar.gz
forums-fe98d43bb5c74d9939a60a2b7c9202b19b410d21.tar.bz2
forums-fe98d43bb5c74d9939a60a2b7c9202b19b410d21.tar.xz
forums-fe98d43bb5c74d9939a60a2b7c9202b19b410d21.zip
[Fix] Don't send activation email when user tries to change email without permission (fix by nrohler). (Bug #56335)
Authorised by: naderman git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10443 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/docs/CHANGELOG.html1
-rw-r--r--phpBB/includes/session.php13
2 files changed, 9 insertions, 5 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 3a5ca1bedf..15720cc94e 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -146,6 +146,7 @@
<li>[Fix] Correctly hover list menu in UCP and MCP for rtl languages. (Bug #49945)</li>
<li>[Fix] Correctly orientate quoted text image on RTL languages. (Bug #33745)</li>
<li>[Fix] Deprecate $allow_reply parameter to truncate_string() (Bug #56675)</li>
+ <li>[Fix] Update user's last visit field correctly when changing activation status. (Bug #56185)</li>
<li>[Change] Move redirect into a hidden field to avoid issues with mod_security. (Bug #54145)</li>
<li>[Change] Log activation through inactive users ACP. (Bug #30145)</li>
<li>[Change] Send time of last item instead of current time in ATOM Feeds. (Bug #53305)</li>
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 933bd47347..11f1896332 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -1361,7 +1361,7 @@ class session
WHERE user_id = ' . (int) $user_id;
$db->sql_query($sql);
- // Update last visit info first before deleting sessions
+ // If the user is logged in, update last visit info first before deleting sessions
$sql = 'SELECT session_time, session_page
FROM ' . SESSIONS_TABLE . '
WHERE session_user_id = ' . (int) $user_id . '
@@ -1370,10 +1370,13 @@ class session
$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);
+ if ($row)
+ {
+ $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