diff options
Diffstat (limited to 'phpBB/includes/mcp/mcp_main.php')
| -rw-r--r-- | phpBB/includes/mcp/mcp_main.php | 78 | 
1 files changed, 63 insertions, 15 deletions
| diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 227ae84bd6..c084f5af52 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -237,7 +237,7 @@ class mcp_main  */  function lock_unlock($action, $ids)  { -	global $auth, $user, $db, $phpEx, $phpbb_root_path, $request; +	global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_log;  	if ($action == 'lock' || $action == 'unlock')  	{ @@ -294,7 +294,11 @@ function lock_unlock($action, $ids)  		foreach ($data as $id => $row)  		{ -			add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_' . strtoupper($action), $row['topic_title']); +			$phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_' . strtoupper($action), false, array( +				'forum_id' => $row['forum_id'], +				'topic_id' => $row['topic_id'], +				$row['topic_title'] +			));  		}  		$success_msg = $l_prefix . ((sizeof($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS'; @@ -321,7 +325,7 @@ function lock_unlock($action, $ids)  */  function change_topic_type($action, $topic_ids)  { -	global $auth, $user, $db, $phpEx, $phpbb_root_path, $request; +	global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_log;  	switch ($action)  	{ @@ -396,7 +400,11 @@ function change_topic_type($action, $topic_ids)  			foreach ($data as $topic_id => $row)  			{ -				add_log('mod', $forum_id, $topic_id, 'LOG_TOPIC_TYPE_CHANGED', $row['topic_title']); +				$phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_TOPIC_TYPE_CHANGED', false, array( +					'forum_id' => $forum_id, +					'topic_id' => $topic_id, +					$row['topic_title'] +				));  			}  		} @@ -679,7 +687,7 @@ function mcp_move_topic($topic_ids)  */  function mcp_restore_topic($topic_ids)  { -	global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container; +	global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container, $phpbb_log;  	if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_approve')))  	{ @@ -703,13 +711,19 @@ function mcp_restore_topic($topic_ids)  		$data = phpbb_get_topic_data($topic_ids); +		/* @var $phpbb_content_visibility \phpbb\content_visibility */  		$phpbb_content_visibility = $phpbb_container->get('content.visibility');  		foreach ($data as $topic_id => $row)  		{  			$return = $phpbb_content_visibility->set_topic_visibility(ITEM_APPROVED, $topic_id, $row['forum_id'], $user->data['user_id'], time(), '');  			if (!empty($return))  			{ -				add_log('mod', $row['forum_id'], $topic_id, 'LOG_RESTORE_TOPIC', $row['topic_title'], $row['topic_first_poster_name']); +				$phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_RESTORE_TOPIC', false, array( +					'forum_id' => $row['forum_id'], +					'topic_id' => $topic_id, +					$row['topic_title'], +					$row['topic_first_poster_name'] +				));  			}  		}  	} @@ -752,7 +766,7 @@ function mcp_restore_topic($topic_ids)  */  function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = '', $action = 'delete_topic')  { -	global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container; +	global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container, $phpbb_log;  	$check_permission = ($is_soft) ? 'm_softdelete' : 'm_delete';  	if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array($check_permission))) @@ -781,23 +795,40 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''  		{  			if ($row['topic_moved_id'])  			{ -				add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_SHADOW_TOPIC', $row['topic_title']); +				$phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_DELETE_SHADOW_TOPIC', false, array( +					'forum_id' => $row['forum_id'], +					'topic_id' => $topic_id, +					$row['topic_title'] +				));  			}  			else  			{  				// Only soft delete non-shadow topics  				if ($is_soft)  				{ +					/* @var $phpbb_content_visibility \phpbb\content_visibility */  					$phpbb_content_visibility = $phpbb_container->get('content.visibility');  					$return = $phpbb_content_visibility->set_topic_visibility(ITEM_DELETED, $topic_id, $row['forum_id'], $user->data['user_id'], time(), $soft_delete_reason);  					if (!empty($return))  					{ -						add_log('mod', $row['forum_id'], $topic_id, 'LOG_SOFTDELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name'], $soft_delete_reason); +						$phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_SOFTDELETE_TOPIC', false, array( +							'forum_id' => $row['forum_id'], +							'topic_id' => $topic_id, +							$row['topic_title'], +							$row['topic_first_poster_name'], +							$soft_delete_reason +						));  					}  				}  				else  				{ -					add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name'], $soft_delete_reason); +					$phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_DELETE_TOPIC', false, array( +						'forum_id' => $row['forum_id'], +						'topic_id' => $topic_id, +						$row['topic_title'], +						$row['topic_first_poster_name'], +						$soft_delete_reason +					));  				}  			}  		} @@ -891,7 +922,7 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''  */  function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '', $action = 'delete_post')  { -	global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container; +	global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container, $phpbb_log;  	$check_permission = ($is_soft) ? 'm_softdelete' : 'm_delete';  	if (!phpbb_check_ids($post_ids, POSTS_TABLE, 'post_id', array($check_permission))) @@ -948,6 +979,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',  			);  		} +		/* @var $phpbb_content_visibility \phpbb\content_visibility */  		$phpbb_content_visibility = $phpbb_container->get('content.visibility');  		foreach ($topic_info as $topic_id => $topic_data)  		{ @@ -962,7 +994,13 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',  		foreach ($approve_log as $row)  		{  			$post_username = ($row['poster_id'] == ANONYMOUS && !empty($row['post_username'])) ? $row['post_username'] : $row['username']; -			add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_SOFTDELETE_POST', $row['post_subject'], $post_username, $soft_delete_reason); +			$phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_SOFTDELETE_POST', false, array( +				'forum_id' => $row['forum_id'], +				'topic_id' => $row['topic_id'], +				$row['post_subject'], +				$post_username, +				$soft_delete_reason +			));  		}  		$topic_id = $request->variable('t', 0); @@ -1005,7 +1043,13 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',  		foreach ($post_data as $id => $row)  		{  			$post_username = ($row['poster_id'] == ANONYMOUS && !empty($row['post_username'])) ? $row['post_username'] : $row['username']; -			add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject'], $post_username, $soft_delete_reason); +			$phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_DELETE_POST', false, array( +				'forum_id' => $row['forum_id'], +				'topic_id' => $row['topic_id'], +				$row['post_subject'], +				$post_username, +				$soft_delete_reason +			));  		}  		// Now delete the posts, topics and forums are automatically resync'ed @@ -1119,7 +1163,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',  function mcp_fork_topic($topic_ids)  {  	global $auth, $user, $db, $template, $config; -	global $phpEx, $phpbb_root_path; +	global $phpEx, $phpbb_root_path, $phpbb_log;  	if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))  	{ @@ -1476,7 +1520,11 @@ function mcp_fork_topic($topic_ids)  		foreach ($new_topic_id_list as $topic_id => $new_topic_id)  		{ -			add_log('mod', $to_forum_id, $new_topic_id, 'LOG_FORK', $topic_row['forum_name']); +			$phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_FORK', false, array( +				'forum_id' => $to_forum_id, +				'topic_id' => $new_topic_id, +				$topic_row['forum_name'] +			));  		}  		$success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_FORKED_SUCCESS' : 'TOPICS_FORKED_SUCCESS'; | 
