|
From: Meik S. <acy...@ph...> - 2009-08-25 09:08:11
|
Author: acydburn
Date: Tue Aug 25 10:07:26 2009
New Revision: 10053
Log:
Make sure only logs for existing users are displayed and user-specific logs removed on user deletion. (Bug #49855)
Modified:
branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html
branches/phpBB-3_0_0/phpBB/includes/functions_admin.php
branches/phpBB-3_0_0/phpBB/includes/functions_user.php
branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_queue.php
Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html
==============================================================================
*** branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html (original)
--- branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html Tue Aug 25 10:07:26 2009
***************
*** 199,204 ****
--- 199,205 ----
<li>[Fix] Fix email problems on servers with PHP installations not accepting RFC-compliant subject string passed to the the mail()-function. (Bug #46725)</li>
<li>[Fix] Correctly orientate Control-Panel-Navigation background-image on RTL languages. (Bug #49945)</li>
<li>[Fix] Sort private messages by message time and not message id. (Bug #50015)</li>
+ <li>[Fix] Make sure only logs for existing users are displayed and user-specific logs removed on user deletion. (Bug #49855)</li>
<li>[Change] submit_post() now accepts force_approved_state key passed to $data to indicate new posts being approved (true) or unapproved (false).</li>
<li>[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.</li>
<li>[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)</li>
Modified: branches/phpBB-3_0_0/phpBB/includes/functions_admin.php
==============================================================================
*** branches/phpBB-3_0_0/phpBB/includes/functions_admin.php (original)
--- branches/phpBB-3_0_0/phpBB/includes/functions_admin.php Tue Aug 25 10:07:26 2009
***************
*** 2744,2751 ****
}
$sql = 'SELECT COUNT(l.log_id) AS total_entries
! FROM ' . LOG_TABLE . " l
WHERE l.log_type = $log_type
AND l.log_time >= $limit_days
$sql_keywords
$sql_forum";
--- 2744,2752 ----
}
$sql = 'SELECT COUNT(l.log_id) AS total_entries
! FROM ' . LOG_TABLE . ' l, ' . USERS_TABLE . " u
WHERE l.log_type = $log_type
+ AND l.user_id = u.user_id
AND l.log_time >= $limit_days
$sql_keywords
$sql_forum";
Modified: branches/phpBB-3_0_0/phpBB/includes/functions_user.php
==============================================================================
*** branches/phpBB-3_0_0/phpBB/includes/functions_user.php (original)
--- branches/phpBB-3_0_0/phpBB/includes/functions_user.php Tue Aug 25 10:07:26 2009
***************
*** 538,543 ****
--- 538,554 ----
$cache->destroy('sql', MODERATOR_CACHE_TABLE);
+ // Delete user log entries about this user
+ $sql = 'DELETE FROM ' . LOG_TABLE . '
+ WHERE reportee_id = ' . $user_id;
+ $db->sql_query($sql);
+
+ // Change user_id to anonymous for this users triggered events
+ $sql = 'UPDATE ' . LOG_TABLE . '
+ SET user_id = ' . ANONYMOUS . '
+ WHERE user_id = ' . $user_id;
+ $db->sql_query($sql);
+
// Delete the user_id from the zebra table
$sql = 'DELETE FROM ' . ZEBRA_TABLE . '
WHERE user_id = ' . $user_id . '
Modified: branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_queue.php
==============================================================================
*** branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_queue.php (original)
--- branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_queue.php Tue Aug 25 10:07:26 2009
***************
*** 556,561 ****
--- 556,562 ----
$post_approve_sql[] = $post_id;
}
+
$post_id_list = array_values(array_diff($post_id_list, $post_approved_list));
for ($i = 0, $size = sizeof($post_approved_list); $i < $size; $i++)
{
***************
*** 834,840 ****
'post_subject' => $post_info[$post_id]['post_subject'],
'forum_id' => $post_info[$post_id]['forum_id'],
'topic_id' => $post_info[$post_id]['topic_id'],
! );
}
}
--- 835,841 ----
'post_subject' => $post_info[$post_id]['post_subject'],
'forum_id' => $post_info[$post_id]['forum_id'],
'topic_id' => $post_info[$post_id]['topic_id'],
! );
}
}
|