diff options
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r-- | phpBB/includes/mcp/info/mcp_ban.php | 1 | ||||
-rw-r--r-- | phpBB/includes/mcp/info/mcp_logs.php | 1 | ||||
-rw-r--r-- | phpBB/includes/mcp/info/mcp_main.php | 1 | ||||
-rw-r--r-- | phpBB/includes/mcp/info/mcp_notes.php | 1 | ||||
-rw-r--r-- | phpBB/includes/mcp/info/mcp_pm_reports.php | 1 | ||||
-rw-r--r-- | phpBB/includes/mcp/info/mcp_queue.php | 1 | ||||
-rw-r--r-- | phpBB/includes/mcp/info/mcp_reports.php | 1 | ||||
-rw-r--r-- | phpBB/includes/mcp/info/mcp_warn.php | 1 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 52 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_front.php | 4 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_logs.php | 29 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_main.php | 117 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_notes.php | 41 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_pm_reports.php | 14 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_post.php | 27 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 70 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_reports.php | 51 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_topic.php | 77 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_warn.php | 49 |
19 files changed, 339 insertions, 200 deletions
diff --git a/phpBB/includes/mcp/info/mcp_ban.php b/phpBB/includes/mcp/info/mcp_ban.php index 4aedbc8558..b4fd32792a 100644 --- a/phpBB/includes/mcp/info/mcp_ban.php +++ b/phpBB/includes/mcp/info/mcp_ban.php @@ -18,7 +18,6 @@ class mcp_ban_info return array( 'filename' => 'mcp_ban', 'title' => 'MCP_BAN', - 'version' => '1.0.0', 'modes' => array( 'user' => array('title' => 'MCP_BAN_USERNAMES', 'auth' => 'acl_m_ban', 'cat' => array('MCP_BAN')), 'ip' => array('title' => 'MCP_BAN_IPS', 'auth' => 'acl_m_ban', 'cat' => array('MCP_BAN')), diff --git a/phpBB/includes/mcp/info/mcp_logs.php b/phpBB/includes/mcp/info/mcp_logs.php index c6482c1255..7a0205fce9 100644 --- a/phpBB/includes/mcp/info/mcp_logs.php +++ b/phpBB/includes/mcp/info/mcp_logs.php @@ -18,7 +18,6 @@ class mcp_logs_info return array( 'filename' => 'mcp_logs', 'title' => 'MCP_LOGS', - 'version' => '1.0.0', 'modes' => array( 'front' => array('title' => 'MCP_LOGS_FRONT', 'auth' => 'acl_m_ || aclf_m_', 'cat' => array('MCP_LOGS')), 'forum_logs' => array('title' => 'MCP_LOGS_FORUM_VIEW', 'auth' => 'acl_m_,$id', 'cat' => array('MCP_LOGS')), diff --git a/phpBB/includes/mcp/info/mcp_main.php b/phpBB/includes/mcp/info/mcp_main.php index 81ccdbd1cd..c0f0363255 100644 --- a/phpBB/includes/mcp/info/mcp_main.php +++ b/phpBB/includes/mcp/info/mcp_main.php @@ -18,7 +18,6 @@ class mcp_main_info return array( 'filename' => 'mcp_main', 'title' => 'MCP_MAIN', - 'version' => '1.0.0', 'modes' => array( 'front' => array('title' => 'MCP_MAIN_FRONT', 'auth' => '', 'cat' => array('MCP_MAIN')), 'forum_view' => array('title' => 'MCP_MAIN_FORUM_VIEW', 'auth' => 'acl_m_,$id', 'cat' => array('MCP_MAIN')), diff --git a/phpBB/includes/mcp/info/mcp_notes.php b/phpBB/includes/mcp/info/mcp_notes.php index 4b8c255fe2..de4a41dd80 100644 --- a/phpBB/includes/mcp/info/mcp_notes.php +++ b/phpBB/includes/mcp/info/mcp_notes.php @@ -18,7 +18,6 @@ class mcp_notes_info return array( 'filename' => 'mcp_notes', 'title' => 'MCP_NOTES', - 'version' => '1.0.0', 'modes' => array( 'front' => array('title' => 'MCP_NOTES_FRONT', 'auth' => '', 'cat' => array('MCP_NOTES')), 'user_notes' => array('title' => 'MCP_NOTES_USER', 'auth' => '', 'cat' => array('MCP_NOTES')), diff --git a/phpBB/includes/mcp/info/mcp_pm_reports.php b/phpBB/includes/mcp/info/mcp_pm_reports.php index c80f3b86a3..2a57c0c49a 100644 --- a/phpBB/includes/mcp/info/mcp_pm_reports.php +++ b/phpBB/includes/mcp/info/mcp_pm_reports.php @@ -18,7 +18,6 @@ class mcp_pm_reports_info return array( 'filename' => 'mcp_pm_reports', 'title' => 'MCP_PM_REPORTS', - 'version' => '1.0.0', 'modes' => array( 'pm_reports' => array('title' => 'MCP_PM_REPORTS_OPEN', 'auth' => 'acl_m_pm_report', 'cat' => array('MCP_REPORTS')), 'pm_reports_closed' => array('title' => 'MCP_PM_REPORTS_CLOSED', 'auth' => 'acl_m_pm_report', 'cat' => array('MCP_REPORTS')), diff --git a/phpBB/includes/mcp/info/mcp_queue.php b/phpBB/includes/mcp/info/mcp_queue.php index 556c3902b0..d5605aa50e 100644 --- a/phpBB/includes/mcp/info/mcp_queue.php +++ b/phpBB/includes/mcp/info/mcp_queue.php @@ -18,7 +18,6 @@ class mcp_queue_info return array( 'filename' => 'mcp_queue', 'title' => 'MCP_QUEUE', - 'version' => '1.0.0', 'modes' => array( 'unapproved_topics' => array('title' => 'MCP_QUEUE_UNAPPROVED_TOPICS', 'auth' => 'aclf_m_approve', 'cat' => array('MCP_QUEUE')), 'unapproved_posts' => array('title' => 'MCP_QUEUE_UNAPPROVED_POSTS', 'auth' => 'aclf_m_approve', 'cat' => array('MCP_QUEUE')), diff --git a/phpBB/includes/mcp/info/mcp_reports.php b/phpBB/includes/mcp/info/mcp_reports.php index 31fee19d79..76e62efe9c 100644 --- a/phpBB/includes/mcp/info/mcp_reports.php +++ b/phpBB/includes/mcp/info/mcp_reports.php @@ -18,7 +18,6 @@ class mcp_reports_info return array( 'filename' => 'mcp_reports', 'title' => 'MCP_REPORTS', - 'version' => '1.0.0', 'modes' => array( 'reports' => array('title' => 'MCP_REPORTS_OPEN', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')), 'reports_closed' => array('title' => 'MCP_REPORTS_CLOSED', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')), diff --git a/phpBB/includes/mcp/info/mcp_warn.php b/phpBB/includes/mcp/info/mcp_warn.php index d85499f280..b4f83e77c6 100644 --- a/phpBB/includes/mcp/info/mcp_warn.php +++ b/phpBB/includes/mcp/info/mcp_warn.php @@ -18,7 +18,6 @@ class mcp_warn_info return array( 'filename' => 'mcp_warn', 'title' => 'MCP_WARN', - 'version' => '1.0.0', 'modes' => array( 'front' => array('title' => 'MCP_WARN_FRONT', 'auth' => 'aclf_m_warn', 'cat' => array('MCP_WARN')), 'list' => array('title' => 'MCP_WARN_LIST', 'auth' => 'aclf_m_warn', 'cat' => array('MCP_WARN')), diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 6faf0de35b..8237b834d6 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -36,11 +36,11 @@ function mcp_forum_view($id, $mode, $action, $forum_info) $merge_select = ($action == 'merge_select' || $action == 'merge_topic' || $action == 'merge_topics') ? true : false; $forum_id = $forum_info['forum_id']; - $start = request_var('start', 0); - $topic_id_list = request_var('topic_id_list', array(0)); - $post_id_list = request_var('post_id_list', array(0)); - $source_topic_ids = array(request_var('t', 0)); - $to_topic_id = request_var('to_topic_id', 0); + $start = $request->variable('start', 0); + $topic_id_list = $request->variable('topic_id_list', array(0)); + $post_id_list = $request->variable('post_id_list', array(0)); + $source_topic_ids = array($request->variable('t', 0)); + $to_topic_id = $request->variable('to_topic_id', 0); $url_extra = ''; $url_extra .= ($forum_id) ? "&f=$forum_id" : ''; @@ -54,7 +54,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) switch ($action) { case 'resync': - $topic_ids = request_var('topic_id_list', array(0)); + $topic_ids = $request->variable('topic_id_list', array(0)); mcp_resync_topics($topic_ids); break; @@ -92,6 +92,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) ); extract($phpbb_dispatcher->trigger_event('core.mcp_forum_view_before', compact($vars))); + /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); $selected_ids = ''; @@ -145,9 +146,10 @@ function mcp_forum_view($id, $mode, $action, $forum_info) 'S_CAN_SYNC' => $auth->acl_get('m_', $forum_id), 'S_CAN_APPROVE' => $auth->acl_get('m_approve', $forum_id), 'S_MERGE_SELECT' => ($merge_select) ? true : false, - 'S_CAN_MAKE_NORMAL' => $auth->acl_gets('f_sticky', 'f_announce', $forum_id), + 'S_CAN_MAKE_NORMAL' => $auth->acl_gets('f_sticky', 'f_announce', 'f_announce_global', $forum_id), 'S_CAN_MAKE_STICKY' => $auth->acl_get('f_sticky', $forum_id), 'S_CAN_MAKE_ANNOUNCE' => $auth->acl_get('f_announce', $forum_id), + 'S_CAN_MAKE_ANNOUNCE_GLOBAL' => $auth->acl_get('f_announce_global', $forum_id), 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id), 'U_VIEW_FORUM_LOGS' => ($auth->acl_gets('a_', 'm_', $forum_id) && $module->loaded('logs')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=logs&mode=forum_logs&f=' . $forum_id) : '', @@ -172,6 +174,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) $read_tracking_join = $read_tracking_select = ''; } + /* @var $phpbb_content_visibility \phpbb\content_visibility */ $phpbb_content_visibility = $phpbb_container->get('content.visibility'); $sql = 'SELECT t.topic_id @@ -331,16 +334,20 @@ function mcp_forum_view($id, $mode, $action, $forum_info) )); } + $row_ary = $row; /** * Modify the topic data before it is assigned to the template in MCP * * @event core.mcp_view_forum_modify_topicrow - * @var array row Array with topic data + * @var array row_ary Array with topic data * @var array topic_row Template array with topic data * @since 3.1.0-a1 + * @change 3.2.0-a1 Replace row with row_ary */ - $vars = array('row', 'topic_row'); + $vars = array('row_ary', 'topic_row'); extract($phpbb_dispatcher->trigger_event('core.mcp_view_forum_modify_topicrow', compact($vars))); + $row = $row_ary; + unset($row_ary); $template->assign_block_vars('topicrow', $topic_row); } @@ -352,7 +359,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) */ function mcp_resync_topics($topic_ids) { - global $auth, $db, $template, $phpEx, $user, $phpbb_root_path; + global $auth, $db, $template, $phpEx, $user, $phpbb_root_path, $phpbb_log, $request; if (!sizeof($topic_ids)) { @@ -377,13 +384,17 @@ function mcp_resync_topics($topic_ids) // Log this action while ($row = $db->sql_fetchrow($result)) { - add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_TOPIC_RESYNC', $row['topic_title']); + $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_TOPIC_RESYNC', false, array( + 'forum_id' => $row['forum_id'], + 'topic_id' => $row['topic_id'], + $row['topic_title'] + )); } $db->sql_freeresult($result); $msg = (sizeof($topic_ids) == 1) ? $user->lang['TOPIC_RESYNC_SUCCESS'] : $user->lang['TOPICS_RESYNC_SUCCESS']; - $redirect = request_var('redirect', $user->data['session_page']); + $redirect = $request->variable('redirect', $user->data['session_page']); meta_refresh(3, $redirect); trigger_error($msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>')); @@ -396,7 +407,7 @@ function mcp_resync_topics($topic_ids) */ function merge_topics($forum_id, $topic_ids, $to_topic_id) { - global $db, $template, $user, $phpEx, $phpbb_root_path, $auth; + global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $phpbb_log, $request; if (!sizeof($topic_ids)) { @@ -427,8 +438,8 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) $topic_data = $topic_data[$to_topic_id]; - $post_id_list = request_var('post_id_list', array(0)); - $start = request_var('start', 0); + $post_id_list = $request->variable('post_id_list', array(0)); + $start = $request->variable('start', 0); if (!sizeof($post_id_list) && sizeof($topic_ids)) { @@ -456,7 +467,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) return; } - $redirect = request_var('redirect', build_url(array('quickmod'))); + $redirect = $request->variable('redirect', build_url(array('quickmod'))); $s_hidden_fields = build_hidden_fields(array( 'i' => 'main', @@ -476,7 +487,12 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) $to_forum_id = $topic_data['forum_id']; move_posts($post_id_list, $to_topic_id, false); - add_log('mod', $to_forum_id, $to_topic_id, 'LOG_MERGE', $topic_data['topic_title']); + + $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_MERGE', false, array( + 'forum_id' => $to_forum_id, + 'topic_id' => $to_topic_id, + $topic_data['topic_title'] + )); // Message and return links $success_msg = 'POSTS_MERGED_SUCCESS'; @@ -500,7 +516,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) // Link to the new topic $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&t=' . $to_topic_id) . '">', '</a>'); - $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); + $redirect = $request->variable('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); $redirect = reapply_sid($redirect); meta_refresh(3, $redirect); diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index cdf1abd8ff..23a0604ccd 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -26,7 +26,7 @@ function mcp_front_view($id, $mode, $action) { global $phpEx, $phpbb_root_path, $config; global $template, $db, $user, $auth, $module; - global $phpbb_dispatcher; + global $phpbb_dispatcher, $request; // Latest 5 unapproved if ($module->loaded('queue')) @@ -35,7 +35,7 @@ function mcp_front_view($id, $mode, $action) $post_list = array(); $forum_names = array(); - $forum_id = request_var('f', 0); + $forum_id = $request->variable('f', 0); $template->assign_var('S_SHOW_UNAPPROVED', (!empty($forum_list)) ? true : false); diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php index 9c76f0df90..bf2d462801 100644 --- a/phpBB/includes/mcp/mcp_logs.php +++ b/phpBB/includes/mcp/mcp_logs.php @@ -35,12 +35,12 @@ class mcp_logs function main($id, $mode) { - global $auth, $db, $user, $template; + global $auth, $db, $user, $template, $request; global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_log; $user->add_lang('acp/common'); - $action = request_var('action', array('' => '')); + $action = $request->variable('action', array('' => '')); if (is_array($action)) { @@ -48,23 +48,24 @@ class mcp_logs } else { - $action = request_var('action', ''); + $action = $request->variable('action', ''); } // Set up general vars - $start = request_var('start', 0); + $start = $request->variable('start', 0); $deletemark = ($action == 'del_marked') ? true : false; $deleteall = ($action == 'del_all') ? true : false; - $marked = request_var('mark', array(0)); + $marked = $request->variable('mark', array(0)); // Sort keys - $sort_days = request_var('st', 0); - $sort_key = request_var('sk', 't'); - $sort_dir = request_var('sd', 'd'); + $sort_days = $request->variable('st', 0); + $sort_key = $request->variable('sk', 't'); + $sort_dir = $request->variable('sd', 'd'); $this->tpl_name = 'mcp_logs'; $this->page_title = 'MCP_LOGS'; + /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); $forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_'))); @@ -78,7 +79,7 @@ class mcp_logs break; case 'forum_logs': - $forum_id = request_var('f', 0); + $forum_id = $request->variable('f', 0); if (!in_array($forum_id, $forum_list)) { @@ -89,7 +90,7 @@ class mcp_logs break; case 'topic_logs': - $topic_id = request_var('t', 0); + $topic_id = $request->variable('t', 0); $sql = 'SELECT forum_id FROM ' . TOPICS_TABLE . ' @@ -123,7 +124,7 @@ class mcp_logs } else if ($deleteall) { - $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); + $keywords = $request->variable('keywords', '', true); $conditions = array( 'forum_id' => array('IN' => $forum_list), @@ -157,7 +158,7 @@ class mcp_logs 'sd' => $sort_dir, 'i' => $id, 'mode' => $mode, - 'action' => request_var('action', array('' => '')))) + 'action' => $request->variable('action', array('' => '')))) ); } } @@ -174,7 +175,7 @@ class mcp_logs $sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0; $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); - $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); + $keywords = $request->variable('keywords', '', true); $keywords_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; // Grab log data @@ -204,7 +205,7 @@ class mcp_logs { $data = array(); - $checks = array('viewtopic', 'viewforum'); + $checks = array('viewpost', 'viewtopic', 'viewforum'); foreach ($checks as $check) { if (isset($row[$check]) && $row[$check]) diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index fc28968101..b0579d8995 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -45,7 +45,7 @@ class mcp_main { case 'lock': case 'unlock': - $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0)); + $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0)); if (!sizeof($topic_ids)) { @@ -58,7 +58,7 @@ class mcp_main case 'lock_post': case 'unlock_post': - $post_ids = (!$quickmod) ? request_var('post_id_list', array(0)) : array(request_var('p', 0)); + $post_ids = (!$quickmod) ? $request->variable('post_id_list', array(0)) : array($request->variable('p', 0)); if (!sizeof($post_ids)) { @@ -73,7 +73,7 @@ class mcp_main case 'make_global': case 'make_normal': - $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0)); + $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0)); if (!sizeof($topic_ids)) { @@ -86,7 +86,7 @@ class mcp_main case 'move': $user->add_lang('viewtopic'); - $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0)); + $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0)); if (!sizeof($topic_ids)) { @@ -99,7 +99,7 @@ class mcp_main case 'fork': $user->add_lang('viewtopic'); - $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0)); + $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0)); if (!sizeof($topic_ids)) { @@ -189,7 +189,7 @@ class mcp_main $user->add_lang('viewforum'); - $forum_id = request_var('f', 0); + $forum_id = $request->variable('f', 0); $forum_info = phpbb_get_forum_data($forum_id, 'm_', true); @@ -262,7 +262,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') { @@ -298,7 +298,7 @@ function lock_unlock($action, $ids) } unset($orig_ids); - $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); + $redirect = $request->variable('redirect', build_url(array('action', 'quickmod'))); $redirect = reapply_sid($redirect); $s_hidden_fields = build_hidden_fields(array( @@ -319,7 +319,12 @@ 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'], + 'post_id' => isset($row['post_id']) ? $row['post_id'] : 0, + $row['topic_title'] + )); } $success_msg = $l_prefix . ((sizeof($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS'; @@ -346,7 +351,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) { @@ -358,7 +363,7 @@ function change_topic_type($action, $topic_ids) case 'make_global': $new_topic_type = POST_GLOBAL; - $check_acl = 'f_announce'; + $check_acl = 'f_announce_global'; $l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_GLOBAL' : 'MCP_MAKE_GLOBALS'; break; @@ -382,7 +387,7 @@ function change_topic_type($action, $topic_ids) return; } - $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); + $redirect = $request->variable('redirect', build_url(array('action', 'quickmod'))); $redirect = reapply_sid($redirect); $s_hidden_fields = array( @@ -421,7 +426,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'] + )); } } @@ -458,8 +467,8 @@ function mcp_move_topic($topic_ids) return; } - $to_forum_id = request_var('to_forum_id', 0); - $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); + $to_forum_id = $request->variable('to_forum_id', 0); + $redirect = $request->variable('redirect', build_url(array('action', 'quickmod'))); $additional_msg = $success_msg = ''; $s_hidden_fields = build_hidden_fields(array( @@ -679,7 +688,7 @@ function mcp_move_topic($topic_ids) confirm_box(false, 'MOVE_TOPIC' . ((sizeof($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html'); } - $redirect = request_var('redirect', "index.$phpEx"); + $redirect = $request->variable('redirect', "index.$phpEx"); $redirect = reapply_sid($redirect); if (!$success_msg) @@ -704,7 +713,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'))) { @@ -728,13 +737,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'] + )); } } } @@ -777,7 +792,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))) @@ -806,23 +821,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 + )); } } } @@ -916,7 +948,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))) @@ -973,6 +1005,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) { @@ -987,7 +1020,14 @@ 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'], + 'post_id' => $row['post_id'], + $row['post_subject'], + $post_username, + $soft_delete_reason + )); } $topic_id = $request->variable('t', 0); @@ -1030,7 +1070,14 @@ 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'], + 'post_id' => $row['post_id'], + $row['post_subject'], + $post_username, + $soft_delete_reason + )); } // Now delete the posts, topics and forums are automatically resync'ed @@ -1144,16 +1191,16 @@ 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, $phpbb_dispatcher; + global $phpEx, $phpbb_root_path, $phpbb_log, $request, $phpbb_dispatcher; if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_'))) { return; } - $to_forum_id = request_var('to_forum_id', 0); - $forum_id = request_var('f', 0); - $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); + $to_forum_id = $request->variable('to_forum_id', 0); + $forum_id = $request->variable('f', 0); + $redirect = $request->variable('redirect', build_url(array('action', 'quickmod'))); $additional_msg = $success_msg = ''; $counter = array(); @@ -1497,12 +1544,16 @@ function mcp_fork_topic($topic_ids) sync('topic', 'topic_id', $new_topic_id_list); sync('forum', 'forum_id', $to_forum_id); - set_config_count('num_topics', sizeof($new_topic_id_list), true); - set_config_count('num_posts', $total_posts, true); + $config->increment('num_topics', sizeof($new_topic_id_list), false); + $config->increment('num_posts', $total_posts, false); 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'; @@ -1518,7 +1569,7 @@ function mcp_fork_topic($topic_ids) confirm_box(false, 'FORK_TOPIC' . ((sizeof($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html'); } - $redirect = request_var('redirect', "index.$phpEx"); + $redirect = $request->variable('redirect', "index.$phpEx"); $redirect = reapply_sid($redirect); if (!$success_msg) diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index 465ee63a98..502d4cb1e7 100644 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -35,10 +35,10 @@ class mcp_notes function main($id, $mode) { - global $auth, $db, $user, $template; + global $auth, $db, $user, $template, $request; global $config, $phpbb_root_path, $phpEx; - $action = request_var('action', array('' => '')); + $action = $request->variable('action', array('' => '')); if (is_array($action)) { @@ -74,15 +74,17 @@ class mcp_notes */ function mcp_notes_user_view($action) { - global $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config, $phpbb_log, $request; global $template, $db, $user, $auth, $phpbb_container; - $user_id = request_var('u', 0); - $username = request_var('username', '', true); - $start = request_var('start', 0); - $st = request_var('st', 0); - $sk = request_var('sk', 'b'); - $sd = request_var('sd', 'd'); + $user_id = $request->variable('u', 0); + $username = $request->variable('username', '', true); + $start = $request->variable('start', 0); + $st = $request->variable('st', 0); + $sk = $request->variable('sk', 'b'); + $sd = $request->variable('sd', 'd'); + + /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); add_form_key('mcp_notes'); @@ -114,8 +116,8 @@ class mcp_notes $deletemark = ($action == 'del_marked') ? true : false; $deleteall = ($action == 'del_all') ? true : false; - $marked = request_var('marknote', array(0)); - $usernote = utf8_normalize_nfc(request_var('usernote', '', true)); + $marked = $request->variable('marknote', array(0)); + $usernote = $request->variable('usernote', '', true); // Handle any actions if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) @@ -142,7 +144,7 @@ class mcp_notes $where_sql"; $db->sql_query($sql); - add_log('admin', 'LOG_CLEAR_USER', $userrow['username']); + $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_CLEAR_USER', false, array($userrow['username'])); $msg = ($deletemark) ? 'MARKED_NOTES_DELETED' : 'ALL_NOTES_DELETED'; } @@ -160,10 +162,17 @@ class mcp_notes { if (check_form_key('mcp_notes')) { - add_log('admin', 'LOG_USER_FEEDBACK', $userrow['username']); - add_log('mod', 0, 0, 'LOG_USER_FEEDBACK', $userrow['username']); + $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_FEEDBACK', false, array($userrow['username'])); + $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_USER_FEEDBACK', false, array( + 'forum_id' => 0, + 'topic_id' => 0, + $userrow['username'] + )); + $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_GENERAL', false, array( + 'reportee_id' => $user_id, + $usernote + )); - add_log('user', $user_id, 'LOG_USER_GENERAL', $usernote); $msg = $user->lang['USER_FEEDBACK_ADDED']; } else @@ -192,7 +201,7 @@ class mcp_notes $sql_where = ($st) ? (time() - ($st * 86400)) : 0; $sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC'); - $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); + $keywords = $request->variable('keywords', '', true); $keywords_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; $log_data = array(); diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php index d76bedba98..6e1d594135 100644 --- a/phpBB/includes/mcp/mcp_pm_reports.php +++ b/phpBB/includes/mcp/mcp_pm_reports.php @@ -35,14 +35,15 @@ class mcp_pm_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; include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); - $start = request_var('start', 0); + /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); + $start = $request->variable('start', 0); $this->page_title = 'MCP_PM_REPORTS'; @@ -52,7 +53,7 @@ class mcp_pm_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)) { @@ -75,7 +76,7 @@ class mcp_pm_reports $user->add_lang(array('posting', 'viewforum', 'viewtopic', 'ucp')); - $report_id = request_var('r', 0); + $report_id = $request->variable('r', 0); $sql = 'SELECT r.pm_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u @@ -93,9 +94,10 @@ class mcp_pm_reports trigger_error('NO_REPORT'); } + /* @var $phpbb_notifications \phpbb\notification\manager */ $phpbb_notifications = $phpbb_container->get('notification_manager'); - $phpbb_notifications->mark_notifications_read_by_parent('notification.type.report_pm', $report_id, $user->data['user_id']); + $phpbb_notifications->mark_notifications_by_parent('report_pm', $report_id, $user->data['user_id']); $pm_id = $report['pm_id']; $report_id = $report['report_id']; @@ -199,7 +201,7 @@ class mcp_pm_reports 'POST_SUBJECT' => ($pm_info['message_subject']) ? $pm_info['message_subject'] : $user->lang['NO_SUBJECT'], 'POST_DATE' => $user->format_date($pm_info['message_time']), 'POST_IP' => $pm_info['author_ip'], - 'POST_IPADDR' => ($auth->acl_getf_global('m_info') && request_var('lookup', '')) ? @gethostbyaddr($pm_info['author_ip']) : '', + 'POST_IPADDR' => ($auth->acl_getf_global('m_info') && $request->variable('lookup', '')) ? @gethostbyaddr($pm_info['author_ip']) : '', 'POST_ID' => $pm_info['msg_id'], 'U_LOOKUP_IP' => ($auth->acl_getf_global('m_info')) ? $this->u_action . '&r=' . $report_id . '&pm=' . $pm_id . '&lookup=' . $pm_info['author_ip'] . '#ip' : '', diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 2dcfcd608b..33aebccb22 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -24,14 +24,14 @@ if (!defined('IN_PHPBB')) */ function mcp_post_details($id, $mode, $action) { - global $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config, $request; global $template, $db, $user, $auth, $cache; global $phpbb_dispatcher; $user->add_lang('posting'); - $post_id = request_var('p', 0); - $start = request_var('start', 0); + $post_id = $request->variable('p', 0); + $start = $request->variable('start', 0); // Get post data $post_info = phpbb_get_post_data(array($post_id), false, true); @@ -52,7 +52,7 @@ function mcp_post_details($id, $mode, $action) if ($auth->acl_get('m_info', $post_info['forum_id'])) { - $ip = request_var('ip', ''); + $ip = $request->variable('ip', ''); include($phpbb_root_path . 'includes/functions_user.' . $phpEx); $template->assign_vars(array( @@ -73,12 +73,12 @@ function mcp_post_details($id, $mode, $action) if ($action == 'chgposter') { - $username = request_var('username', '', true); + $username = $request->variable('username', '', true); $sql_where = "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; } else { - $new_user_id = request_var('u', 0); + $new_user_id = $request->variable('u', 0); $sql_where = 'user_id = ' . $new_user_id; } @@ -260,7 +260,7 @@ function mcp_post_details($id, $mode, $action) 'POST_SUBJECT' => $post_info['post_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'])) ? "$url&i=$id&mode=$mode&lookup={$post_info['poster_ip']}#ip" : '', @@ -355,7 +355,7 @@ function mcp_post_details($id, $mode, $action) // Get IP if ($auth->acl_get('m_info', $post_info['forum_id'])) { - $rdns_ip_num = request_var('rdns', ''); + $rdns_ip_num = $request->variable('rdns', ''); if ($rdns_ip_num != 'all') { @@ -461,7 +461,7 @@ function mcp_post_details($id, $mode, $action) */ function change_poster(&$post_info, $userdata) { - global $auth, $db, $config, $phpbb_root_path, $phpEx, $user, $phpbb_dispatcher; + global $auth, $db, $config, $phpbb_root_path, $phpEx, $user, $phpbb_log, $phpbb_dispatcher; if (empty($userdata) || $userdata['user_id'] == $post_info['user_id']) { @@ -572,5 +572,12 @@ function change_poster(&$post_info, $userdata) $post_info = $post_info[$post_id]; // Now add log entry - add_log('mod', $post_info['forum_id'], $post_info['topic_id'], 'LOG_MCP_CHANGE_POSTER', $post_info['topic_title'], $from_username, $to_username); + $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_MCP_CHANGE_POSTER', false, array( + 'forum_id' => $post_info['forum_id'], + 'topic_id' => $post_info['topic_id'], + 'post_id' => $post_info['post_id'], + $post_info['topic_title'], + $from_username, + $to_username + )); } diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 3567e545f0..9fdd16e791 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -41,8 +41,8 @@ class mcp_queue 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_QUEUE'; @@ -154,9 +154,10 @@ class mcp_queue $user->add_lang(array('posting', 'viewtopic')); - $post_id = request_var('p', 0); - $topic_id = request_var('t', 0); + $post_id = $request->variable('p', 0); + $topic_id = $request->variable('t', 0); + /* @var $phpbb_notifications \phpbb\notification\manager */ $phpbb_notifications = $phpbb_container->get('notification_manager'); if ($topic_id) @@ -166,7 +167,7 @@ class mcp_queue { $post_id = (int) $topic_info[$topic_id]['topic_first_post_id']; - $phpbb_notifications->mark_notifications_read('notification.type.topic_in_queue', $topic_id, $user->data['user_id']); + $phpbb_notifications->mark_notifications('topic_in_queue', $topic_id, $user->data['user_id']); } else { @@ -174,7 +175,7 @@ class mcp_queue } } - $phpbb_notifications->mark_notifications_read('notification.type.post_in_queue', $post_id, $user->data['user_id']); + $phpbb_notifications->mark_notifications('post_in_queue', $post_id, $user->data['user_id']); $post_info = phpbb_get_post_data(array($post_id), 'm_approve', true); @@ -320,7 +321,7 @@ class mcp_queue 'POST_SUBJECT' => $post_info['post_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'], 'S_FIRST_POST' => ($post_info['topic_first_post_id'] == $post_id), @@ -342,6 +343,8 @@ class mcp_queue $topic_id = $request->variable('t', 0); $forum_info = array(); + + /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); if ($topic_id) @@ -619,7 +622,7 @@ class mcp_queue static public function approve_posts($action, $post_id_list, $id, $mode) { global $db, $template, $user, $config, $request, $phpbb_container, $phpbb_dispatcher; - global $phpEx, $phpbb_root_path; + global $phpEx, $phpbb_root_path, $phpbb_log; if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve'))) { @@ -677,10 +680,12 @@ class mcp_queue $approve_log[] = array( 'forum_id' => $post_data['forum_id'], 'topic_id' => $post_data['topic_id'], + 'post_id' => $post_id, 'post_subject' => $post_data['post_subject'], ); } + /* @var $phpbb_content_visibility \phpbb\content_visibility */ $phpbb_content_visibility = $phpbb_container->get('content.visibility'); foreach ($topic_info as $topic_id => $topic_data) { @@ -689,12 +694,18 @@ class mcp_queue foreach ($approve_log as $log_data) { - add_log('mod', $log_data['forum_id'], $log_data['topic_id'], 'LOG_POST_' . strtoupper($action) . 'D', $log_data['post_subject']); + $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_POST_' . strtoupper($action) . 'D', false, array( + 'forum_id' => $log_data['forum_id'], + 'topic_id' => $log_data['topic_id'], + 'post_id' => $log_data['post_id'], + $log_data['post_subject'] + )); } // Only send out the mails, when the posts are being approved if ($action == 'approve') { + /* @var $phpbb_notifications \phpbb\notification\manager */ $phpbb_notifications = $phpbb_container->get('notification_manager'); // Handle notifications @@ -731,7 +742,7 @@ class mcp_queue $phpbb_notifications->add_notifications(array('notification.type.quote'), $post_data); $phpbb_notifications->delete_notifications('notification.type.post_in_queue', $post_id); - $phpbb_notifications->mark_notifications_read(array( + $phpbb_notifications->mark_notifications(array( 'notification.type.quote', 'notification.type.bookmark', 'notification.type.post', @@ -865,7 +876,7 @@ class mcp_queue */ static public function approve_topics($action, $topic_id_list, $id, $mode) { - global $db, $template, $user, $config; + global $db, $template, $user, $config, $phpbb_log; global $phpEx, $phpbb_root_path, $request, $phpbb_container, $phpbb_dispatcher; if (!phpbb_check_ids($topic_id_list, TOPICS_TABLE, 'topic_id', array('m_approve'))) @@ -892,6 +903,7 @@ class mcp_queue { $notify_poster = ($action == 'approve' && isset($_REQUEST['notify_poster'])) ? true : false; + /* @var $phpbb_content_visibility \phpbb\content_visibility */ $phpbb_content_visibility = $phpbb_container->get('content.visibility'); $first_post_ids = array(); @@ -916,7 +928,11 @@ class mcp_queue foreach ($approve_log as $log_data) { - add_log('mod', $log_data['forum_id'], $log_data['topic_id'], 'LOG_TOPIC_' . strtoupper($action) . 'D', $log_data['topic_title']); + $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_TOPIC_' . strtoupper($action) . 'D', false, array( + 'forum_id' => $log_data['forum_id'], + 'topic_id' => $log_data['topic_id'], + $log_data['topic_title'] + )); } // Only send out the mails, when the posts are being approved @@ -935,6 +951,7 @@ class mcp_queue $db->sql_freeresult($result); // Handle notifications + /* @var $phpbb_notifications \phpbb\notification\manager */ $phpbb_notifications = $phpbb_container->get('notification_manager'); foreach ($topic_info as $topic_id => $topic_data) @@ -961,8 +978,8 @@ class mcp_queue ), $topic_data); } - $phpbb_notifications->mark_notifications_read('notification.type.quote', $topic_data['post_id'], $user->data['user_id']); - $phpbb_notifications->mark_notifications_read('notification.type.topic', $topic_id, $user->data['user_id']); + $phpbb_notifications->mark_notifications('quote', $topic_data['post_id'], $user->data['user_id']); + $phpbb_notifications->mark_notifications('topic', $topic_id, $user->data['user_id']); if ($notify_poster) { @@ -1057,7 +1074,7 @@ class mcp_queue static public function disapprove_posts($post_id_list, $id, $mode) { global $db, $template, $user, $config, $phpbb_container, $phpbb_dispatcher; - global $phpEx, $phpbb_root_path, $request; + global $phpEx, $phpbb_root_path, $request, $phpbb_log; if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve'))) { @@ -1217,16 +1234,28 @@ class mcp_queue if ($is_disapproving) { $l_log_message = ($log_data['type'] == 'topic') ? 'LOG_TOPIC_DISAPPROVED' : 'LOG_POST_DISAPPROVED'; - add_log('mod', $log_data['forum_id'], $log_data['topic_id'], $l_log_message, $log_data['post_subject'], $disapprove_reason, $log_data['post_username']); + $phpbb_log->add('mod', $user->data['user_id'], $user->ip, $l_log_message, false, array( + 'forum_id' => $log_data['forum_id'], + 'topic_id' => $log_data['topic_id'], + $log_data['post_subject'], + $disapprove_reason, + $log_data['post_username'] + )); } else { $l_log_message = ($log_data['type'] == 'topic') ? 'LOG_DELETE_TOPIC' : 'LOG_DELETE_POST'; - add_log('mod', $log_data['forum_id'], $log_data['topic_id'], $l_log_message, $log_data['post_subject'], $log_data['post_username']); + $phpbb_log->add('mod', $user->data['user_id'], $user->ip, $l_log_message, false, array( + 'forum_id' => $log_data['forum_id'], + 'topic_id' => $log_data['topic_id'], + $log_data['post_subject'], + $log_data['post_username'] + )); } } } + /* @var $phpbb_notifications \phpbb\notification\manager */ $phpbb_notifications = $phpbb_container->get('notification_manager'); $lang_reasons = array(); @@ -1388,11 +1417,6 @@ class mcp_queue } else { - if (!function_exists('display_reasons')) - { - include($phpbb_root_path . 'includes/functions_display.' . $phpEx); - } - $show_notify = false; foreach ($post_info as $post_data) @@ -1412,7 +1436,7 @@ class mcp_queue $confirm_template = 'mcp_approve.html'; if ($is_disapproving) { - display_reasons($reason_id); + $phpbb_container->get('phpbb.report.report_reason_list_provider')->display_reasons($reason_id); } else { diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index fa2fed842f..45265c89e7 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,28 @@ 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_id' => $report['post_id'], + $post_info[$report['post_id']]['post_subject'] + )); $phpbb_notifications->delete_notifications('notification.type.report_post', $report['post_id']); } } @@ -758,7 +771,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) diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 2217f8fdeb..70794312f4 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -24,15 +24,16 @@ if (!defined('IN_PHPBB')) */ function mcp_topic_view($id, $mode, $action) { - global $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config, $request; global $template, $db, $user, $auth, $cache, $phpbb_container, $phpbb_dispatcher; $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . phpbb_extra_url()); - $user->add_lang('viewtopic'); + /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); + $user->add_lang('viewtopic'); - $topic_id = request_var('t', 0); + $topic_id = $request->variable('t', 0); $topic_info = phpbb_get_topic_data(array($topic_id), false, true); if (!sizeof($topic_info)) @@ -43,16 +44,16 @@ function mcp_topic_view($id, $mode, $action) $topic_info = $topic_info[$topic_id]; // Set up some vars - $icon_id = request_var('icon', 0); - $subject = utf8_normalize_nfc(request_var('subject', '', true)); - $start = request_var('start', 0); - $sort_days_old = request_var('st_old', 0); - $forum_id = request_var('f', 0); - $to_topic_id = request_var('to_topic_id', 0); - $to_forum_id = request_var('to_forum_id', 0); + $icon_id = $request->variable('icon', 0); + $subject = $request->variable('subject', '', true); + $start = $request->variable('start', 0); + $sort_days_old = $request->variable('st_old', 0); + $forum_id = $request->variable('f', 0); + $to_topic_id = $request->variable('to_topic_id', 0); + $to_forum_id = $request->variable('to_forum_id', 0); $sort = isset($_POST['sort']) ? true : false; - $submitted_id_list = request_var('post_ids', array(0)); - $checked_ids = $post_id_list = request_var('post_id_list', array(0)); + $submitted_id_list = $request->variable('post_ids', array(0)); + $checked_ids = $post_id_list = $request->variable('post_id_list', array(0)); // Resync Topic? if ($action == 'resync') @@ -116,15 +117,16 @@ function mcp_topic_view($id, $mode, $action) $sort_by_sql = $sort_order_sql = array(); phpbb_mcp_sorting('viewtopic', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $topic_info['forum_id'], $topic_id, $where_sql); - $limit_time_sql = ($sort_days) ? 'AND p.post_time >= ' . (time() - ($sort_days * 86400)) : ''; + /* @var $phpbb_content_visibility \phpbb\content_visibility */ $phpbb_content_visibility = $phpbb_container->get('content.visibility'); + $limit_time_sql = ($sort_days) ? 'AND p.post_time >= ' . (time() - ($sort_days * 86400)) : ''; if ($total == -1) { $total = $phpbb_content_visibility->get_count('topic_posts', $topic_info, $topic_info['forum_id']); } - $posts_per_page = max(0, request_var('posts_per_page', intval($config['posts_per_page']))); + $posts_per_page = max(0, $request->variable('posts_per_page', intval($config['posts_per_page']))); if ($posts_per_page == 0) { $posts_per_page = $total; @@ -406,11 +408,11 @@ function mcp_topic_view($id, $mode, $action) */ function split_topic($action, $topic_id, $to_forum_id, $subject) { - global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $config; + global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $config, $phpbb_log, $request; - $post_id_list = request_var('post_id_list', array(0)); - $forum_id = request_var('forum_id', 0); - $start = request_var('start', 0); + $post_id_list = $request->variable('post_id_list', array(0)); + $forum_id = $request->variable('forum_id', 0); + $start = $request->variable('start', 0); if (!sizeof($post_id_list)) { @@ -464,7 +466,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) return; } - $redirect = request_var('redirect', build_url(array('quickmod'))); + $redirect = $request->variable('redirect', build_url(array('quickmod'))); $s_hidden_fields = build_hidden_fields(array( 'i' => 'main', @@ -477,7 +479,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) 'redirect' => $redirect, 'subject' => $subject, 'to_forum_id' => $to_forum_id, - 'icon' => request_var('icon', 0)) + 'icon' => $request->variable('icon', 0)) ); $success_msg = $return_link = ''; @@ -540,7 +542,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) trigger_error('NO_POST_SELECTED'); } - $icon_id = request_var('icon', 0); + $icon_id = $request->variable('icon', 0); $sql_ary = array( 'forum_id' => $to_forum_id, @@ -558,8 +560,16 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) $topic_info = phpbb_get_topic_data(array($topic_id)); $topic_info = $topic_info[$topic_id]; - add_log('mod', $to_forum_id, $to_topic_id, 'LOG_SPLIT_DESTINATION', $subject); - add_log('mod', $forum_id, $topic_id, 'LOG_SPLIT_SOURCE', $topic_info['topic_title']); + $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_SPLIT_DESTINATION', false, array( + 'forum_id' => $to_forum_id, + 'topic_id' => $to_topic_id, + $subject + )); + $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_SPLIT_SOURCE', false, array( + 'forum_id' => $forum_id, + 'topic_id' => $topic_id, + $topic_info['topic_title'] + )); // Change topic title of first post $sql = 'UPDATE ' . POSTS_TABLE . " @@ -613,11 +623,11 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) $success_msg = 'TOPIC_SPLIT_SUCCESS'; // Update forum statistics - set_config_count('num_topics', 1, true); + $config->increment('num_topics', 1, false); // Link back to both topics $return_link = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&t=' . $to_topic_id) . '">', '</a>'); - $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); + $redirect = $request->variable('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); $redirect = reapply_sid($redirect); meta_refresh(3, $redirect); @@ -634,7 +644,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) */ function merge_posts($topic_id, $to_topic_id) { - global $db, $template, $user, $phpEx, $phpbb_root_path, $auth; + global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $phpbb_log, $request; if (!$to_topic_id) { @@ -660,8 +670,8 @@ function merge_posts($topic_id, $to_topic_id) $topic_data = $topic_data[$to_topic_id]; - $post_id_list = request_var('post_id_list', array(0)); - $start = request_var('start', 0); + $post_id_list = $request->variable('post_id_list', array(0)); + $start = $request->variable('start', 0); if (!sizeof($post_id_list)) { @@ -674,7 +684,7 @@ function merge_posts($topic_id, $to_topic_id) return; } - $redirect = request_var('redirect', build_url(array('quickmod'))); + $redirect = $request->variable('redirect', build_url(array('quickmod'))); $s_hidden_fields = build_hidden_fields(array( 'i' => 'main', @@ -693,7 +703,12 @@ function merge_posts($topic_id, $to_topic_id) $to_forum_id = $topic_data['forum_id']; move_posts($post_id_list, $to_topic_id, false); - add_log('mod', $to_forum_id, $to_topic_id, 'LOG_MERGE', $topic_data['topic_title']); + + $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_MERGE', false, array( + 'forum_id' => $to_forum_id, + 'topic_id' => $to_topic_id, + $topic_data['topic_title'] + )); // Message and return links $success_msg = 'POSTS_MERGED_SUCCESS'; @@ -732,7 +747,7 @@ function merge_posts($topic_id, $to_topic_id) // Link to the new topic $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&t=' . $to_topic_id) . '">', '</a>'); - $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); + $redirect = $request->variable('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); $redirect = reapply_sid($redirect); meta_refresh(3, $redirect); diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index d724b8703b..d4c5486ed4 100644 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -35,10 +35,10 @@ class mcp_warn function main($id, $mode) { - global $auth, $db, $user, $template; + global $auth, $db, $user, $template, $request; global $config, $phpbb_root_path, $phpEx; - $action = request_var('action', array('' => '')); + $action = $request->variable('action', array('' => '')); if (is_array($action)) { @@ -132,15 +132,16 @@ class mcp_warn function mcp_warn_list_view($action) { global $phpEx, $phpbb_root_path, $config, $phpbb_container; - global $template, $db, $user, $auth; + global $template, $db, $user, $auth, $request; - $user->add_lang('memberlist'); + /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); + $user->add_lang('memberlist'); - $start = request_var('start', 0); - $st = request_var('st', 0); - $sk = request_var('sk', 'b'); - $sd = request_var('sd', 'd'); + $start = $request->variable('start', 0); + $st = $request->variable('st', 0); + $sk = $request->variable('sk', 'b'); + $sd = $request->variable('sd', 'd'); $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 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'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_WARNINGS']); @@ -189,13 +190,13 @@ class mcp_warn */ function mcp_warn_post_view($action) { - global $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config, $request; global $template, $db, $user, $auth, $phpbb_dispatcher; - $post_id = request_var('p', 0); - $forum_id = request_var('f', 0); + $post_id = $request->variable('p', 0); + $forum_id = $request->variable('f', 0); $notify = (isset($_REQUEST['notify_user'])) ? true : false; - $warning = utf8_normalize_nfc(request_var('warning', '', true)); + $warning = $request->variable('warning', '', true); $sql = 'SELECT u.*, p.* FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u @@ -369,13 +370,13 @@ class mcp_warn */ function mcp_warn_user_view($action) { - global $phpEx, $phpbb_root_path, $config, $module; + global $phpEx, $phpbb_root_path, $config, $module, $request; global $template, $db, $user, $auth, $phpbb_dispatcher; - $user_id = request_var('u', 0); - $username = request_var('username', '', true); + $user_id = $request->variable('u', 0); + $username = $request->variable('username', '', true); $notify = (isset($_REQUEST['notify_user'])) ? true : false; - $warning = utf8_normalize_nfc(request_var('warning', '', true)); + $warning = $request->variable('warning', '', true); $sql_where = ($user_id) ? "user_id = $user_id" : "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; @@ -522,7 +523,7 @@ class mcp_warn */ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0) { - global $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config, $phpbb_log; global $template, $db, $user, $auth; if ($send_pm) @@ -556,8 +557,11 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0) submit_pm('post', $user->lang('WARNING_PM_SUBJECT'), $pm_data, false); } - add_log('admin', 'LOG_USER_WARNING', $user_row['username']); - $log_id = add_log('user', $user_row['user_id'], 'LOG_USER_WARNING_BODY', $warning); + $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_WARNING', false, array($user_row['username'])); + $log_id = $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_WARNING_BODY', false, array( + 'reportee_id' => $user_row['user_id'], + $warning + )); $sql_ary = array( 'user_id' => $user_row['user_id'], @@ -582,5 +586,10 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0) $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_USER_WARNING', $user_row['username']); + $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_USER_WARNING', false, array( + 'forum_id' => $row['forum_id'], + 'topic_id' => $row['topic_id'], + 'post_id' => $post_id, + $user_row['username'] + )); } |