diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2009-08-25 09:07:26 +0000 | 
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2009-08-25 09:07:26 +0000 | 
| commit | 17f40511bf4df9dd46cd13cbd2c7802c49575783 (patch) | |
| tree | 96b9183199fed320c786300f44767792ca1fa4da | |
| parent | 19bae65f4c79c7f50d71fd57bfff6ff1033ed84b (diff) | |
| download | forums-17f40511bf4df9dd46cd13cbd2c7802c49575783.tar forums-17f40511bf4df9dd46cd13cbd2c7802c49575783.tar.gz forums-17f40511bf4df9dd46cd13cbd2c7802c49575783.tar.bz2 forums-17f40511bf4df9dd46cd13cbd2c7802c49575783.tar.xz forums-17f40511bf4df9dd46cd13cbd2c7802c49575783.zip  | |
Make sure only logs for existing users are displayed and user-specific logs removed on user deletion. (Bug #49855)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10053 89ea8834-ac86-4346-8a33-228a782c2dd0
| -rw-r--r-- | phpBB/docs/CHANGELOG.html | 1 | ||||
| -rw-r--r-- | phpBB/includes/functions_admin.php | 3 | ||||
| -rw-r--r-- | phpBB/includes/functions_user.php | 11 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 3 | 
4 files changed, 16 insertions, 2 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index a8b68e587d..0d9409b142 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -199,6 +199,7 @@  		<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> diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index a021717f57..205d7046c7 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2744,8 +2744,9 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id  	}  	$sql = 'SELECT COUNT(l.log_id) AS total_entries -		FROM ' . LOG_TABLE . " l +		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"; diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index c562ac666f..cb3306745e 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -538,6 +538,17 @@ function user_delete($mode, $user_id, $post_username = false)  	$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 . ' diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index f72007acf5..3783aadab5 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -556,6 +556,7 @@ function approve_post($post_id_list, $id, $mode)  			$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,7 +835,7 @@ function disapprove_post($post_id_list, $id, $mode)  					'post_subject'	=> $post_info[$post_id]['post_subject'],  					'forum_id'		=> $post_info[$post_id]['forum_id'],  					'topic_id'		=> $post_info[$post_id]['topic_id'], -				);			 +				);  			}  		}  | 
