diff options
Diffstat (limited to 'phpBB/includes/mcp/mcp_reports.php')
| -rw-r--r-- | phpBB/includes/mcp/mcp_reports.php | 50 | 
1 files changed, 31 insertions, 19 deletions
| diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index fa2fed842f..3970237058 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -35,13 +35,13 @@ class mcp_reports  	function main($id, $mode)  	{ -		global $auth, $db, $user, $template, $cache; +		global $auth, $db, $user, $template, $cache, $request;  		global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container, $phpbb_dispatcher;  		include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); -		$forum_id = request_var('f', 0); -		$start = request_var('start', 0); +		$forum_id = $request->variable('f', 0); +		$start = $request->variable('start', 0);  		$this->page_title = 'MCP_REPORTS'; @@ -51,7 +51,7 @@ class mcp_reports  			case 'delete':  				include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); -				$report_id_list = request_var('report_id_list', array(0)); +				$report_id_list = $request->variable('report_id_list', array(0));  				if (!sizeof($report_id_list))  				{ @@ -69,10 +69,11 @@ class mcp_reports  				$user->add_lang(array('posting', 'viewforum', 'viewtopic')); -				$post_id = request_var('p', 0); +				$post_id = $request->variable('p', 0);  				// closed reports are accessed by report id -				$report_id = request_var('r', 0); +				$report_id = $request->variable('r', 0); +  				$sql_ary = array(  					'SELECT'	=> 'r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, r.reported_post_text, r.reported_post_uid, r.reported_post_bitfield, r.reported_post_enable_magic_url, r.reported_post_enable_smilies, r.reported_post_enable_bbcode, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour', @@ -138,9 +139,10 @@ class mcp_reports  					trigger_error('NO_REPORT');  				} +				/* @var $phpbb_notifications \phpbb\notification\manager */  				$phpbb_notifications = $phpbb_container->get('notification_manager'); -				$phpbb_notifications->mark_notifications_read('notification.type.report_post', $post_id, $user->data['user_id']); +				$phpbb_notifications->mark_notifications('report_post', $post_id, $user->data['user_id']);  				if (!$report_id && $report['report_closed'])  				{ @@ -287,7 +289,7 @@ class mcp_reports  					'POST_SUBJECT'			=> ($post_info['post_subject']) ? $post_info['post_subject'] : $user->lang['NO_SUBJECT'],  					'POST_DATE'				=> $user->format_date($post_info['post_time']),  					'POST_IP'				=> $post_info['poster_ip'], -					'POST_IPADDR'			=> ($auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '', +					'POST_IPADDR'			=> ($auth->acl_get('m_info', $post_info['forum_id']) && $request->variable('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '',  					'POST_ID'				=> $post_info['post_id'],  					'U_LOOKUP_IP'			=> ($auth->acl_get('m_info', $post_info['forum_id'])) ? $this->u_action . '&r=' . $report_id . '&p=' . $post_id . '&f=' . $forum_id . '&lookup=' . $post_info['poster_ip'] . '#ip' : '', @@ -299,7 +301,7 @@ class mcp_reports  			case 'reports':  			case 'reports_closed': -				$topic_id = request_var('t', 0); +				$topic_id = $request->variable('t', 0);  				$forum_info = array();  				$forum_list_reports = get_forum_list('m_report', false, true); @@ -371,9 +373,10 @@ class mcp_reports  					$forum_list = array($forum_id);  				} +				/* @var $pagination \phpbb\pagination */ +				$pagination = $phpbb_container->get('pagination');  				$forum_list[] = 0;  				$forum_data = array(); -				$pagination = $phpbb_container->get('pagination');  				$forum_options = '<option value="0"' . (($forum_id == 0) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_FORUMS'] . '</option>';  				foreach ($forum_list_reports as $row) @@ -519,7 +522,7 @@ class mcp_reports  */  function close_report($report_id_list, $mode, $action, $pm = false)  { -	global $db, $template, $user, $config, $auth; +	global $db, $template, $user, $config, $auth, $phpbb_log, $request;  	global $phpEx, $phpbb_root_path, $phpbb_container;  	$pm_where = ($pm) ? ' AND r.post_id = 0 ' : ' AND r.pm_id = 0 '; @@ -557,19 +560,19 @@ function close_report($report_id_list, $mode, $action, $pm = false)  	if ($action == 'delete' && strpos($user->data['session_page'], 'mode=report_details') !== false)  	{ -		$redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&mode=reports'); +		$redirect = $request->variable('redirect', build_url(array('mode', 'r', 'quickmod')) . '&mode=reports');  	}  	else if ($action == 'delete' && strpos($user->data['session_page'], 'mode=pm_report_details') !== false)  	{ -		$redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&mode=pm_reports'); +		$redirect = $request->variable('redirect', build_url(array('mode', 'r', 'quickmod')) . '&mode=pm_reports');  	} -	else if ($action == 'close' && !request_var('r', 0)) +	else if ($action == 'close' && !$request->variable('r', 0))  	{ -		$redirect = request_var('redirect', build_url(array('mode', 'p', 'quickmod')) . '&mode=' . $module); +		$redirect = $request->variable('redirect', build_url(array('mode', 'p', 'quickmod')) . '&mode=' . $module);  	}  	else  	{ -		$redirect = request_var('redirect', build_url(array('quickmod'))); +		$redirect = $request->variable('redirect', build_url(array('quickmod')));  	}  	$success_msg = '';  	$forum_ids = array(); @@ -694,18 +697,27 @@ function close_report($report_id_list, $mode, $action, $pm = false)  		}  		unset($close_report_posts, $close_report_topics); +		/* @var $phpbb_notifications \phpbb\notification\manager */  		$phpbb_notifications = $phpbb_container->get('notification_manager');  		foreach ($reports as $report)  		{  			if ($pm)  			{ -				add_log('mod', 0, 0, 'LOG_PM_REPORT_' .  strtoupper($action) . 'D', $post_info[$report['pm_id']]['message_subject']); +				$phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_PM_REPORT_' .  strtoupper($action) . 'D', false, array( +					'forum_id' => 0, +					'topic_id' => 0, +					$post_info[$report['pm_id']]['message_subject'] +				));  				$phpbb_notifications->delete_notifications('notification.type.report_pm', $report['pm_id']);  			}  			else  			{ -				add_log('mod', $post_info[$report['post_id']]['forum_id'], $post_info[$report['post_id']]['topic_id'], 'LOG_REPORT_' .  strtoupper($action) . 'D', $post_info[$report['post_id']]['post_subject']); +				$phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_REPORT_' .  strtoupper($action) . 'D', false, array( +					'forum_id' => $post_info[$report['post_id']]['forum_id'], +					'topic_id' => $post_info[$report['post_id']]['topic_id'], +					$post_info[$report['post_id']]['post_subject'] +				));  				$phpbb_notifications->delete_notifications('notification.type.report_post', $report['post_id']);  			}  		} @@ -758,7 +770,7 @@ function close_report($report_id_list, $mode, $action, $pm = false)  		confirm_box(false, $user->lang[strtoupper($action) . "_{$pm_prefix}REPORT" . ((sizeof($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields);  	} -	$redirect = request_var('redirect', "index.$phpEx"); +	$redirect = $request->variable('redirect', "index.$phpEx");  	$redirect = reapply_sid($redirect);  	if (!$success_msg) | 
