diff --git a/phpBB/common.php b/phpBB/common.php index dd4b8f68fa..93e7fde673 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -106,6 +106,11 @@ if (defined('IN_CRON')) $phpbb_root_path = getcwd() . '/'; } +if (!file_exists($phpbb_root_path . 'config.' . $phpEx)) +{ + die("

The config.$phpEx file could not be found.

Click here to install phpBB

"); +} + require($phpbb_root_path . 'config.' . $phpEx); if (!defined('PHPBB_INSTALLED')) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 0c4e5c9afb..7f5e40e8bb 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -872,7 +872,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id 'U_POST_ID' => $row['post_id'], 'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'], - 'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=post_details&p=' . $row['post_id'], true, $user->session_id) : '', + 'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=post_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '', 'U_QUOTE' => ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? 'javascript:addquote(' . $row['post_id'] . ", '" . addslashes($poster) . "')" : '') ); unset($rowset[$i]); @@ -1359,7 +1359,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u case 'edit_first_post': case 'edit': - if (!$auth->acl_gets('m_', 'a_') || $data['post_edit_reason']) + if (!$auth->acl_get('m_edit', $data['forum_id']) || $data['post_edit_reason']) { $sql_data[POSTS_TABLE]['sql'] = array( 'post_edit_time' => $current_time diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index cf2fca1c64..db38df42ae 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -16,8 +16,6 @@ function mcp_front_view($id, $mode, $action) global $phpEx, $phpbb_root_path, $config; global $template, $db, $user, $auth; - $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url()); - // Latest 5 unapproved $forum_list = get_forum_list('m_approve'); $post_list = array(); @@ -39,6 +37,8 @@ function mcp_front_view($id, $mode, $action) if ($total) { + $global_id = $forum_list[0]; + $sql = 'SELECT forum_id, forum_name FROM ' . FORUMS_TABLE . ' WHERE forum_id IN (' . implode(', ', $forum_list) . ')'; @@ -72,15 +72,21 @@ function mcp_front_view($id, $mode, $action) while ($row = $db->sql_fetchrow($result)) { + $global_topic = ($row['forum_id']) ? false : true; + if ($global_topic) + { + $row['forum_id'] = $global_id; + } + $template->assign_block_vars('unapproved', array( - 'U_POST_DETAILS'=> $url . '&i=main&mode=post_details&p=' . $row['post_id'], - 'U_MCP_FORUM' => ($row['forum_id']) ? $url . '&i=main&mode=forum_view&f=' . $row['forum_id'] : '', - 'U_MCP_TOPIC' => $url . '&i=main&mode=topic_view&t=' . $row['topic_id'], - 'U_FORUM' => ($row['forum_id']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '', - 'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&t=' . $row['topic_id']), + 'U_POST_DETAILS'=> append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=post_details&f=' . $row['forum_id'] . '&p=' . $row['post_id']), + 'U_MCP_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=forum_view&f=' . $row['forum_id']) : '', + 'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=topic_view&f=' . $row['forum_id'] . '&t=' . $row['topic_id']), + 'U_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '', + 'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']), 'U_AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['poster_id']), - 'FORUM_NAME' => ($row['forum_id']) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'], + 'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'], 'TOPIC_TITLE' => $row['topic_title'], 'AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? (($row['post_username']) ? $row['post_username'] : $user->lang['GUEST']) : $row['username'], 'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'], @@ -123,6 +129,8 @@ function mcp_front_view($id, $mode, $action) if ($total) { + $global_id = $forum_list[0]; + $sql = $db->sql_build_query('SELECT', array( 'SELECT' => 'r.*, p.post_id, p.post_subject, u.username, t.topic_id, t.topic_title, f.forum_id, f.forum_name', @@ -155,15 +163,21 @@ function mcp_front_view($id, $mode, $action) while ($row = $db->sql_fetchrow($result)) { + $global_topic = ($row['forum_id']) ? false : true; + if ($global_topic) + { + $row['forum_id'] = $global_id; + } + $template->assign_block_vars('report', array( - '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']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '', + 'U_POST_DETAILS'=> append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&p=' . $row['post_id'] . "&i=reports&mode=report_details"), + 'U_MCP_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . "&i=$id&mode=forum_view") : '', + 'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'] . "&i=$id&mode=topic_view"), + 'U_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '', 'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']), 'U_REPORTER' => ($row['user_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), - 'FORUM_NAME' => ($row['forum_id']) ? $row['forum_name'] : $user->lang['POST_GLOBAL'], + 'FORUM_NAME' => (!$global_topic) ? $row['forum_name'] : $user->lang['GLOBAL_ANNOUNCEMENT'], 'TOPIC_TITLE' => $row['topic_title'], 'REPORTER' => ($row['user_id'] == ANONYMOUS) ? $user->lang['GUEST'] : $row['username'], 'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'], @@ -218,8 +232,8 @@ function mcp_front_view($id, $mode, $action) 'S_HAS_LOGS' => (!empty($log)) ? true : false) ); - $template->assign_var('S_MCP_ACTION', $url); - make_jumpbox($url . '&i=main&mode=forum_view', 0, false, 'm_'); + $template->assign_var('S_MCP_ACTION', append_sid("{$phpbb_root_path}mcp.$phpEx")); + make_jumpbox(append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=forum_view'), 0, false, 'm_'); } ?> \ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 755cd52683..9b484e4327 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -101,7 +101,6 @@ function mcp_post_details($id, $mode, $action) $template->assign_vars(array( 'U_MCP_ACTION' => "$url&i=main&quickmod=1", // Use this for mode paramaters 'U_POST_ACTION' => "$url&i=$id&mode=post_details", // Use this for action parameters - 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id"), 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), 'S_CAN_CHGPOSTER' => $auth->acl_get('m_chgposter', $post_info['forum_id']), @@ -114,13 +113,15 @@ function mcp_post_details($id, $mode, $action) 'S_USER_NOTES' => true, 'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false, - 'U_FIND_MEMBER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_chgposter&field=username'), - 'U_VIEW_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $post_info['user_id']), - 'U_MCP_USER_NOTES' => ($auth->acl_gets('m_', 'a_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']) : '', - 'U_MCP_WARN_USER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']) : '', 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '', - - 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '", ''), + 'U_FIND_MEMBER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_chgposter&field=username'), + 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), + 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), + 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']), + 'U_MCP_WARN_USER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']) : '', + 'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $post_info['user_id']) : '', + + 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '", ''), 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '', ''), 'REPORTED_IMG' => $user->img('icon_reported', $user->lang['POST_REPORTED']), 'UNAPPROVED_IMG' => $user->img('icon_unapproved', $user->lang['POST_UNAPPROVED']), diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index f2d82715bc..b817ee962d 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -72,7 +72,14 @@ class mcp_queue if ($topic_id) { $topic_info = get_topic_data(array($topic_id), 'm_approve'); - $post_id = (int) $topic_info[$topic_id]['topic_first_post_id']; + if (isset($topic_info[$topic_id]['topic_first_post_id'])) + { + $post_id = (int) $topic_info[$topic_id]['topic_first_post_id']; + } + else + { + $topic_id = 0; + } } $post_info = get_post_data(array($post_id), 'm_approve'); @@ -117,12 +124,14 @@ class mcp_queue '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, + 'S_USER_NOTES' => true, - 'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $post_info['user_id']) : '', - 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']), - 'U_MCP_WARN_USER' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']), 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '', + 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), + 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), + 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']), + 'U_MCP_WARN_USER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']) : '', + 'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $post_info['user_id']) : '', 'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '", ''), 'REPORTED_IMG' => $user->img('icon_reported', $user->lang['POST_REPORTED']), @@ -177,11 +186,12 @@ class mcp_queue $sql = 'SELECT SUM(forum_topics) as sum_forum_topics FROM ' . FORUMS_TABLE . " - WHERE forum_id IN ($forum_list)"; + WHERE forum_id IN (0, $forum_list)"; $result = $db->sql_query($sql); $forum_info['forum_topics'] = (int) $db->sql_fetchfield('sum_forum_topics'); $db->sql_freeresult($result); + $global_id = $forum_list[0]; } else { @@ -194,6 +204,7 @@ class mcp_queue $forum_info = $forum_info[$forum_id]; $forum_list = $forum_id; + $global_id = $forum_id; } $forum_options = ''; @@ -210,11 +221,13 @@ class mcp_queue $forum_topics = ($total == -1) ? $forum_info['forum_topics'] : $total; $limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : ''; + $forum_names = array(); + if ($mode == 'unapproved_posts') { $sql = 'SELECT p.post_id FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t' . (($sort_order_sql{0} == 'u') ? ', ' . USERS_TABLE . ' u' : '') . " - WHERE p.forum_id IN ($forum_list) + WHERE p.forum_id IN (0, $forum_list) AND p.post_approved = 0 " . (($sort_order_sql{0} == 'u') ? 'AND u.user_id = p.poster_id' : '') . ' ' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . " @@ -234,17 +247,20 @@ class mcp_queue if (sizeof($post_ids)) { - $sql = 'SELECT f.forum_id, f.forum_name, t.topic_id, t.topic_title, p.post_id, p.post_username, p.poster_id, p.post_time, u.username - FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . " u + $sql = 'SELECT t.topic_id, t.topic_title, t.forum_id, p.post_id, p.post_username, p.poster_id, p.post_time, u.username + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . " u WHERE p.post_id IN (" . implode(', ', $post_ids) . ") AND t.topic_id = p.topic_id - AND f.forum_id = p.forum_id AND u.user_id = p.poster_id"; $result = $db->sql_query($sql); $post_data = $rowset = array(); while ($row = $db->sql_fetchrow($result)) { + if ($row['forum_id']) + { + $forum_names[] = $row['forum_id']; + } $post_data[$row['post_id']] = $row; } $db->sql_freeresult($result); @@ -262,11 +278,10 @@ class mcp_queue } else { - $sql = 'SELECT f.forum_id, f.forum_name, t.topic_id, t.topic_title, t.topic_time AS post_time, t.topic_poster AS poster_id, t.topic_first_post_id AS post_id, t.topic_first_poster_name AS username - FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f - WHERE t.topic_approved = 0 - AND t.forum_id IN ($forum_list) - AND f.forum_id = t.forum_id + $sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_time AS post_time, t.topic_poster AS poster_id, t.topic_first_post_id AS post_id, t.topic_first_poster_name AS username + FROM ' . TOPICS_TABLE . " t + WHERE topic_approved = 0 + AND forum_id IN (0, $forum_list) $limit_time_sql ORDER BY $sort_order_sql"; $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); @@ -274,11 +289,30 @@ class mcp_queue $rowset = array(); while ($row = $db->sql_fetchrow($result)) { + if ($row['forum_id']) + { + $forum_names[] = $row['forum_id']; + } $rowset[] = $row; } $db->sql_freeresult($result); } + if (sizeof($forum_names)) + { + // Select the names for the forum_ids + $sql = 'SELECT forum_id, forum_name + FROM ' . FORUMS_TABLE . ' + WHERE forum_id IN (' . implode(',', $forum_names) . ')'; + $result = $db->sql_query($sql, 3600); + + $forum_names = array(); + while ($row = $db->sql_fetchrow($result)) + { + $forum_names[$row['forum_id']] = $row['forum_name']; + } + } + foreach ($rowset as $row) { if ($row['poster_id'] == ANONYMOUS) @@ -292,15 +326,21 @@ class mcp_queue $s_checkbox = ''; + $global_topic = ($row['forum_id']) ? false : true; + if ($global_topic) + { + $row['forum_id'] = $global_id; + } + $template->assign_block_vars('postrow', array( - 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']), + 'U_VIEWFORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", '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_VIEWTOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&p=' . $row['post_id']) . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''), - 'U_VIEW_DETAILS'=> append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&start=$start&mode=approve_details&f={$forum_id}&p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&t={$row['topic_id']}" : '')), + 'U_VIEW_DETAILS'=> append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&start=$start&mode=approve_details&f={$row['forum_id']}&p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&t={$row['topic_id']}" : '')), 'U_VIEWPROFILE' => ($row['poster_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['poster_id']) : '', - 'FORUM_NAME' => $row['forum_name'], + 'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'], 'TOPIC_TITLE' => $row['topic_title'], 'POSTER' => $poster, 'POST_TIME' => $user->format_date($row['post_time']), @@ -308,6 +348,7 @@ class mcp_queue ); } unset($rowset); + unset($forum_names); // Now display the page $template->assign_vars(array( @@ -558,7 +599,7 @@ function disapprove_post($post_id_list, $mode) trigger_error('NOT_AUTHORIZED'); } - $redirect = request_var('redirect', $user->data['session_page']); + $redirect = request_var('redirect', build_url(array('t', 'mode')) . '&mode=unapproved_topics'); $reason = request_var('reason', '', true); $reason_id = request_var('reason_id', 0); $success_msg = $additional_msg = ''; diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index 3920490114..f62bb88d28 100755 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -124,15 +124,17 @@ class mcp_reports '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, + 'S_USER_NOTES' => true, - 'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $post_info['user_id']) : '', - 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']), - 'U_MCP_WARN_USER' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']), - 'U_VIEW_REPORTER_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $report['user_id']), - 'U_MCP_REPORTER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $report['user_id']), - 'U_MCP_WARN_REPORTER' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $report['user_id']), 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '', + 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), + 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), + 'U_MCP_REPORTER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $report['user_id']), + 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']), + 'U_MCP_WARN_REPORTER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $report['user_id']) : '', + 'U_MCP_WARN_USER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']) : '', + 'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $post_info['user_id']) : '', + 'U_VIEW_REPORTER_PROFILE' => ($report['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $report['user_id']) : '', 'EDIT_IMG' => $user->img('btn_edit', $user->lang['EDIT_POST']), @@ -164,7 +166,7 @@ class mcp_reports $topic_id = request_var('t', 0); $forum_info = array(); - $forum_list_reports = get_forum_list('m_report', false, true); /** @todo m_reports? **/ + $forum_list_reports = get_forum_list('m_report', false, true); if ($topic_id) { @@ -406,12 +408,11 @@ function close_report($post_id_list, $mode, $action) $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'; + $sql = 'SELECT DISTINCT topic_id + FROM ' . POSTS_TABLE . ' + WHERE topic_id IN (' . implode(', ', $close_report_topics) . ') + AND post_reported = 1 + AND post_id NOT IN (' . implode(', ', $close_report_posts) . ')'; $result = $db->sql_query($sql); $keep_report_topics = array(); diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 4b092a7bd0..7f290a5f03 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -141,8 +141,8 @@ function mcp_topic_view($id, $mode, $action) 'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true, 'U_POST_DETAILS' => "$url&i=$id&p={$row['post_id']}&mode=post_details", - 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=unapproved_posts&action=approve&post_id_list[]=' . $row['post_id']), - 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&p=' . $row['post_id'])) + 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $topic_info['forum_id'] . '&p=' . $row['post_id']), + 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $topic_info['forum_id'] . '&p=' . $row['post_id'])) ); unset($rowset[$i]); diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 3d92f159fa..798199bdbd 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -345,7 +345,7 @@ $lang = array_merge($lang, array( 'POST_REPORTED' => 'Click to view report', 'POST_SUBJECT' => 'Post subject', 'POST_TIME' => 'Post time', - 'POST_UNAPPROVED' => 'Click to approve post', + 'POST_UNAPPROVED' => 'This post is waiting for approval', 'PREVIEW' => 'Preview', 'PREVIOUS' => 'Previous', 'PRIVACY' => 'Privacy policy', diff --git a/phpBB/mcp.php b/phpBB/mcp.php index acff846df7..1ecdabbf24 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -126,6 +126,12 @@ if (!$auth->acl_getf_global('m_')) } } +// if the user cannot read the forum he tries to access then we won't allow mcp access either +if ($forum_id && !$auth->acl_get('f_read', $forum_id)) +{ + trigger_error($user->lang['NOT_AUTHORIZED']); +} + if ($forum_id) { $module->acl_forum_id = $forum_id; diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 6fe3bf1116..251c4c3153 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1230,7 +1230,7 @@ function show_profile($data) 'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $user_id), 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$user_id&sr=posts") : '', - 'U_NOTES' => $auth->acl_gets('m_', 'a_') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $user_id, true, $user->session_id) : '', + 'U_NOTES' => $auth->acl_getf_global('m_') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $user_id, true, $user->session_id) : '', 'U_WARN' => $auth->acl_getf_global('m_warn') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $user_id, true, $user->session_id) : '', 'U_PM' => ($auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $user_id) : '', 'U_EMAIL' => $email, diff --git a/phpBB/styles/subSilver/template/login_body.html b/phpBB/styles/subSilver/template/login_body.html index 0f25b910c5..3c344e64cd 100644 --- a/phpBB/styles/subSilver/template/login_body.html +++ b/phpBB/styles/subSilver/template/login_body.html @@ -45,11 +45,11 @@   - {L_LOG_ME_IN} + {L_LOG_ME_IN}   - {L_HIDE_ME} + {L_HIDE_ME} @@ -73,7 +73,7 @@ - {S_HIDDEN_FIELDS} + {S_HIDDEN_FIELDS} diff --git a/phpBB/styles/subSilver/template/mcp_post.html b/phpBB/styles/subSilver/template/mcp_post.html index fd25f6f663..f5e85d44c1 100644 --- a/phpBB/styles/subSilver/template/mcp_post.html +++ b/phpBB/styles/subSilver/template/mcp_post.html @@ -43,7 +43,7 @@ {L_POST_SUBJECT}: - {POST_SUBJECT} + {POST_SUBJECT} {UNAPPROVED_IMG} {L_POST_UNAPPROVED} {REPORTED_IMG} {L_POST_REPORTED} {L_POSTER}: diff --git a/phpBB/styles/subSilver/template/mcp_queue.html b/phpBB/styles/subSilver/template/mcp_queue.html index 4fb3a5b795..1cd5b71f52 100644 --- a/phpBB/styles/subSilver/template/mcp_queue.html +++ b/phpBB/styles/subSilver/template/mcp_queue.html @@ -5,7 +5,7 @@ {L_DISPLAY_OPTIONS} - {L_DISPLAY_ITEMS}: {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} {L_FORUM}     {L_ONLY_TOPIC}   + {L_DISPLAY_ITEMS}: {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} {L_FORUM}     {L_ONLY_TOPIC}    {L_TOPIC}  @@ -16,7 +16,7 @@

{postrow.TOPIC_TITLE}

- {L_FORUM}: {postrow.FORUM_NAME} + {L_FORUM}: {postrow.FORUM_NAME}{postrow.FORUM_NAME} {postrow.POSTER}{postrow.POSTER}
[ {L_VIEW_DETAILS} ] {postrow.POST_TIME} diff --git a/phpBB/styles/subSilver/template/mcp_reports.html b/phpBB/styles/subSilver/template/mcp_reports.html index 499db2bda5..885302643c 100644 --- a/phpBB/styles/subSilver/template/mcp_reports.html +++ b/phpBB/styles/subSilver/template/mcp_reports.html @@ -5,7 +5,7 @@ {L_DISPLAY_OPTIONS} - {L_DISPLAY_POSTS}: {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} {L_FORUM}     {L_ONLY_TOPIC}   + {L_DISPLAY_POSTS}: {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} {L_FORUM}     {L_ONLY_TOPIC}    {L_POST}  diff --git a/phpBB/styles/subSilver/template/mcp_topic.html b/phpBB/styles/subSilver/template/mcp_topic.html index 5c8ad3c15a..348d900e64 100644 --- a/phpBB/styles/subSilver/template/mcp_topic.html +++ b/phpBB/styles/subSilver/template/mcp_topic.html @@ -98,15 +98,10 @@ - - - - - - - - - + diff --git a/phpBB/styles/subSilver/template/viewtopic_body.html b/phpBB/styles/subSilver/template/viewtopic_body.html index e27f37c2b7..fcda0750c4 100644 --- a/phpBB/styles/subSilver/template/viewtopic_body.html +++ b/phpBB/styles/subSilver/template/viewtopic_body.html @@ -188,7 +188,7 @@
{UNAPPROVED_IMG} {L_POST_UNAPPROVED}  {REPORTED_IMG} {L_POST_REPORTED}   + {UNAPPROVED_IMG} {L_POST_UNAPPROVED} + {REPORTED_IMG}{L_POST_REPORTED} + {postrow.MINI_POST_IMG} {L_POSTED}: {postrow.POST_DATE}
- +
» {L_POST_UNAPPROVED} » {L_POST_REPORTED}{UNAPPROVED_IMG} {L_POST_UNAPPROVED} {REPORTED_IMG} {L_POST_REPORTED}
diff --git a/phpBB/styles/subSilver/theme/stylesheet.css b/phpBB/styles/subSilver/theme/stylesheet.css index d7b5ba2440..2dcc6687f6 100644 --- a/phpBB/styles/subSilver/theme/stylesheet.css +++ b/phpBB/styles/subSilver/theme/stylesheet.css @@ -172,13 +172,17 @@ p.topicauthor { p.topicdetails { margin: 1px 0px; } -p.postreported { +.postreported, .postreported a:visited, .postreported a:hover, .postreported a:link, .postreported a:active { margin: 1px 0px; color: red; + font-weight:bold; } -p.postapprove { - margin: 1px 0px; +.postapprove, .postapprove a:visited, .postapprove a:hover, .postapprove a:link, .postapprove a:active { color: green; + font-weight:bold; + } +.postapprove img, .postreported img { + vertical-align: bottom; } .postauthor { diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index b2d3a35ba9..13774c1732 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -273,7 +273,7 @@ $template->assign_vars(array( 'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", 'fid[]=' . $forum_id), 'S_SINGLE_MODERATOR' => (!empty($moderators[$forum_id]) && sizeof($moderators[$forum_id]) > 1) ? false : true, - 'U_MCP' => ($auth->acl_gets('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&i=main&mode=forum_view", true, $user->session_id) : '', + 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&i=main&mode=forum_view", true, $user->session_id) : '', 'U_POST_NEW_TOPIC' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=post&f=' . $forum_id), 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&$u_sort_param&start=$start"), 'U_MARK_TOPICS' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&mark=topics")) @@ -475,8 +475,8 @@ if (sizeof($topic_list)) // Generate all the URIs ... $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&t=' . $topic_id); - $topic_unapproved = (!$row['topic_approved'] && $auth->acl_gets('m_approve', $forum_id)) ? true : false; - $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_gets('m_approve', $forum_id)) ? true : false; + $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $forum_id)) ? true : false; + $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $forum_id)) ? true : false; $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$topic_id", true, $user->session_id) : ''; // Send vars to template @@ -505,7 +505,7 @@ if (sizeof($topic_list)) 'S_TOPIC_TYPE' => $row['topic_type'], '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_report', $forum_id)) ? true : false, + 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $forum_id)) ? true : false, 'S_TOPIC_UNAPPROVED' => $topic_unapproved, 'S_POSTS_UNAPPROVED' => $posts_unapproved, 'S_HAS_POLL' => ($row['poll_start']) ? true : false, diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 17d5346222..771bfee814 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1340,7 +1340,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'U_EDIT' => (($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - $config['edit_time'] || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f=$forum_id&p={$row['post_id']}") : '', 'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f=$forum_id&p={$row['post_id']}") : '', - 'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=post_details&p=' . $row['post_id'], true, $user->session_id) : '', + 'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=post_details&f=$forum_id&p=" . $row['post_id'], true, $user->session_id) : '', 'U_DELETE' => (($user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id'] && ($row['post_time'] > time() - $config['edit_time'] || !$config['edit_time'])) || $auth->acl_get('m_delete', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&f=$forum_id&p={$row['post_id']}") : '', 'U_PROFILE' => $user_cache[$poster_id]['profile'], @@ -1355,13 +1355,13 @@ 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)) ? append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&p=' . $row['post_id']) : '', - 'U_MCP_REPORT' => ($auth->acl_gets('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '', - 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=unapproved_posts&action=approve&post_id_list[]=' . $row['post_id'], true, $user->session_id) : '', + 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '', + 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '', 'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'], 'U_NEXT_POST_ID' => ($i < $i_total && isset($rowset[$post_list[$i + 1]])) ? $rowset[$post_list[$i + 1]]['post_id'] : '', 'U_PREV_POST_ID' => $prev_post_id, - 'U_NOTES' => ($auth->acl_gets('m_', 'a_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $poster_id, true, $user->session_id) : '', - 'U_WARN' => ($auth->acl_gets('m_', 'a_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_post&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '', + 'U_NOTES' => ($auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $poster_id, true, $user->session_id) : '', + 'U_WARN' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_post&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '', 'POST_ID' => $row['post_id'],