diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index 372ccc023f..dd3efd4a71 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -136,9 +136,9 @@ function mcp_front_view($id, $mode, $action) while ($row = $db->sql_fetchrow($result)) { $template->assign_block_vars('report', array( - 'U_POST_DETAILS'=> $url . '&p=' . $row['post_id'] . '&mode=post_details', - 'U_MCP_FORUM' => ($row['forum_id']) ? $url . '&f=' . $row['forum_id'] . '&mode=forum_view' : '', - 'U_MCP_TOPIC' => $url . '&t=' . $row['topic_id'] . '&mode=topic_view', + 'U_POST_DETAILS'=> $url . '&p=' . $row['post_id'] . "&i=reports&mode=report_details", + 'U_MCP_FORUM' => ($row['forum_id']) ? $url . '&f=' . $row['forum_id'] . "&i=$id&mode=forum_view" : '', + 'U_MCP_TOPIC' => $url . '&t=' . $row['topic_id'] . "&i=$id&mode=topic_view", 'U_FORUM' => ($row['forum_id']) ? "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $row['forum_id'] : '', 'U_TOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $row['forum_id'] . '&t=' . $row['topic_id'], 'U_REPORTER' => ($row['user_id'] == ANONYMOUS) ? '' : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'], diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 8929520851..ac35ecfe3b 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -106,7 +106,7 @@ class mcp_queue $template->assign_vars(array( 'S_MCP_QUEUE' => true, 'S_APPROVE_ACTION' => "{$phpbb_root_path}mcp.$phpEx$SID&i=queue&p=$post_id&f=$forum_id", - 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), + 'S_CAN_VIEWIP' => $auth->acl_get('m_ip', $post_info['forum_id']), 'S_POST_REPORTED' => $post_info['post_reported'], 'S_POST_UNAPPROVED' => !$post_info['post_approved'], 'S_POST_LOCKED' => $post_info['post_edit_locked'], @@ -117,7 +117,7 @@ class mcp_queue 'U_MCP_WARN_USER' => "{$phpbb_root_path}mcp.$phpEx$SID&i=warn&mode=warn_user&u=" . $post_info['user_id'], 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? "{$phpbb_root_path}posting.$phpEx$SID&mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}" : '', - 'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], "", ''), + 'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], "", ''), 'REPORTED_IMG' => $user->img('icon_reported', $user->lang['POST_REPORTED']), 'UNAPPROVED_IMG' => $user->img('icon_unapproved', $user->lang['POST_UNAPPROVED']), 'EDIT_IMG' => $user->img('btn_edit', $user->lang['EDIT_POST']), @@ -269,7 +269,7 @@ class mcp_queue // Q: Why accessing the topic by a post_id instead of its topic_id? // A: To prevent the post from being hidden because of wrong encoding or different charset 'U_VIEWTOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $row['forum_id'] . '&p=' . $row['post_id'] . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''), - 'U_VIEW_DETAILS'=> "{$phpbb_root_path}mcp.$phpEx$SID&i=queue&start=$start&mode=approve_details&f={$forum_id}&p={$row['post_id']}", + 'U_VIEW_DETAILS'=> "{$phpbb_root_path}mcp.$phpEx$SID&i=queue&start=$start&mode=approve_details&f={$forum_id}&p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&t={$row['topic_id']}" : '' ), 'U_VIEWPROFILE' => ($row['poster_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['poster_id']}" : '', 'FORUM_NAME' => $row['forum_name'], @@ -732,7 +732,6 @@ class mcp_queue_info 'approve_details' => array('title' => 'MCP_QUEUE_APPROVE_DETAILS', 'auth' => 'acl_m_approve || aclf_m_approve'), 'unapproved_topics' => array('title' => 'MCP_QUEUE_UNAPPROVED_TOPICS', 'auth' => 'acl_m_approve || aclf_m_approve'), 'unapproved_posts' => array('title' => 'MCP_QUEUE_UNAPPROVED_POSTS', 'auth' => 'acl_m_approve || aclf_m_approve'), - 'reports' => array('title' => 'MCP_QUEUE_REPORTS', 'auth' => 'acl_m_approve'), ), ); } diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index 7a864a4618..a35c3980d5 100755 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -1,19 +1,492 @@ p_master = &$p_master; + } + + function main($id, $mode) + { + global $auth, $db, $user, $template; + global $config, $phpbb_root_path, $phpEx, $SID, $action; + + include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + + $forum_id = request_var('f', 0); + $start = request_var('start', 0); + + switch ($action) + { + case 'close': + case 'delete': + include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); + + $post_id_list = request_var('post_id_list', array(0)); + + if (!sizeof($post_id_list)) + { + trigger_error('NO_POST_SELECTED'); + } + + close_report($post_id_list, $mode, $action); + + break; + } + + switch ($mode) + { + case 'report_details': + + $user->add_lang('posting'); + + $post_id = request_var('p', 0); + + $post_info = get_post_data(array($post_id), 'm_approve'); + + if (!sizeof($post_info)) + { + trigger_error('NO_POST_SELECTED'); + } + + $post_info = $post_info[$post_id]; + + $sql = 'SELECT r.user_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username + FROM ' . REPORTS_TABLE . ' r, ' . REASONS_TABLE . ' rr, ' . USERS_TABLE . " u + WHERE r.post_id = $post_id + AND rr.reason_id = r.reason_id + AND r.user_id = u.user_id"; + $result = $db->sql_query($sql); + + if (!($report = $db->sql_fetchrow($result))) + { + trigger_error('NO_POST_REPORT'); + } + + $db->sql_freeresult($result); + + $reason = array('title' => $report['reason_title'], 'description' => $report['reason_description']); + if (isset($user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])])) + { + $reason['description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])]; + $reason['title'] = $user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])]; + } + + if (topic_review($post_info['topic_id'], $post_info['forum_id'], 'topic_review', 0, false)) + { + $template->assign_vars(array( + 'S_TOPIC_REVIEW' => true, + 'TOPIC_TITLE' => $post_info['topic_title']) + ); + } + + // Set some vars + $poster = ($post_info['user_colour']) ? '' . $post_info['username'] . '' : $post_info['username']; + + // Process message, leave it uncensored + $message = $post_info['post_text']; + if ($post_info['bbcode_bitfield']) + { + include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); + $bbcode = new bbcode($post_info['bbcode_bitfield']); + $bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']); + } + $message = smiley_text($message); + + $template->assign_vars(array( + 'S_MCP_REPORT' => true, + 'S_CLOSE_ACTION' => "{$phpbb_root_path}mcp.$phpEx$SID&i=reports&p=$post_id&f=$forum_id", + 'S_CAN_VIEWIP' => $auth->acl_get('m_ip', $post_info['forum_id']), + 'S_POST_REPORTED' => $post_info['post_reported'], + 'S_POST_UNAPPROVED' => !$post_info['post_approved'], + 'S_POST_LOCKED' => $post_info['post_edit_locked'], + 'S_USER_NOTES' => $auth->acl_gets('m_', 'a_') ? true : false, + + 'U_VIEW_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $post_info['user_id'], + 'U_MCP_USER_NOTES' => "{$phpbb_root_path}mcp.$phpEx$SID&i=notes&mode=user_notes&u=" . $post_info['user_id'], + 'U_MCP_WARN_USER' => "{$phpbb_root_path}mcp.$phpEx$SID&i=warn&mode=warn_user&u=" . $post_info['user_id'], + 'U_VIEW_REPORTER_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $report['user_id'], + 'U_MCP_REPORTER_NOTES' => "{$phpbb_root_path}mcp.$phpEx$SID&i=notes&mode=user_notes&u=" . $report['user_id'], + 'U_MCP_WARN_REPORTER' => "{$phpbb_root_path}mcp.$phpEx$SID&i=warn&mode=warn_user&u=" . $report['user_id'], + 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? "{$phpbb_root_path}posting.$phpEx$SID&mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}" : '', + + 'EDIT_IMG' => $user->img('btn_edit', $user->lang['EDIT_POST']), + + 'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], "", ''), + 'REPORTED_IMG' => $user->img('icon_reported', $user->lang['POST_REPORTED']), + 'REPORT_REASON_TITLE' => $reason['title'], + 'REPORT_REASON_DESCRIPTION' => $reason['description'], + 'REPORTER_NAME' => ($report['user_id'] == ANONYMOUS) ? $user->lang['GUEST'] : $report['username'], + 'REPORT_DATE' => $user->format_date($report['report_time']), + 'REPORT_TEXT' => $report['report_text'], + + 'UNAPPROVED_IMG' => $user->img('icon_unapproved', $user->lang['POST_UNAPPROVED']), + + 'POSTER_NAME' => $poster, + 'POST_PREVIEW' => $message, + 'POST_SUBJECT' => $post_info['post_subject'], + 'POST_DATE' => $user->format_date($post_info['post_time']), + 'POST_IP' => $post_info['poster_ip'], + 'POST_IPADDR' => @gethostbyaddr($post_info['poster_ip']), + 'POST_ID' => $post_info['post_id']) + ); + + $this->tpl_name = 'mcp_post'; + + break; + + case 'reports': + case 'reports_closed': + $topic_id = request_var('t', 0); + + $forum_info = array(); + $forum_list_reports = get_forum_list('m_report', false, true); /** @todo m_reports? **/ + + if ($topic_id) + { + $topic_info = get_topic_data(array($topic_id)); + + if (!sizeof($topic_info)) + { + trigger_error($user->lang['TOPIC_NOT_EXIST']); + } + + $topic_info = $topic_info[$topic_id]; + $forum_id = $topic_info['forum_id']; + } + + if (!$forum_id) + { + $forum_list = array(); + foreach ($forum_list_reports as $row) + { + $forum_list[] = $row['forum_id']; + } + + if (!$forum_list = implode(', ', $forum_list)) + { + trigger_error('NOT_MODERATOR'); + } + + $sql = 'SELECT SUM(forum_topics) as sum_forum_topics + FROM ' . FORUMS_TABLE . " + WHERE forum_id IN ($forum_list)"; + $result = $db->sql_query($sql); + $forum_info['forum_topics'] = (int) $db->sql_fetchfield('sum_forum_topics', 0, $result); + $db->sql_freeresult($result); + + } + else + { + $forum_info = get_forum_data(array($forum_id), 'm_report'); + + if (!sizeof($forum_info)) + { + trigger_error('NOT_MODERATOR'); + } + + $forum_info = $forum_info[$forum_id]; + $forum_list = $forum_id; + } + + $forum_options = ''; + foreach ($forum_list_reports as $row) + { + $forum_options .= ''; + } + + mcp_sorting('reports', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id); + $forum_topics = ($total == -1) ? $forum_info['forum_topics'] : $total; + $limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : ''; + + if ($mode == 'reports') + { + $report_state = 'AND p.post_reported = 1'; + } + else + { + $report_state = 'AND p.post_reported = 0 AND r.report_closed = 1'; + } + + $sql = 'SELECT p.post_id + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . REPORTS_TABLE . ' r ' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . (($sort_order_sql[0] == 'r') ? ', ' . USERS_TABLE . ' ru' : '') . " + WHERE p.forum_id IN ($forum_list) + $report_state + AND r.post_id = p.post_id + " . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . " + " . (($sort_order_sql[0] == 'r') ? 'AND ru.user_id = p.poster_id' : '') . " + " . (($topic_id) ? "AND p.topic_id = $topic_id" : '') . " + AND t.topic_id = p.topic_id + ORDER BY $sort_order_sql"; + $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); + + $i = 0; + $post_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $post_ids[] = $row['post_id']; + $row_num[$row['post_id']] = $i++; + } + + if (sizeof($post_ids)) + { + $sql = 'SELECT f.forum_id, f.forum_name, t.topic_id, t.topic_title, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, u.username, r.user_id as reporter_id, ru.username as reporter_name, r.report_time + FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t, ' . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u, ' . USERS_TABLE . " ru + WHERE p.post_id IN (" . implode(', ', $post_ids) . ") + AND t.topic_id = p.topic_id + AND r.post_id = p.post_id + AND f.forum_id = p.forum_id + AND u.user_id = p.poster_id + AND ru.user_id = r.user_id"; + + $result = $db->sql_query($sql); + $post_data = $rowset = array(); + while ($row = $db->sql_fetchrow($result)) + { + $post_data[$row['post_id']] = $row; + } + $db->sql_freeresult($result); + + foreach ($post_ids as $post_id) + { + $row = $post_data[$post_id]; + + if ($row['poster_id'] == ANONYMOUS) + { + $poster = (!empty($row['post_username'])) ? $row['post_username'] : $user->lang['GUEST']; + } + else + { + $poster = $row['username']; + } + + $s_checkbox = ''; + + $template->assign_block_vars('postrow', array( + 'U_VIEWFORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $row['forum_id'], + 'U_VIEWTOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $row['forum_id'] . '&p=' . $row['post_id'] . '#p' . $row['post_id'], + 'U_VIEW_DETAILS' => "{$phpbb_root_path}mcp.$phpEx$SID&i=reports&start=$start&mode=report_details&f={$forum_id}&p={$row['post_id']}", + 'U_VIEW_POSTER_PROFILE' => ($row['poster_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['poster_id']}" : '', + 'U_VIEW_REPORTER_PROFILE' => ($row['reporter_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['reporter_id']}" : '', + + 'S_CHECKBOX' => $s_checkbox, + 'S_CLOSED' => ($mode == 'reports_closed') ? true : false, + + 'FORUM_NAME' => $row['forum_name'], + 'POSTER' => $poster, + 'POST_SUBJECT' => $row['post_subject'], + 'POST_TIME' => $user->format_date($row['post_time']), + 'REPORTER' => ($row['reporter_id'] == ANONYMOUS) ? $user->lang['GUEST'] : $row['reporter_name'], + 'REPORT_TIME' => $user->format_date($row['report_time']), + 'TOPIC_TITLE' => $row['topic_title']) + ); + } + unset($post_data, $post_ids, $row); + } + + // Now display the page + $template->assign_vars(array( + 'L_DISPLAY_ITEMS' => $user->lang['DISPLAY_POSTS'], + 'S_MCP_ACTION' => "{$phpbb_root_path}mcp.$phpEx$SID&i=$id&mode=$mode&t=0", + 'S_FORUM_OPTIONS' => $forum_options) + ); + + $this->tpl_name = 'mcp_reports'; + break; + } + } +} + +/** +* Closes a report +*/ +function close_report($post_id_list, $mode, $action) +{ + global $db, $template, $user, $config; + global $phpEx, $phpbb_root_path, $SID; + + if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_report'))) + { + trigger_error('NOT_AUTHORIZED'); + } + + $redirect = request_var('redirect', $user->data['session_page']); + $success_msg = ''; + + $s_hidden_fields = build_hidden_fields(array( + 'i' => 'reports', + 'mode' => $mode, + 'post_id_list' => $post_id_list, + 'f' => $forum_id, + 'action' => $action, + 'redirect' => $redirect) + ); + + if (confirm_box(true)) + { + $post_info = get_post_data($post_id_list, 'm_report'); + + $sql = 'SELECT r.post_id, r.report_closed, r.user_id, r.user_notify, u.username, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type + FROM ' . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u + WHERE r.post_id IN (' . implode(',', array_keys($post_info)) . ') + ' . (($action == 'close') ? 'AND r.report_closed = 0' : '') . ' + AND r.user_id = u.user_id'; + $result = $db->sql_query($sql); + + $reports = array(); + while ($report = $db->sql_fetchrow($result)) + { + $reports[$report['post_id']] = $report; + } + + $db->sql_freeresult($result); + + $close_report_posts = array(); + $close_report_topics = array(); + $notify_reporters = array(); + foreach ($post_info as $post_id => $post_data) + { + if (isset($reports[$post_id])) + { + $close_report_posts[] = $post_id; + $close_report_topics[] = $post_data['topic_id']; + + if ($reports[$post_id]['user_notify'] && !$reports[$post_id]['report_closed']) + { + $notify_reporters[$post_id] = $reports[$post_id]; + } + } + } + + if (sizeof($close_report_posts)) + { + $close_report_topics = array_unique($close_report_topics); + + // Get a list of topics that still contain reported posts + $sql = 'SELECT DISTINCT t.topic_id + FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p + WHERE t.topic_id IN (' . implode(', ', $close_report_topics) . ') + AND p.post_reported = 1 + AND p.post_id NOT IN (' . implode(', ', $close_report_posts) . ') + AND t.topic_id = p.topic_id'; + $result = $db->sql_query($sql); + + $keep_report_topics = array(); + while ($row = $db->sql_fetchrow($result)) + { + $keep_report_topics[] = $row['topic_id']; + } + + $close_report_topics = array_diff($close_report_topics, $keep_report_topics); + unset($keep_report_topics); + + $db->sql_transaction('begin'); + + if ($action == 'close') + { + $sql = 'UPDATE ' . REPORTS_TABLE . ' + SET report_closed = 1 + WHERE post_id IN (' . implode(', ', $close_report_posts) . ')'; + } + else + { + $sql = 'DELETE FROM ' . REPORTS_TABLE . ' + WHERE post_id IN (' . implode(', ', $close_report_posts) . ')'; + } + $db->sql_query($sql); + + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET post_reported = 0 + WHERE post_id IN (' . implode(', ', $close_report_posts) . ')'; + $db->sql_query($sql); + + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_reported = 0 + WHERE topic_id IN (' . implode(', ', $close_report_topics) . ')'; + $db->sql_query($sql); + + $db->sql_transaction('commit'); + } + unset($close_report_posts, $close_report_topics); + + $messenger = new messenger(); + + // Notify reporters + if (sizeof($notify_reporters)) + { + $email_sig = str_replace('
', "\n", "-- \n" . $config['board_email_sig']); + + foreach ($notify_reporters as $post_id => $reporter) + { + if ($reporter['user_id'] == ANONYMOUS) + { + continue; + } + + $messenger->template('report_' . $action . 'd', $reporter['user_lang']); + + $messenger->replyto($config['board_email']); + $messenger->to($reporter['user_email'], $reporter['username']); + $messenger->im($reporter['user_jabber'], $reporter['username']); + + $messenger->assign_vars(array( + 'EMAIL_SIG' => $email_sig, + 'SITENAME' => $config['sitename'], + 'USERNAME' => $reporter['username'], + 'CLOSER_NAME' => $user->data['username'], + 'POST_SUBJECT' => censor_text($post_info[$post_id]['post_subject']), + 'TOPIC_TITLE' => censor_text($post_info[$post_id]['topic_title'])) + ); + + $messenger->send($reporter['user_notify_type']); + $messenger->reset(); + } + + $messenger->save_queue(); + } + unset($notify_reporters, $post_info); + + $success_msg = (sizeof($post_id_list) == 1) ? 'REPORT_' . strtoupper($action) . 'D_SUCCESS' : 'REPORTS_' . strtoupper($action) . 'D_SUCCESS'; + } + else + { + confirm_box(false, $user->lang[strtoupper($action) . '_REPORT' . ((sizeof($post_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields); + } + + $redirect = request_var('redirect', "index.$phpEx$SID"); + + if (strpos($redirect, '?') === false) + { + $redirect = substr_replace($redirect, ".$phpEx$SID&", strpos($redirect, '&'), 1); + } + + if (!$success_msg) + { + redirect($redirect); + } + else + { + meta_refresh(3, "viewforum.$phpEx$SID&f=$forum_id"); + trigger_error($user->lang[$success_msg] . '

' . sprintf($user->lang['RETURN_FORUM'], "', '')); + } +} /** * @package module_install @@ -27,12 +500,9 @@ class mcp_reports_info 'title' => 'MCP_REPORTS', 'version' => '1.0.0', 'modes' => array( - 'front' => array('title' => 'MCP_REPORTS_FRONT', 'auth' => 'acl_m_'), - 'reports_yours' => array('title' => 'MCP_REPORTS_YOURS', 'auth' => 'acl_m_'), - 'reports_new' => array('title' => 'MCP_REPORTS_NEW', 'auth' => 'acl_m_'), - 'reports_topics' => array('title' => 'MCP_REPORTS_TOPICS', 'auth' => 'acl_m_'), - 'reports_view_topic' => array('title' => 'MCP_REPORTS_VIEW_TOPIC', 'auth' => 'acl_m_'), - 'reports_view' => array('title' => 'MCP_REPORTS_VIEW', 'auth' => 'acl_m_') + 'report_details' => array('title' => 'MCP_REPORT_DETAILS', 'auth' => 'acl_m_report || aclf_m_report'), + 'reports' => array('title' => 'MCP_REPORTS', 'auth' => 'acl_m_report ||aclf_m_report'), + 'reports_closed' => array('title' => 'MCP_REPORTS_CLOSED', 'auth' => 'acl_m_report || aclf_m_report'), ), ); } @@ -46,546 +516,4 @@ class mcp_reports_info } } - -/** -* @package mcp -* mcp_report -* Handle reports about users or posts sent in by users -*/ -class mcp_reports -{ - - var $p_master; - - function mcp_main(&$p_master) - { - $this->p_master = &$p_master; - } - - function main($id, $mode) - { - global $auth, $db, $user, $template; - global $config, $phpbb_root_path, $phpEx, $SID; - - $action = request_var('action', array('' => '')); - - switch ($mode) - { - case 'reports_yours': - $this->mcp_reports_list($id, $mode); - break; - case 'reports_new': - $this->mcp_reports_list($id, $mode); - break; - case 'reports_topics': - $this->mcp_reports_list($id, $mode); - break; - case 'reports_view_topic': - // View reports for one topic - $this->mcp_reports_list($id, $mode); - //$this->tpl_name = 'mcp_report_topic'; - break; - case 'reports_view': - // View one report (not attached to a topic) - $this->mcp_report_view($id, $mode); - break; - default: - // Main page with an overview - $this->mcp_reports_list($id, $mode); - break; - } - } - - // Overview of available reports - function mcp_reports_list($id, $mode) - { - global $auth, $db, $user, $template; - global $config, $phpbb_root_path, $phpEx, $SID; - - $forum_id = request_var('f', 0); - $topic_id = request_var('t', 0); - $start = request_var('start', 0); - - // Show report details for a specific topic if a topic has been selected. - if($topic_id != 0) - { - return $this->mcp_report_view('topic', $topic_id); - } - - $forum_info = array(); - - $forum_list_report = get_forum_list('m_', false, true); - - // Show all reports that this user is allowed to view or only the - // reports in one specific forum? - if ($mode == 'overview' || !$forum_id) - { - $forum_list = array(); - foreach ($forum_list_report as $row) - { - $forum_list[] = $row['forum_id']; - } - - if (!$forum_list = implode(', ', $forum_list)) - { - trigger_error('NOT_MODERATOR'); - } - - $sql = 'SELECT SUM(forum_topics) as sum_forum_topics - FROM ' . FORUMS_TABLE . " - WHERE forum_id IN ($forum_list)"; - $result = $db->sql_query($sql); - $forum_info['forum_topics'] = (int) $db->sql_fetchfield('sum_forum_topics', 0, $result); - $db->sql_freeresult($result); - } - else - { - $forum_info = get_forum_data(array($forum_id), 'm_approve'); - - if (!sizeof($forum_info)) - { - trigger_error('NOT_MODERATOR'); - } - - $forum_info = $forum_info[$forum_id]; - $forum_list = $forum_id; - } - - $forum_options = ''; - foreach ($forum_list_report as $row) - { - $forum_options .= ''; - } - - // Note: this query needs to be made compatible with non-MySQL DBMs - mcp_sorting('reports', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id); - $forum_topics = ($total == -1) ? $forum_info['forum_topics'] : $total; - $limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : ''; - $sql = 'SELECT count(*) as report_count, r.*, p.post_id, p.post_subject, u.username, t.topic_id, t.topic_title, f.forum_id, f.forum_name - FROM ' . REPORTS_TABLE . ' r, ' . REASONS_TABLE . ' rr,' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u - LEFT JOIN ' . FORUMS_TABLE . ' f ON f.forum_id = p.forum_id - WHERE - r.report_status = 0 - AND r.post_id = p.post_id - AND r.reason_id = rr.reason_id - AND p.topic_id = t.topic_id - AND r.user_id = u.user_id - AND t.topic_reported = 1 - AND p.forum_id IN (' . (is_array($forum_list) ? implode(', ', $forum_list) : $forum_list) . ") - GROUP BY topic_id - ORDER BY $sort_order_sql"; - $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); - - while ($row = $db->sql_fetchrow($result)) - { - if ($row['poster_id'] == ANONYMOUS) - { - $poster = (!empty($row['post_username'])) ? $row['post_username'] : $user->lang['GUEST']; - } - else - { - $poster = $row['username']; - } - - $s_checkbox = ''; - $template->assign_block_vars('report', array( - 'U_FORUM' => "mcp.$phpEx$SID&i=report&mode=&f={$row['forum_id']}", - // Q: Why accessing the topic by a post_id instead of its topic_id? - // A: To prevent the post from being hidden because of wrong encoding or different charset - 'U_REPORT_TOPIC' => "mcp.$phpEx$SID&i=report&mode=report_view_topic&t={$row['topic_id']}", - 'U_VIEW_DETAILS'=> "mcp.$phpEx$SID&i=queue&start=$start&mode=approve_details&f={$forum_id}&p={$row['post_id']}", - 'U_VIEWPROFILE' => ($row['poster_id'] != ANONYMOUS) ? "memberlist.$phpEx$SID&mode=viewprofile&u={$row['poster_id']}" : '', - - 'REPORT_COUNT' => $row['report_count'], - 'FORUM_NAME' => $row['forum_name'], - 'TOPIC_TITLE' => $row['topic_title'], - 'POSTER' => $poster, - 'REPORT_TIME' => $user->format_date($row['report_time']), - 'S_CHECKBOX' => $s_checkbox) - ); - } - $db->sql_freeresult($result); - - // Now display the page - $template->assign_vars(array( - 'L_DISPLAY_ITEMS' => ($mode == 'unapproved_posts') ? $user->lang['DISPLAY_POSTS'] : $user->lang['DISPLAY_TOPICS'], - 'S_FORUM_OPTIONS' => $forum_options) - ); - $this->tpl_name = 'mcp_reports_front'; - } - - // View the reports for one topic or view one topic. - function mcp_report_view($id, $mode) - { - global $phpbb_root_path, $config, $db, $phpEx; - global $user, $template, $auth; - - //$this->tpl_name = 'mcp_reports'; - if(!isset($_POST['feedback_submit'])) - { - // Show the reports. - $topic_id = request_var('t', 0); - if ($topic_id == 0) - { - trigger_error('NO_TOPIC_SELECTED'); - } - - $topic_info = get_topic_data($topic_id, 'm_'); - $topic_info = $topic_info[$topic_id]; - - $sql = "SELECT - r.report_id, r.report_time, r.report_text, r.report_status, - r.bbcode_uid as r_bbcode_uid, r.bbcode_bitfield as r_bbcode_bitfield, - rre.reply_id, rre.reply_text, ure_from.username as reply_from_username, - ure_to.username as reply_to_username, - p.post_id, p.topic_id, p.forum_id, p.post_time, p.post_subject, p.post_text, - p.bbcode_uid as p_bbcode_uid, p.bbcode_bitfield as p_bbcode_bitfield, - u1.user_id as reporter_user_id, u1.username as reporter_username, - u2.user_id as poster_user_id, u2.username as poster_username - FROM " . - REPORTS_TABLE . " r - LEFT JOIN " . REPORTS_REPLIES_TABLE . " rre USING (report_id) - LEFT JOIN " . USERS_TABLE . " ure_from ON (rre.from_user_id = ure_from.user_id) - LEFT JOIN " . USERS_TABLE . " ure_to ON (rre.to_user_id = ure_to.user_id), " . - POSTS_TABLE . " p, " . - USERS_TABLE . " u1, " . - USERS_TABLE . " u2 - WHERE - r.user_id = u1.user_id - AND r.post_id = p.post_id - AND p.poster_id = u2.user_id - AND p.topic_id = $topic_id - ORDER BY post_id DESC, report_id DESC, reply_id ASC"; - $result = $db->sql_query($sql); - - include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); - $old_post_id = 0; - $old_report_id = 0; - while ($row = $db->sql_fetchrow($result)) - { - if($old_report_id != $row['report_id']) - { - if($old_post_id != $row['post_id']) - { - // Process message, leave it uncensored - $message = $row['post_text']; - if ($row['p_bbcode_bitfield']) - { - $bbcode = new bbcode($row['p_bbcode_bitfield']); - $bbcode->bbcode_second_pass($message, $row['p_bbcode_uid'], $row['p_bbcode_bitfield']); - } - $message = smiley_text($message); - - $template->assign_block_vars('postrow', array( - 'POST_ID' => $row['post_id'], - 'POST_SUBJECT' => $row['post_subject'], - 'POSTER_USER_ID' => $row['poster_user_id'], - 'POSTER_NAME' => $row['poster_username'], - 'U_POSTER_PROFILE' => ($row['poster_id'] != ANONYMOUS) ? "memberlist.$phpEx$SID&mode=viewprofile&u={$row['poster_id']}" : '', - 'POST_DATE' => $user->format_date($row['post_time']), - 'POST_PREVIEW' => $message, - 'U_APPROVE_ACTION' => "{$phpbb_root_path}mcp.$phpEx$SID&i=report&mode=topic", - 'U_EDIT' => ($auth->acl_get('m_edit', $row['forum_id'])) ? "{$phpbb_root_path}posting.$phpEx$SID&mode=edit&f={$row['forum_id']}&p={$row['post_id']}" : '', - 'U_VIEW' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f={$row['forum_id']}&p={$row['post_id']}#{$row['post_id']}" - ) - ); - } // Start post row. - $old_post_id = $row['post_id']; - - // Process message, leave it uncensored - $message = $row['report_text']; - if ($row['r_bbcode_bitfield']) - { - $bbcode = new bbcode($row['r_bbcode_bitfield']); - $bbcode->bbcode_second_pass($message, $row['r_bbcode_uid'], $row['r_bbcode_bitfield']); - } - $message = smiley_text($message); - - $template->assign_block_vars('postrow.reportrow', array( - 'REPORT_ID' => $row['report_id'], - 'REPORT_TIME' => $user->format_date($row['report_time']), - 'REPORT_TEXT' => $message, - 'REPORT_STATUS' => $row['report_status'], - 'U_REPORTERPROFILE' => ($row['poster_id'] != ANONYMOUS) ? "memberlist.$phpEx$SID&mode=viewprofile&u={$row['reporter_user_id']}" : '', - 'REPORTER_USER_ID' => $row['reporter_user_id'], - 'REPORTER_USERNAME' => $row['reporter_username'], - 'POSTER_USER_ID' => $row['poster_user_id'], - 'POSTER_USERNAME' => $row['poster_username'], - ) - ); - } - $old_report_id = $row['report_id']; - - if($row['reply_text'] != '') - { - $template->assign_block_vars('postrow.reportrow.replyrow', array( - 'REPLY_ID' => $row['reply_id'], - 'REPLY_FROMUSERNAME' => $row['reply_from_username'], - 'REPLY_TOUSERNAME' => $row['reply_to_username'], - 'REPLY_TEXT' => $row['reply_text'] - )); - } - - } - $db->sql_freeresult($result); - - // Set some vars - $poster = ($post_info['user_colour']) ? '' . $post_info['username'] . '' : $post_info['username']; - - $template->assign_vars(array( - 'TOPIC_TITLE' => $topic_info['topic_title'], - 'U_TOPIC' => "viewtopic.$phpEx$SID&t={$topic_info['topic_id']}", - 'U_FEEDBACK_ACTION' => $_SERVER['REQUEST_URI'] - ) - ); - - $this->tpl_name = 'mcp_reports_topic'; - //$this->display($user->lang['MCP_QUEUE'], 'mcp_topicreports.html'); - } // No submit - else - { - // Send feedback and close selected reports - $selected_reports = request_var('sendfeedback', array('0'=>'0')); - $report_close = request_var('feedback_close', ''); - $report_feedback = request_var('feedback_text', ''); - - $post_ids = array(); - foreach($selected_reports as $key => $value) - { - $report_ids[] = $value; - } - - if(count($report_ids) == 0) - { - // TODO: i18n - trigger_error('No reports selected.'); - } - - $sql = "SELECT - r.report_id, r.user_id, r.reason_id, r.post_id, r.report_text, - u.username, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type, u.user_options, - rr.reason_name, rr.reason_description, - p.post_id, p.post_subject, - t.topic_title, t.forum_id - FROM " . REPORTS_TABLE . " r, " . - REASONS_TABLE . " rr, " . - USERS_TABLE . " u, " . - POSTS_TABLE . " p, " . - TOPICS_TABLE . " t - WHERE - r.reason_id = rr.reason_id - AND r.user_id = u.user_id - AND r.post_id = p.post_id - AND p.topic_id = t.topic_id - AND report_id IN (" . implode(', ', $report_ids) . ")"; - $result = $db->sql_query($sql); - - while($row = $db->sql_fetchrow($result)) - { - $feedback_data[$row['user_id']] = array( - 'name' => $row['username'], - 'email' => $row['user_email'], - 'jabber'=> $row['user_jabber'], - 'lang' => $row['user_lang'], - 'notify_type' => $row['user_notify_type'], - 'pm' => $user->optionget('report_pm_notify', $row['user_options']), - 'report_id' => $row['report_id'], - 'reporter' => $row['username'], - 'moderator' => $user->data['username'], - 'moderator_id' => $user->data['user_id'], - 'reason' => $row['reason_desc'], - 'report_feedback' => $report_feedback, - 'text' => $row['report_text'], - 'subject' => $row['topic_title'], - 'view_post' => "viewtopic.$phpEx?f={$row['forum_id']}&t={$row['topic_id']}&p={$row['post_id']}&#{$row['post_id']}" - - ); - - $reported_posts[$row['post_id']]++; - - } - - // Only send feedback if there is feedback to send - if($report_feedback != '') - { - $this->report_feedback($feedback_data); - } - - // See if we need to close the report, update notifications in viewforum/topic - - // Start transaction - $db->sql_transaction('begin'); - - if ($report_close) - { - // Close the reports - $sql = 'UPDATE ' . REPORTS_TABLE . ' - SET report_status = ' . REPORT_CLOSED . ' - WHERE report_id IN (' . implode(', ', $report_ids) . ')'; - $db->sql_query($sql); - } - - // TODO: Should we remove the notification in viewforum/topic after feedback has been added to a report? Or should we introduce a 'report in progress' icon for viewforum/topic? - // Figure out what posts are without open reports after this update. - $sql = 'SELECT r.post_id, p.topic_id, sum(IF(report_status=1, 0, 1)) as open_reports - FROM ' . REPORTS_TABLE . ' r - LEFT JOIN ' . POSTS_TABLE . ' p USING (post_id) - WHERE r.post_id IN (' . implode(', ', array_keys($reported_posts)) . ') - GROUP BY r.post_id - HAVING open_reports = 0'; - $result = $db->sql_query($sql); - while($row = $db->sql_fetchrow($result)) - { - $resolved_posts[] = $row['post_id']; - $resolved_topics[] = $row['topic_id']; - } - - // Mark those posts as resolved - if(!empty($resolved_posts)) - { - $sql = 'UPDATE ' . POSTS_TABLE . ' SET - post_reported = 0 - WHERE post_id IN (' . implode(', ', $resolved_posts) . ')'; - $db->sql_query($sql); - - // Mark topic as resolved because a moderator has taken a look at it. - $sql = 'UPDATE ' . TOPICS_TABLE . ' SET - topic_reported = 0 - WHERE topic_id IN (' . implode(', ', $resolved_topics) . ')'; - $db->sql_query($sql); - } - - // End transaction - $db->sql_transaction('commit'); - - // Say something nice to the moderator - trigger_error('These reports have been closed. Thank you :)
return'); - - - } // The form was submitted - } - - // ---------------------------------------------------------------------------- - - // Reply to reports and notify reporters of this event. - function report_feedback($data) - { - global $config, $phpbb_root_path, $phpEx; - global $user, $db; - - - foreach ($data as $user_id => $reply_row) - { - // TODO: Include a subject? - $sql_data = array( - 'report_id' => $reply_row['report_id'], - 'reply_time' => time(), - 'reply_text' => $reply_row['report_feedback'], - 'from_user_id' => $reply_row['moderator_id'], - 'to_user_id' => $user_id - ); - $db->sql_query('INSERT INTO ' . REPORTS_REPLIES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_data)); - } - - // Notify the recipient of this reply - include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); - include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); - $messenger = new messenger(); - - $email_sig = str_replace('
', "\n", "-- \n" . $config['board_email_sig']); - $email_template = 'report_feedback'; - - foreach ($data as $user_id => $notify_row) - { - // Send notification by email - if (!$notify_row['pm']) - { - $messenger->to($notify_row['email'], $notify_row['name']); - $messenger->im($notify_row['jabber'], $notify_row['name']); - $messenger->replyto($config['board_email']); - - $messenger->template($email_template, $notify_row['lang']); - - $messenger->assign_vars(array( - 'EMAIL_SIG' => $email_sig, - 'SITENAME' => $config['sitename'], - 'USERNAME' => $notify_row['name'], - 'SUBJECT' => $notify_row['subject'], - 'REPORTER' => $notify_row['reporter'], - 'MODERATOR' => $notify_row['moderator'], - - 'REPORT_REASON' => $notify_row['reason'], - 'REPORT_TEXT' => $notify_row['text'], - 'REPORT_FEEDBACK' => $notify_row['report_feedback'], - - 'U_VIEW_POST' => generate_board_url() . '/' . $notify_row['view_post']) - ); - - $messenger->send($notify_row['notify_type']); - $messenger->reset(); - //print "mail to " . $notify_row['email'] . "({$notify_row['notify_type']})"; - - if ($messenger->queue) - { - $messenger->queue->save(); - } - } - else - { - // Use messenger for getting the correct message, we use the email template - $messenger->template($email_template, $notify_row['lang']); - - $messenger->assign_vars(array( - 'EMAIL_SIG' => $email_sig, - 'SITENAME' => $config['sitename'], - 'USERNAME' => $notify_row['name'], - 'SUBJECT' => $notify_row['subject'], - 'REPORTER' => $notify_row['reporter'], - 'MODERATOR' => $notify_row['moderator'], - - 'REPORT_REASON' => $notify_row['reason'], - 'REPORT_TEXT' => $notify_row['text'], - 'REPORT_FEEDBACK' => $notify_row['report_feedback'], - - 'U_VIEW_POST' => generate_board_url() . '/' . $notify_row['view_post']) - ); - - // Parse message, don't send it. - $messenger->send(false, true); - - // do not put in moderators outbox - $pm_data = array( - 'address_list' => array('u' => array($user_id => 'to')), - 'from_user_id' => $user->data['user_id'], - 'from_user_ip' => $user->data['user_ip'], - 'from_username' => $user->data['username'], - 'icon_id' => 0, - 'enable_bbcode' => 0, - 'enable_html' => 0, - 'enable_smilies' => 0, - 'enable_urls' => 1, - 'enable_sig' => 0, - 'message_md5' => md5($messenger->msg), - 'bbcode_bitfield' => 0, - 'bbcode_uid' => 0, - 'attachment_data' => array(), - 'filename_data' => array(), - 'message' => $messenger->msg - ); - - //function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox) - submit_pm('post', $notify_row['subject'], $pm_data, true, false); - - // Break the sending process... - $messenger->reset(); - - //print "PM to " . $notify_row['name']; - } - - // Add the feedback to the report - $message = $notify_row['report_feedback']; - } - unset($messenger); - } -} ?> \ No newline at end of file diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 5e7116a6c0..8ba14ffe6b 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -255,6 +255,7 @@ INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_inf INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_lock', 1, 1); INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_merge', 1, 1); INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_move', 1, 1); +INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_report', 1, 1); INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_split', 1, 1); INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_warn', 1, 1); @@ -601,34 +602,32 @@ INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_nam INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (207, 1, 1, 'database', 'acp', 64, 445, 446, 'ACP_RESTORE', 'restore', 'acl_a_server'); # MCP -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (124, 1, '', 'mcp', 1, 0, 57, 66, 'MCP_MAIN', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (125, 1, '', 'mcp', 1, 0, 67, 72, 'MCP_NOTES', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (126, 1, '', 'mcp', 1, 0, 73, 80, 'MCP_QUEUE', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (127, 1, '', 'mcp', 1, 0, 81, 90, 'MCP_WARN', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (128, 1, 'main', 'mcp', 1, 124, 58, 59, 'MCP_MAIN_FRONT', 'front', 'acl_m_'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (129, 1, 'main', 'mcp', 1, 124, 60, 61, 'MCP_MAIN_FORUM_VIEW', 'forum_view', 'acl_m_,$id'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (130, 1, 'main', 'mcp', 1, 124, 62, 63, 'MCP_MAIN_TOPIC_VIEW', 'topic_view', 'acl_m_,$id'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (131, 1, 'main', 'mcp', 1, 124, 64, 65, 'MCP_MAIN_POST_DETAILS', 'post_details', 'acl_m_,$id'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (132, 1, 'notes', 'mcp', 1, 125, 68, 69, 'MCP_NOTES_FRONT', 'front', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (133, 1, 'notes', 'mcp', 1, 125, 70, 71, 'MCP_NOTES_USER', 'user_notes', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (134, 1, 'queue', 'mcp', 1, 126, 74, 75, 'MCP_QUEUE_UNAPPROVED_TOPICS', 'unapproved_topics', 'acl_m_approve'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (135, 1, 'queue', 'mcp', 1, 126, 76, 77, 'MCP_QUEUE_UNAPPROVED_POSTS', 'unapproved_posts', 'acl_m_approve'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (136, 1, 'queue', 'mcp', 1, 126, 78, 79, 'MCP_QUEUE_REPORTS', 'reports', 'acl_m_approve'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (137, 1, 'warn', 'mcp', 1, 127, 82, 83, 'MCP_WARN_FRONT', 'front', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (138, 1, 'warn', 'mcp', 1, 127, 84, 85, 'MCP_WARN_LIST', 'list', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (139, 1, 'warn', 'mcp', 1, 127, 86, 87, 'MCP_WARN_USER', 'warn_user', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (140, 1, 'warn', 'mcp', 1, 127, 88, 89, 'MCP_WARN_POST', 'warn_post', 'acl_m_,$id'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (192, 1, '', 'mcp', 1, 0, 91, 104, 'Reports', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (193, 1, 'reports', 'mcp', 1, 192, 92, 93, 'MCP_REPORTS_FRONT', 'front', 'acl_m_'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (194, 1, 'reports', 'mcp', 1, 192, 94, 95, 'MCP_REPORTS_YOURS', 'reports_yours', 'acl_m_'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (195, 1, 'reports', 'mcp', 1, 192, 96, 97, 'MCP_REPORTS_NEW', 'reports_new', 'acl_m_'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (196, 1, 'reports', 'mcp', 1, 192, 98, 99, 'MCP_REPORTS_TOPICS', 'reports_topics', 'acl_m_'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (197, 1, 'reports', 'mcp', 1, 192, 100, 101, 'MCP_REPORTS_VIEW_TOPIC', 'reports_view_topic', 'acl_m_'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (198, 1, 'reports', 'mcp', 1, 192, 102, 103, 'MCP_REPORTS_VIEW', 'reports_view', 'acl_m_'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (200, 1, '', 'mcp', 1, 0, 105, 112, 'MCP_BAN', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (201, 1, 'ban', 'mcp', 1, 200, 106, 107, 'MCP_BAN_EMAILS', 'email', 'acl_m_ban'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (202, 1, 'ban', 'mcp', 1, 200, 108, 109, 'MCP_BAN_IPS', 'ip', 'acl_m_ban'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (203, 1, 'ban', 'mcp', 1, 200, 110, 111, 'MCP_BAN_USERNAMES', 'user', 'acl_m_ban'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (124, 1, 1, '', 'mcp', 0, 51, 60, 'MCP_MAIN', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (125, 1, 1, '', 'mcp', 0, 61, 66, 'MCP_NOTES', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (126, 1, 1, '', 'mcp', 0, 67, 80, 'MCP_QUEUE', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (127, 1, 1, '', 'mcp', 0, 81, 90, 'MCP_WARN', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (128, 1, 1, 'main', 'mcp', 124, 52, 53, 'MCP_MAIN_FRONT', 'front', 'acl_m_'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (129, 1, 1, 'main', 'mcp', 124, 54, 55, 'MCP_MAIN_FORUM_VIEW', 'forum_view', 'acl_m_,$id'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (130, 1, 1, 'main', 'mcp', 124, 56, 57, 'MCP_MAIN_TOPIC_VIEW', 'topic_view', 'acl_m_,$id'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (131, 1, 1, 'main', 'mcp', 124, 58, 59, 'MCP_MAIN_POST_DETAILS', 'post_details', 'acl_m_,$id'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (132, 1, 1, 'notes', 'mcp', 125, 62, 63, 'MCP_NOTES_FRONT', 'front', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (133, 1, 1, 'notes', 'mcp', 125, 64, 65, 'MCP_NOTES_USER', 'user_notes', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (134, 1, 1, 'queue', 'mcp', 126, 68, 69, 'MCP_QUEUE_UNAPPROVED_TOPICS', 'unapproved_topics', 'acl_m_approve'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (135, 1, 1, 'queue', 'mcp', 126, 70, 71, 'MCP_QUEUE_UNAPPROVED_POSTS', 'unapproved_posts', 'acl_m_approve'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (137, 1, 1, 'warn', 'mcp', 127, 82, 83, 'MCP_WARN_FRONT', 'front', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (138, 1, 1, 'warn', 'mcp', 127, 84, 85, 'MCP_WARN_LIST', 'list', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (139, 1, 1, 'warn', 'mcp', 127, 86, 87, 'MCP_WARN_USER', 'warn_user', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (140, 1, 1, 'warn', 'mcp', 127, 88, 89, 'MCP_WARN_POST', 'warn_post', 'acl_m_,$id'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (192, 1, 1, '', 'mcp', 0, 91, 92, 'Reports', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (213, 1, 1, 'reports', 'mcp', 126, 78, 79, 'MCP_REPORT_DETAILS', 'report_details', 'acl_m_report || aclf_m_report'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (211, 1, 1, 'queue', 'mcp', 126, 76, 77, 'MCP_QUEUE_APPROVE_DETAILS', 'approve_details', 'acl_m_approve || aclf_m_approve'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (210, 1, 1, 'reports', 'mcp', 126, 72, 73, 'MCP_REPORTS', 'reports', 'acl_m_report ||aclf_m_report'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (212, 1, 1, 'reports', 'mcp', 126, 74, 75, 'MCP_REPORTS_CLOSED', 'reports_closed', 'acl_m_report || aclf_m_report'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (200, 1, 1, '', 'mcp', 0, 93, 100, 'MCP_BAN', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (201, 1, 1, 'ban', 'mcp', 200, 94, 95, 'MCP_BAN_EMAILS', 'email', 'acl_m_ban'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (202, 1, 1, 'ban', 'mcp', 200, 96, 97, 'MCP_BAN_IPS', 'ip', 'acl_m_ban'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (203, 1, 1, 'ban', 'mcp', 200, 98, 99, 'MCP_BAN_USERNAMES', 'user', 'acl_m_ban'); + # MSSQL IDENTITY phpbb_modules OFF # diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php index 8ee45f0a74..0a5a3a5994 100644 --- a/phpBB/language/en/acp/permissions_phpbb.php +++ b/phpBB/language/en/acp/permissions_phpbb.php @@ -158,6 +158,7 @@ $lang = array_merge($lang, array( 'acl_m_edit' => array('lang' => 'Can edit posts', 'cat' => 'post_actions'), 'acl_m_delete' => array('lang' => 'Can delete posts', 'cat' => 'post_actions'), 'acl_m_approve' => array('lang' => 'Can approve posts', 'cat' => 'post_actions'), + 'acl_m_report' => array('lang' => 'Can close and delete reports', 'cat' => 'post_actions'), 'acl_m_chgposter' => array('lang' => 'Can change post author', 'cat' => 'post_actions'), 'acl_m_move' => array('lang' => 'Can move topics', 'cat' => 'topic_actions'), diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index f9964558b7..846cbe9625 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -322,7 +322,7 @@ $lang = array_merge($lang, array( 'POST_DETAILS' => 'Post Details', 'POST_NEW_TOPIC' => 'Post new topic', 'POST_PCT' => '%.2f%% of all posts', - 'POST_REPORTED' => 'Click to view reports', + 'POST_REPORTED' => 'Click to view report', 'POST_SUBJECT' => 'Post Subject', 'POST_TIME' => 'Post time', 'POST_UNAPPROVED' => 'Click to approve post', diff --git a/phpBB/language/en/email/report_closed.txt b/phpBB/language/en/email/report_closed.txt new file mode 100644 index 0000000000..7da2026fb3 --- /dev/null +++ b/phpBB/language/en/email/report_closed.txt @@ -0,0 +1,9 @@ +Subject: Report Closed - {POST_SUBJECT} +Charset: iso-8859-1 + +Hello {USERNAME}, + +You are receiving this email because the report you filed on the post "{POST_SUBJECT}" in "{TOPIC_TITLE}" at {SITENAME} was handled by a moderator or by an admin. The report was afterwards closed. If you have further questions contact {CLOSER_NAME} with a personal message. + + +{EMAIL_SIG} \ No newline at end of file diff --git a/phpBB/language/en/email/report_deleted.txt b/phpBB/language/en/email/report_deleted.txt new file mode 100644 index 0000000000..9fed2a590f --- /dev/null +++ b/phpBB/language/en/email/report_deleted.txt @@ -0,0 +1,9 @@ +Subject: Report Closed - {POST_SUBJECT} +Charset: iso-8859-1 + +Hello {USERNAME}, + +You are receiving this email because the report you filed on the post "{POST_SUBJECT}" in "{TOPIC_TITLE}" at {SITENAME} was deleted by a moderator or by an admin. + + +{EMAIL_SIG} \ No newline at end of file diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php index 0a7816ca5f..caa455fdb7 100644 --- a/phpBB/language/en/mcp.php +++ b/phpBB/language/en/mcp.php @@ -35,6 +35,7 @@ $lang = array_merge($lang, array( 'ADD_WARNING' => 'Add warning', 'ADD_WARNING_EXPLAIN' => 'To send a warning to this user please fill out the following form. Only use plain text; HTML, BBCode, etc. are not permitted.', 'ALL_ENTRIES' => 'All entries', + 'ALL_REPORTS' => 'All reports', 'ALREADY_REPORTED' => 'This post has already been reported', 'ALREADY_WARNED' => 'A warning has already been issued for this post', 'APPROVE' => 'Approve', @@ -47,10 +48,18 @@ $lang = array_merge($lang, array( 'CANNOT_WARN_ANONYMOUS' => 'You cannot warn an guest user', 'CAN_LEAVE_BLANK' => 'This can be left blank.', 'CHANGE_POSTER' => 'Change poster', + 'CLOSE_REPORT' => 'Close report', + 'CLOSE_REPORT_CONFIRM' => 'Are you sure you want to close the selected report?', + 'CLOSE_REPORTS' => 'Close reports', + 'CLOSE_REPORTS_CONFIRM' => 'Are you sure you want to close the selected reports?', 'DELETE_POSTS' => 'Delete posts', 'DELETE_POSTS_CONFIRM' => 'Are you sure you want to delete these posts?', 'DELETE_POST_CONFIRM' => 'Are you sure you want to delete this post?', + 'DELETE_REPORT' => 'Delete report', + 'DELETE_REPORT_CONFIRM' => 'Are you sure you want to delete the selected report?', + 'DELETE_REPORTS' => 'Delete reports', + 'DELETE_REPORTS_CONFIRM' => 'Are you sure you want to delete the selected reports?', 'DELETE_TOPICS' => 'Delete selected topics', 'DELETE_TOPICS_CONFIRM' => 'Are you sure you want to delete these topics?', 'DELETE_TOPIC_CONFIRM' => 'Are you sure you want to delete this topic?', @@ -164,20 +173,26 @@ $lang = array_merge($lang, array( 'MCP_NOTES_FRONT' => 'Front Page', 'MCP_NOTES_USER' => 'User Details', - 'MCP_QUEUE' => 'Moderation Queue', - 'MCP_QUEUE_REPORTS' => 'Reports', - 'MCP_QUEUE_APPROVE_DETAILS' => 'Approve details', - 'MCP_QUEUE_UNAPPROVED_POSTS' => 'Posts awaiting for approval', - 'MCP_QUEUE_UNAPPROVED_TOPICS' => 'Topics awaiting for approval', + 'MCP_REPORTS' => 'Open Reports', + 'MCP_REPORT_DETAILS' => 'Report Details', + 'MCP_REPORTS_CLOSED' => 'Closed Reports', + + 'MCP_QUEUE' => 'Moderation Queue', + 'MCP_QUEUE_APPROVE_DETAILS' => 'Approve Details', + 'MCP_QUEUE_UNAPPROVED_POSTS' => 'Posts awaiting approval', + 'MCP_QUEUE_UNAPPROVED_TOPICS' => 'Topics awaiting approval', + 'MCP_VIEW_ALL' => 'View all (%s)', 'MCP_VIEW_LOGS' => 'View logs', 'MCP_VIEW_RECENT' => 'View recent (%s)', 'MCP_VIEW_USER' => 'View warnings for a specific user', + 'MCP_WARN' => 'Warnings', 'MCP_WARN_FRONT' => 'Front Page', 'MCP_WARN_LIST' => 'List warnings', 'MCP_WARN_POST' => 'Warn for specific post', 'MCP_WARN_USER' => 'Warn User', + 'MERGE_POSTS' => 'Merge posts', 'MERGE_POSTS_CONFIRM' => 'Are you sure you want to merge the selected posts?', 'MERGE_TOPIC_EXPLAIN' => 'Using the form below you can merge selected posts into another topic. These posts will not be reordered and will appear as if the users posted them to the new topic.
Please enter the destination topic id or click on the "Select" button to search for one', @@ -197,6 +212,7 @@ $lang = array_merge($lang, array( 'NO_FEEDBACK' => 'No feedback exists for this user', 'NO_FINAL_TOPIC_SELECTED' => 'You have to select a destination topic for merging posts', 'NO_MATCHES_FOUND' => 'No matches found', + 'NO_POST_REPORT' => 'This post was not reported.', 'NO_POST_SELECTED' => 'You must select at least one post to perform this action', 'NO_TOPIC_SELECTED' => 'You must select at least one topic to perform this action', @@ -225,21 +241,30 @@ $lang = array_merge($lang, array( 'READ_USERNOTES' => 'User notes', 'READ_WARNINGS' => 'User warnings', 'REPORTER' => 'Reporter', - 'REPORT_ALREADY_DEALT_WITH' => 'This post has already been reported previously and successfully dealt with', - 'REPORT_TIME' => 'Report time', + 'REPORTED' => 'Reported', + 'REPORTS_CLOSED_SUCCESS' => 'The selected reports have been closed successfully.', + 'REPORTS_DELETED_SUCCESS' => 'The selected reports have been deleted successfully.', 'REPORTS_TOTAL' => 'In total there are %d reports to review', 'REPORTS_ZERO_TOTAL' => 'There are no reports to review', + 'REPORT_ALREADY_DEALT_WITH' => 'This post has already been reported previously and successfully dealt with', + 'REPORT_CLOSED' => 'This report has previously been closed.', + 'REPORT_CLOSED_SUCCESS' => 'The selected report has been closed successfully.', + 'REPORT_DELETED_SUCCESS' => 'The selected report has been deleted successfully.', + 'REPORT_DETAILS' => 'Report details', 'REPORT_MESSAGE' => 'Report this message', 'REPORT_MESSAGE_EXPLAIN'=> 'Use this form to report the selected message to the board administrators. Reporting should generally be used only if the message breaks forum rules.', 'REPORT_NOTIFY' => 'Notify me', 'REPORT_NOTIFY_EXPLAIN' => 'Informs you when your report is dealt with', 'REPORT_POST_EXPLAIN' => 'Use this form to report the selected post to the forum moderators and board administrators. Reporting should generally be used only if the post breaks forum rules.', + 'REPORT_REASON' => 'Report reason', + 'REPORT_TIME' => 'Report time', 'REPORT_TOTAL' => 'In total there is 1 report to review', 'RESYNC' => 'Resync', 'RETURN_MESSAGE' => 'Click %sHere%s to return to the message', 'RETURN_NEW_FORUM' => 'Click %sHere%s to return to the new forum', 'RETURN_NEW_TOPIC' => 'Click %sHere%s to return to the new topic', 'RETURN_QUEUE' => 'Click %sHere%s to return to the queue', + 'RETURN_REPORTS' => 'Click %sHere%s to return to the reports', 'SELECT_ACTION' => 'Select desired action', 'SELECT_TOPIC' => 'Select topic', diff --git a/phpBB/mcp.php b/phpBB/mcp.php index bf7dc54eb3..5f10ec23bf 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -151,6 +151,7 @@ else // Hide some of the options if we don't have the relevant information to use them if (!$post_id) { + $module->set_display('reports', 'report_details', false); $module->set_display('main', 'post_details', false); $module->set_display('warn', 'warn_post', false); } @@ -394,7 +395,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, case 'reports': $type = 'reports'; - $default_key = 'p'; + $default_key = 't'; $default_dir = 'd'; $limit_time_sql = ($min_time) ? "AND r.report_time >= $min_time" : ''; @@ -452,8 +453,8 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, case 'reports': $limit_days = array(0 => $user->lang['ALL_REPORTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 364 => $user->lang['1_YEAR']); - $sort_by_text = array('p' => $user->lang['REPORT_PRIORITY'], 'r' => $user->lang['REPORTER'], 't' => $user->lang['REPORT_TIME']); - $sort_by_sql = array('p' => 'rr.reason_order', 'r' => 'u.username', 't' => 'r.report_time'); + $sort_by_text = array('a' => $user->lang['AUTHOR'], 'r' => $user->lang['REPORTER'], 'p' => $user->lang['POST_TIME'], 't' => $user->lang['REPORT_TIME'], 's' => $user->lang['SUBJECT']); + $sort_by_sql = array('a' => 'u.username', 'r' => 'ru.username', 'p' => 'p.post_id', 't' => 'r.report_time', 's' => 'p.post_subject'); break; case 'logs': diff --git a/phpBB/search.php b/phpBB/search.php index 3c046ea2aa..afd35c50f8 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -617,13 +617,13 @@ if ($keywords || $author || $search_id) 'S_USER_POSTED' => (!empty($row['mark_type'])) ? true : false, 'S_UNREAD_TOPIC' => $unread_topic, - 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_', $forum_id)) ? true : false, + 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_report', $forum_id)) ? true : false, 'S_TOPIC_UNAPPROVED' => (!$row['topic_approved'] && $auth->acl_gets('m_approve', $forum_id)) ? true : false, 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR'=> ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['topic_last_poster_id']}" : '', 'U_NEWEST_POST' => $view_topic_url . '&view=unread#unread', - 'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&mode=reports&t=$result_topic_id", + 'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&i=reports&mode=reports&t=$result_topic_id", 'U_MCP_QUEUE' => "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&i=queue&mode=approve_details&t=$result_topic_id" ); } diff --git a/phpBB/styles/subSilver/template/mcp_post.html b/phpBB/styles/subSilver/template/mcp_post.html index ff59b7b5c0..1067c634be 100644 --- a/phpBB/styles/subSilver/template/mcp_post.html +++ b/phpBB/styles/subSilver/template/mcp_post.html @@ -2,12 +2,46 @@ - + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_REPORT_DETAILS}
{L_REPORT_REASON}: {REPORT_REASON_TITLE} » {REPORT_REASON_DESCRIPTION}
{L_REPORTER}: {REPORTER_NAME}   [ {L_READ_PROFILE} | {L_VIEW_NOTES} | {L_WARN_USER} ]
{L_REPORTED}: {REPORT_DATE}
{L_MORE_INFO}
{REPORT_TEXT}
{L_REPORT_CLOSED}  
+ +
+ + +
- + @@ -33,7 +67,7 @@ - + @@ -45,38 +79,12 @@
+ + +
+ - - -
- -
{L_POST_DETAILS}
{RETURN_QUEUE}{RETURN_TOPIC}{RETURN_QUEUE}{RETURN_REPORTS}{RETURN_TOPIC}
{L_POST_SUBJECT}:
{POST_PREVIEW}
 
- - - - - - - - - - - - - - - - - - - - - - -
{L_REPORTS}
{reports.REPORT_TIME}{reports.REASON_TITLE} » {reports.REASON_DESC}
{L_REPORTER}: {reports.REPORTER}{reports.REPORTER}
{L_MORE_INFO}: {reports.REPORT_TEXT}
- -
diff --git a/phpBB/styles/subSilver/template/mcp_reports.html b/phpBB/styles/subSilver/template/mcp_reports.html index b3a2f076cf..9fa329ba2d 100644 --- a/phpBB/styles/subSilver/template/mcp_reports.html +++ b/phpBB/styles/subSilver/template/mcp_reports.html @@ -1,42 +1,44 @@ - +
- + - - + - - - - + + + - + - - - + + + + + + + - - + - - - - - - + - -
{L_DISPLAY_OPTIONS}{L_DISPLAY_OPTIONS}
{L_DISPLAY_LOG}: {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} {L_DISPLAY_ITEMS}: {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} {L_FORUM}  
 {L_TOPIC}  {L_SUBJECT}  {L_REASON} 
 {L_POST}  {L_AUTHOR}   {L_REPORTER}  {L_REPORT_TIME}  {L_REPORT_TIME}   {L_SELECT} 
{L_REPORTS_CURRENT_TOPIC} {TOPIC_NAME}

{postrow.POST_SUBJECT}

+ {L_TOPIC}: {postrow.TOPIC_TITLE}
+ {L_FORUM}: {postrow.FORUM_NAME}
{postrow.POSTER}{postrow.POSTER}
+ {postrow.POST_TIME}
{postrow.REPORTER}{postrow.REPORTER}{postrow.REPORT_TIME}
+ [ {L_VIEW_DETAILS} ]
{postrow.S_CHECKBOX}
{reportrow.TOPIC}{reportrow.SUBJECT}{reportrow.REASON}{reportrow.REPORTER}{reportrow.REPORT_TIME}{L_POST_REPORTED}{L_NO_POSTS}
+ + +   + +
- - +
{L_GOTO_PAGE} {L_PREVIOUS}  {PAGINATION}  {L_NEXT}{L_MARK_ALL} :: {L_UNMARK_ALL}
diff --git a/phpBB/styles/subSilver/template/mcp_reports_front.html b/phpBB/styles/subSilver/template/mcp_reports_front.html deleted file mode 100755 index 838e187d08..0000000000 --- a/phpBB/styles/subSilver/template/mcp_reports_front.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{L_OPEN_REPORTS}
 {L_NR}  {L_FORUM}  {L_TOPIC}  {L_USER}  {L_COUNT}  
{report.REPORT_COUNT}{report.FORUM_NAME}{report.TOPIC_TITLE}{report.POSTER}{report.REPORT_COUNT}
{L_REPORTS_ZERO_TOTAL}
- -

- - \ No newline at end of file diff --git a/phpBB/styles/subSilver/template/mcp_reports_topic.html b/phpBB/styles/subSilver/template/mcp_reports_topic.html deleted file mode 100755 index d21a552d23..0000000000 --- a/phpBB/styles/subSilver/template/mcp_reports_topic.html +++ /dev/null @@ -1,77 +0,0 @@ - -
- - - - - - - - - - - - - - -
{L_POST_DETAILS}
{L_POST_SUBJECT}: {postrow.POST_SUBJECT}
- {L_POSTER}: {postrow.POSTER_NAME}
- {L_POSTED}: {postrow.POST_DATE} -
{postrow.POST_PREVIEW}
- - - - - - - - - - - - - - - - - - - - - - - - -
Report {postrow.reportrow.REPORT_ID}
RESOLVED - Time: {postrow.reportrow.REPORT_TIME}
- Reporter: {postrow.reportrow.REPORTER_USERNAME}{postrow.reportrow.REPORTER_USERNAME} -
{postrow.reportrow.REPORT_TEXT}
- - - - - - - - - - -
Reply {postrow.reportrow.replyrow.REPLY_ID}
- Time: {postrow.reportrow.REPORT_TIME}
- From: {postrow.reportrow.replyrow.REPLY_FROMUSERNAME} - To: {postrow.reportrow.replyrow.REPLY_TOUSERNAME} -
{postrow.reportrow.replyrow.REPLY_TEXT}
-
{L_NO_REPORTS}
-
- - -Send this comment to the selected reporters:
- -{L_CLOSE_REPORT} -

- -
- - - - \ No newline at end of file diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 90cac12b19..9ea966ae6e 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -432,14 +432,14 @@ if ($forum_data['forum_type'] == FORUM_POST || (($forum_data['forum_flags'] & 16 'S_USER_POSTED' => (isset($row['topic_posted']) && $row['topic_posted']) ? true : false, 'S_UNREAD_TOPIC' => $unread_topic, - 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_', $forum_id)) ? true : false, + 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_report', $forum_id)) ? true : false, 'S_TOPIC_UNAPPROVED' => (!$row['topic_approved'] && $auth->acl_gets('m_approve', $forum_id)) ? true : false, 'U_NEWEST_POST' => $view_topic_url . '&view=unread#unread', 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR'=> ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['topic_last_poster_id']}" : '', 'U_VIEW_TOPIC' => $view_topic_url, - 'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&mode=reports&t=$topic_id", + 'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&i=reports&mode=reports&t=$topic_id", 'U_MCP_QUEUE' => "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&i=queue&mode=approve_details&t=$topic_id", 'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test) diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 061c973e31..d403e6b877 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1289,7 +1289,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'U_JABBER' => $user_cache[$poster_id]['jabber'], 'U_REPORT' => ($auth->acl_get('f_report', $forum_id)) ? "{$phpbb_root_path}report.$phpEx$SID&p=" . $row['post_id'] : '', - 'U_MCP_REPORT' => ($auth->acl_gets('m_', 'a_', 'f_report', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=main&mode=post_details&p=" . $row['post_id'] : '', + 'U_MCP_REPORT' => ($auth->acl_gets('m_report', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=reports&mode=report_details&p=" . $row['post_id'] : '', 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=queue&mode=unapproved_posts&action=approve&post_id_list[]=" . $row['post_id'] : '', 'U_MINI_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&p=" . $row['post_id'] . '#p' . $row['post_id'], 'U_NEXT_POST_ID' => ($i < $i_total && isset($rowset[$i + 1])) ? $rowset[$i + 1]['post_id'] : '', @@ -1301,7 +1301,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false, 'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true, - 'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_', $forum_id)) ? true : false, + 'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_report', $forum_id)) ? true : false, 'S_DISPLAY_NOTICE' => $display_notice && $row['post_attachment'], 'S_FRIEND' => ($row['friend']) ? true : false, 'S_UNREAD_POST' => $post_unread,