aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2006-05-30 12:24:07 +0000
committerNils Adermann <naderman@naderman.de>2006-05-30 12:24:07 +0000
commitea04b3bcbc12d0eaa6443ab509922495755b1244 (patch)
treea81a045323d6364514812ea54b8d41f1e0613194 /phpBB
parent74799e168de336d6aaddb43606772282c3319e09 (diff)
downloadforums-ea04b3bcbc12d0eaa6443ab509922495755b1244.tar
forums-ea04b3bcbc12d0eaa6443ab509922495755b1244.tar.gz
forums-ea04b3bcbc12d0eaa6443ab509922495755b1244.tar.bz2
forums-ea04b3bcbc12d0eaa6443ab509922495755b1244.tar.xz
forums-ea04b3bcbc12d0eaa6443ab509922495755b1244.zip
- various corrections related to permissions in the mcp, including [Bug #1994] and [Bug #1924]
- fixed some quickmod bugs [#1994] and [Bug #1898] - browse reports/unapproved posts by topic id - correctly hide approval details - added return message to mcp_ban [Bug #1851] - adjusted some links, including [Bug #1855] - added some missing language variables, including [Bug #1824], [Bug #1841], [Bug #1852] and [Bug #1864] - always show all options in mcp_topic [Bug #1938] git-svn-id: file:///svn/phpbb/trunk@5986 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/index.php3
-rw-r--r--phpBB/includes/functions_posting.php2
-rw-r--r--phpBB/includes/mcp/info/mcp_logs.php2
-rw-r--r--phpBB/includes/mcp/info/mcp_main.php2
-rw-r--r--phpBB/includes/mcp/info/mcp_queue.php6
-rw-r--r--phpBB/includes/mcp/info/mcp_reports.php6
-rw-r--r--phpBB/includes/mcp/info/mcp_warn.php8
-rw-r--r--phpBB/includes/mcp/mcp_ban.php4
-rw-r--r--phpBB/includes/mcp/mcp_main.php4
-rw-r--r--phpBB/includes/mcp/mcp_queue.php23
-rwxr-xr-xphpBB/includes/mcp/mcp_reports.php22
-rw-r--r--phpBB/includes/mcp/mcp_topic.php14
-rw-r--r--phpBB/index.php2
-rw-r--r--phpBB/language/en/common.php16
-rw-r--r--phpBB/language/en/mcp.php3
-rw-r--r--phpBB/mcp.php102
-rw-r--r--phpBB/styles/subSilver/template/mcp_queue.html2
-rw-r--r--phpBB/styles/subSilver/template/mcp_reports.html2
-rw-r--r--phpBB/styles/subSilver/template/mcp_topic.html4
-rw-r--r--phpBB/viewtopic.php10
20 files changed, 171 insertions, 66 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php
index cf04f53991..29d6539f80 100644
--- a/phpBB/adm/index.php
+++ b/phpBB/adm/index.php
@@ -199,7 +199,8 @@ function adm_page_footer($copyright_html = true)
function adm_back_link($u_action)
{
- return '<br /><br /><a href="' . $u_action . '">&laquo; Back to previous page</a>';
+ global $user;
+ return '<br /><br /><a href="' . $u_action . '">&laquo; ' . $user->lang['BACK_TO_PREV'] . '</a>';
}
function build_select($option_ary, $option_default = false)
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index b4b44b8c16..914e4bd7a8 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -858,7 +858,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
'U_POST_ID' => $row['post_id'],
'U_MINI_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;p=" . $row['post_id'] . '#p' . $row['post_id'],
- 'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&amp;mode=post_details&amp;p=" . $row['post_id'] : '',
+ 'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=main&amp;mode=post_details&amp;p=" . $row['post_id'] : '',
'U_QUOTE' => ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? 'javascript:addquote(' . $row['post_id'] . ", '" . addslashes($poster) . "')" : '')
);
unset($rowset[$i]);
diff --git a/phpBB/includes/mcp/info/mcp_logs.php b/phpBB/includes/mcp/info/mcp_logs.php
index e2df64eb80..5c3764a615 100644
--- a/phpBB/includes/mcp/info/mcp_logs.php
+++ b/phpBB/includes/mcp/info/mcp_logs.php
@@ -20,7 +20,7 @@ class mcp_logs_info
'title' => 'MCP_LOGS',
'version' => '1.0.0',
'modes' => array(
- 'front' => array('title' => 'MCP_LOGS_FRONT', 'auth' => '', 'cat' => array('MCP_LOGS')),
+ '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')),
'topic_logs' => array('title' => 'MCP_LOGS_TOPIC_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 283c88b1a0..0aafc8738a 100644
--- a/phpBB/includes/mcp/info/mcp_main.php
+++ b/phpBB/includes/mcp/info/mcp_main.php
@@ -20,7 +20,7 @@ class mcp_main_info
'title' => 'MCP_MAIN',
'version' => '1.0.0',
'modes' => array(
- 'front' => array('title' => 'MCP_MAIN_FRONT', 'auth' => 'acl_m_', 'cat' => array('MCP_MAIN')),
+ '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')),
'topic_view' => array('title' => 'MCP_MAIN_TOPIC_VIEW', 'auth' => 'acl_m_,$id', 'cat' => array('MCP_MAIN')),
'post_details' => array('title' => 'MCP_MAIN_POST_DETAILS', 'auth' => 'acl_m_,$id', 'cat' => array('MCP_MAIN')),
diff --git a/phpBB/includes/mcp/info/mcp_queue.php b/phpBB/includes/mcp/info/mcp_queue.php
index fd20748d9e..ee0b20fecd 100644
--- a/phpBB/includes/mcp/info/mcp_queue.php
+++ b/phpBB/includes/mcp/info/mcp_queue.php
@@ -20,9 +20,9 @@ class mcp_queue_info
'title' => 'MCP_QUEUE',
'version' => '1.0.0',
'modes' => array(
- 'unapproved_topics' => array('title' => 'MCP_QUEUE_UNAPPROVED_TOPICS', 'auth' => 'acl_m_approve || aclf_m_approve', 'cat' => array('MCP_QUEUE')),
- 'unapproved_posts' => array('title' => 'MCP_QUEUE_UNAPPROVED_POSTS', 'auth' => 'acl_m_approve || aclf_m_approve', 'cat' => array('MCP_QUEUE')),
- 'approve_details' => array('title' => 'MCP_QUEUE_APPROVE_DETAILS', 'auth' => 'acl_m_approve || aclf_m_approve', 'cat' => array('MCP_QUEUE')),
+ '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')),
+ 'approve_details' => array('title' => 'MCP_QUEUE_APPROVE_DETAILS', '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 c56ed70604..8587094727 100644
--- a/phpBB/includes/mcp/info/mcp_reports.php
+++ b/phpBB/includes/mcp/info/mcp_reports.php
@@ -20,9 +20,9 @@ class mcp_reports_info
'title' => 'MCP_REPORTS',
'version' => '1.0.0',
'modes' => array(
- 'reports' => array('title' => 'MCP_REPORTS_OPEN', 'auth' => 'acl_m_report ||aclf_m_report', 'cat' => array('MCP_REPORTS')),
- 'reports_closed' => array('title' => 'MCP_REPORTS_CLOSED', 'auth' => 'acl_m_report || aclf_m_report', 'cat' => array('MCP_REPORTS')),
- 'report_details' => array('title' => 'MCP_REPORT_DETAILS', 'auth' => 'acl_m_report || aclf_m_report', 'cat' => array('MCP_REPORTS')),
+ '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')),
+ 'report_details' => array('title' => 'MCP_REPORT_DETAILS', '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 bf169a7854..f04a59cb4b 100644
--- a/phpBB/includes/mcp/info/mcp_warn.php
+++ b/phpBB/includes/mcp/info/mcp_warn.php
@@ -20,10 +20,10 @@ class mcp_warn_info
'title' => 'MCP_WARN',
'version' => '1.0.0',
'modes' => array(
- 'front' => array('title' => 'MCP_WARN_FRONT', 'auth' => '', 'cat' => array('MCP_WARN')),
- 'list' => array('title' => 'MCP_WARN_LIST', 'auth' => '', 'cat' => array('MCP_WARN')),
- 'warn_user' => array('title' => 'MCP_WARN_USER', 'auth' => '', 'cat' => array('MCP_WARN')),
- 'warn_post' => array('title' => 'MCP_WARN_POST', 'auth' => 'acl_m_,$id', 'cat' => array('MCP_WARN')),
+ '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')),
+ 'warn_user' => array('title' => 'MCP_WARN_USER', 'auth' => 'acl_m_warn', 'cat' => array('MCP_WARN')),
+ 'warn_post' => array('title' => 'MCP_WARN_POST', 'auth' => 'acl_m_warn,$id', 'cat' => array('MCP_WARN')),
),
);
}
diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php
index b79bbe00d7..7d1050f265 100644
--- a/phpBB/includes/mcp/mcp_ban.php
+++ b/phpBB/includes/mcp/mcp_ban.php
@@ -45,7 +45,7 @@ class mcp_ban
user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason);
- trigger_error($user->lang['BAN_UPDATE_SUCESSFUL']);
+ trigger_error($user->lang['BAN_UPDATE_SUCESSFUL'] . '<br /><br /><a href="' . $this->u_action . '">&laquo; ' . $user->lang['BACK_TO_PREV'] . '</a>');
}
else if ($unbansubmit)
{
@@ -53,7 +53,7 @@ class mcp_ban
user_unban($mode, $ban);
- trigger_error($user->lang['BAN_UPDATE_SUCESSFUL']);
+ trigger_error($user->lang['BAN_UPDATE_SUCESSFUL'] . '<br /><br /><a href="' . $this->u_action . '">&laquo; ' . $user->lang['BACK_TO_PREV'] . '</a>');
}
// Ban length options
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index 25699fa2c6..60ff2cf9d3 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -210,7 +210,7 @@ function lock_unlock($action, $ids)
$l_prefix = 'POST';
}
- if (!($forum_id = check_ids($ids, $table, $sql_id, 'm_lock')))
+ if (!($forum_id = check_ids($ids, $table, $sql_id, array('f_user_lock', 'm_lock'))))
{
return;
}
@@ -266,7 +266,7 @@ function change_topic_type($action, $topic_ids)
{
global $auth, $user, $db, $SID, $phpEx, $phpbb_root_path;
- if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_')))
+ if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('f_announce', 'f_sticky', 'm_'))))
{
return;
}
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 7e8dc6760a..9e7da838b5 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -142,8 +142,22 @@ class mcp_queue
case 'unapproved_topics':
case 'unapproved_posts':
+ $topic_id = request_var('t', 0);
$forum_info = array();
+ if ($topic_id)
+ {
+ $topic_info = get_topic_data(array($topic_id));
+
+ if (!sizeof($topic_info))
+ {
+ trigger_error($user->lang['TOPIC_NOT_EXIST']);
+ }
+
+ $topic_info = $topic_info[$topic_id];
+ $forum_id = $topic_info['forum_id'];
+ }
+
$forum_list_approve = get_forum_list('m_approve', false, true);
if (!$forum_id)
@@ -189,7 +203,7 @@ class mcp_queue
$sort_days = $total = 0;
$sort_key = $sort_dir = '';
$sort_by_sql = $sort_order_sql = array();
- mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id);
+ mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id);
$forum_topics = ($total == -1) ? $forum_info['forum_topics'] : $total;
$limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : '';
@@ -200,7 +214,8 @@ class mcp_queue
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t' . (($sort_order_sql{0} == 'u') ? ', ' . USERS_TABLE . ' u' : '') . "
WHERE p.forum_id IN ($forum_list)
AND p.post_approved = 0
- " . (($sort_order_sql{0} == 'u') ? 'AND u.user_id = p.poster_id' : '') . "
+ " . (($sort_order_sql{0} == 'u') ? 'AND u.user_id = p.poster_id' : '') . '
+ ' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . "
AND t.topic_id = p.topic_id
AND t.topic_first_post_id <> p.post_id
$limit_time_sql
@@ -295,10 +310,14 @@ class mcp_queue
// Now display the page
$template->assign_vars(array(
'L_DISPLAY_ITEMS' => ($mode == 'unapproved_posts') ? $user->lang['DISPLAY_POSTS'] : $user->lang['DISPLAY_TOPICS'],
+ 'L_ONLY_TOPIC' => ($topic_id) ? sprintf($user->lang['ONLY_TOPIC'], $topic_info['topic_title']) : '',
+
'S_FORUM_OPTIONS' => $forum_options,
+ 'S_MCP_ACTION' => build_url(array('t', 'f', 'sd', 'st', 'sk')),
'PAGINATION' => generate_pagination("{$phpbb_root_path}mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;f=$forum_id", $total, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
+ 'TOPIC_ID' => $topic_id,
'TOTAL' => $total)
);
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index f40ef0632c..9c5311b72d 100755
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -239,9 +239,9 @@ class mcp_reports
WHERE p.forum_id IN ($forum_list)
$report_state
AND r.post_id = p.post_id
- " . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . "
- " . (($sort_order_sql[0] == 'r') ? 'AND ru.user_id = p.poster_id' : '') . "
- " . (($topic_id) ? "AND p.topic_id = $topic_id" : '') . "
+ " . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . '
+ ' . (($sort_order_sql[0] == 'r') ? 'AND ru.user_id = p.poster_id' : '') . '
+ ' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . "
AND t.topic_id = p.topic_id
$limit_time_sql
ORDER BY $sort_order_sql";
@@ -291,7 +291,9 @@ class mcp_reports
$template->assign_block_vars('postrow', array(
'U_VIEWFORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&amp;f=" . $row['forum_id'],
- 'U_VIEWTOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;f=" . $row['forum_id'] . '&amp;t=' . $row['topic_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' => "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;f=" . $row['forum_id'] . '&amp;p=' . $row['post_id'] . '#p' . $row['post_id'],
'U_VIEW_DETAILS' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=reports&amp;start=$start&amp;mode=report_details&amp;f={$forum_id}&amp;p={$row['post_id']}",
'U_VIEW_POSTER_PROFILE' => ($row['poster_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u={$row['poster_id']}" : '',
'U_VIEW_REPORTER_PROFILE' => ($row['reporter_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u={$row['reporter_id']}" : '',
@@ -312,12 +314,16 @@ class mcp_reports
// Now display the page
$template->assign_vars(array(
+ 'L_ONLY_TOPIC' => ($topic_id) ? sprintf($user->lang['ONLY_TOPIC'], $topic_info['topic_title']) : '',
+
+ 'S_MCP_ACTION' => build_url(array('t', 'f', 'sd', 'st', 'sk')),
+ 'S_FORUM_OPTIONS' => $forum_options,
+ 'S_CLOSED' => ($mode == 'reports_closed') ? true : false,
+
'PAGINATION' => generate_pagination("{$phpbb_root_path}mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;f=$forum_id&amp;t=$topic_id", $total, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
- 'TOTAL' => $total,
- 'S_MCP_ACTION' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;t=0",
- 'S_FORUM_OPTIONS' => $forum_options,
- 'S_CLOSED' => ($mode == 'reports_closed') ? true : false)
+ 'TOPIC_ID' => $topic_id,
+ 'TOTAL' => $total)
);
$this->tpl_name = 'mcp_reports';
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index b8fbfd3bae..cf3d72303f 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -119,7 +119,7 @@ function mcp_topic_view($id, $mode, $action)
$message = str_replace("\n", '<br />', $message);
$checked = ($post_id_list && in_array(intval($row['post_id']), $post_id_list)) ? 'checked="checked" ' : '';
- $s_checkbox = ($row['post_id'] == $topic_info['topic_first_post_id'] && $action == 'split') ? '&nbsp;' : '<input type="checkbox" name="post_id_list[]" value="' . $row['post_id'] . '" ' . $checked . '/>';
+ $s_checkbox = '<input type="checkbox" name="post_id_list[]" value="' . $row['post_id'] . '" ' . $checked . '/>';
if (!$row['post_approved'])
{
@@ -141,7 +141,8 @@ function mcp_topic_view($id, $mode, $action)
'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true,
'U_POST_DETAILS' => "$url&amp;i=$id&amp;p={$row['post_id']}&amp;mode=post_details",
- 'U_MCP_APPROVE' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=queue&amp;mode=unapproved_posts&amp;action=approve&amp;post_id_list[]=" . $row['post_id'])
+ 'U_MCP_APPROVE' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=queue&amp;mode=unapproved_posts&amp;action=approve&amp;post_id_list[]=" . $row['post_id'],
+ 'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=reports&amp;mode=report_details&amp;p=" . $row['post_id'])
);
unset($rowset[$i]);
@@ -185,15 +186,15 @@ function mcp_topic_view($id, $mode, $action)
'SPLIT_SUBJECT' => $subject,
'POSTS_PER_PAGE' => $posts_per_page,
- 'MODE' => $mode,
+ 'ACTION' => $action,
'REPORTED_IMG' => $user->img('icon_reported', 'POST_REPORTED', false, true),
'UNAPPROVED_IMG' => $user->img('icon_unapproved', 'POST_UNAPPROVED', false, true),
'S_MCP_ACTION' => "$url&amp;i=$id&amp;mode=$mode&amp;action=$action&amp;start=$start",
'S_FORUM_SELECT' => '<select name="to_forum_id">' . (($to_forum_id) ? make_forum_select($to_forum_id) : make_forum_select($topic_info['forum_id'])) . '</select>',
- 'S_CAN_SPLIT' => ($auth->acl_get('m_split', $topic_info['forum_id']) && $action != 'merge') ? true : false,
- 'S_CAN_MERGE' => ($auth->acl_get('m_merge', $topic_info['forum_id']) && $action != 'split') ? true : false,
+ 'S_CAN_SPLIT' => ($auth->acl_get('m_split', $topic_info['forum_id'])) ? true : false,
+ 'S_CAN_MERGE' => ($auth->acl_get('m_merge', $topic_info['forum_id'])) ? true : false,
'S_CAN_DELETE' => ($auth->acl_get('m_delete', $topic_info['forum_id'])) ? true : false,
'S_CAN_APPROVE' => ($has_unapproved_posts && $auth->acl_get('m_approve', $topic_info['forum_id'])) ? true : false,
'S_CAN_LOCK' => ($auth->acl_get('m_lock', $topic_info['forum_id'])) ? true : false,
@@ -225,7 +226,8 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
if (!sizeof($post_id_list))
{
- trigger_error('NO_POST_SELECTED');
+ $template->assign_var('MESSAGE', $user->lang['NO_POST_SELECTED']);
+ return;
}
if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_split')))
diff --git a/phpBB/index.php b/phpBB/index.php
index d201e763da..81fe6aa356 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -90,7 +90,7 @@ $template->assign_vars(array(
'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false,
'U_MARK_FORUMS' => "{$phpbb_root_path}index.$phpEx$SID&amp;mark=forums",
- 'U_MCP' => ($auth->acl_get('m_')) ? "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=main&amp;mode=front" : '')
+ 'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=main&amp;mode=front" : '')
);
// Output page
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 97969eb714..db08e2ff6b 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -76,6 +76,7 @@ $lang = array_merge($lang, array(
'AVATAR_WRONG_SIZE' => 'The avatar must be at least %1$d pixels wide, %2$d pixels high and at most %3$d pixels wide and %4$d pixels high. The submitted avatar is %5$d pixels wide and %6$d pixels high.',
'BACK_TO_TOP' => 'Top',
+ 'BACK_TO_PREV' => 'Back to previous page',
'BBCODE_GUIDE' => 'BBCode Guide',
'BCC' => 'Bcc',
'BIRTHDAYS' => 'Birthdays',
@@ -154,6 +155,19 @@ $lang = array_merge($lang, array(
'FORUM_RULES_LINK' => 'Please click to view the forum rules',
'FROM' => 'from',
+ 'FTP_FSOCK_HOST' => 'FTP Host',
+ 'FTP_FSOCK_HOST_EXPLAIN' => 'FTP Server used to connect your site',
+ 'FTP_FSOCK_PASSWORD' => 'FTP Password',
+ 'FTP_FSOCK_PASSWORD_EXPLAIN' => 'Password for your FTP Username',
+ 'FTP_FSOCK_PORT' => 'FTP Port',
+ 'FTP_FSOCK_PORT_EXPLAIN' => 'Port used to connect to your server',
+ 'FTP_FSOCK_ROOT_PATH' => 'Path to phpBB',
+ 'FTP_FSOCK_ROOT_PATH_EXPLAIN' => 'Path from the root to your phpBB board',
+ 'FTP_FSOCK_TIMEOUT' => 'FTP Timeout',
+ 'FTP_FSOCK_TIMEOUT_EXPLAIN' => 'The amount of time, in seconds, that the system will wait for a reply from your server',
+ 'FTP_FSOCK_USERNAME' => 'FTP Username',
+ 'FTP_FSOCK_USERNAME_EXPLAIN' => 'Username used to connect to your server',
+
'FTP_HOST' => 'FTP Host',
'FTP_HOST_EXPLAIN' => 'FTP Server used to connect your site',
'FTP_PASSWORD' => 'FTP Password',
@@ -236,6 +250,7 @@ $lang = array_merge($lang, array(
'LOGIN_FORUM' => 'To view or post in this forum you must enter a password.',
'LOGIN_INFO' => 'In order to login you must be registered. Registering takes only a few seconds but gives you increased capabilies. The board administrator may also grant additional permissions to registered users. Before you login please ensure you are familiar with our terms of use and related policies. Please ensure you read any forum rules as you navigate around the board.',
'LOGIN_VIEWFORUM' => 'The board administrator requires you to be registered and logged in to view this forum.',
+ 'LOGIN_EXPLAIN_EDIT' => 'In order to edit posts in this forum you have to be registered and logged in.',
'LOGOUT' => 'Logout',
'LOGOUT_USER' => 'Logout [ %s ]',
'LOG_ME_IN' => 'Log me on automatically each visit',
@@ -452,6 +467,7 @@ $lang = array_merge($lang, array(
'TOTAL_POSTS' => 'Total posts',
'TOTAL_POSTS_OTHER' => 'Total posts <b>%d</b>',
'TOTAL_POSTS_ZERO' => 'Total posts <b>0</b>',
+ 'TOPIC_REPORTED' => 'This topic has been reported',
'TOTAL_TOPICS_OTHER'=> 'Total topics <b>%d</b>',
'TOTAL_TOPICS_ZERO' => 'Total topics <b>0</b>',
'TOTAL_USERS_OTHER' => 'Total members <b>%d</b>',
diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php
index 617d36b957..6ff9a2f91a 100644
--- a/phpBB/language/en/mcp.php
+++ b/phpBB/language/en/mcp.php
@@ -200,11 +200,13 @@ $lang = array_merge($lang, array(
'NO_FEEDBACK' => 'No feedback exists for this user',
'NO_FINAL_TOPIC_SELECTED' => 'You have to select a destination topic for merging posts',
'NO_MATCHES_FOUND' => 'No matches found',
+ 'NO_POST' => 'You have to select a post in order to warn the user for a post',
'NO_POST_REPORT' => 'This post was not reported.',
'NO_POST_SELECTED' => 'You must select at least one post to perform this action',
'NO_TOPIC_SELECTED' => 'You must select at least one topic to perform this action',
'OTHER_IPS' => 'Other IP addresses this user has posted from',
+ 'ONLY_TOPIC' => 'Only topic "%s"',
'OTHER_USERS' => 'Users posting from this IP',
'POSTER' => 'Poster',
@@ -286,7 +288,6 @@ $lang = array_merge($lang, array(
'TOPIC_LOCKED_SUCCESS' => 'The selected topic has been locked',
'TOPIC_MOVED_SUCCESS' => 'The selected topic has been moved successfully',
'TOPIC_NOT_EXIST' => 'The topic you selected does not exist',
- 'TOPIC_REPORTED' => 'This topic has been reported',
'TOPIC_RESYNC_SUCCESS' => 'The selected topic has been resynchronised',
'TOPIC_SPLIT_SUCCESS' => 'The selected topic has been split successfully',
'TOPIC_TIME' => 'Topic time',
diff --git a/phpBB/mcp.php b/phpBB/mcp.php
index eb2dd03085..e6520797a1 100644
--- a/phpBB/mcp.php
+++ b/phpBB/mcp.php
@@ -101,9 +101,31 @@ if ($topic_id && !$forum_id)
}
// If the user doesn't have any moderator powers (globally or locally) he can't access the mcp
-if (!$forum_id && !$auth->acl_get('m_') && !$auth->acl_getf_global('m_'))
+if (!$auth->acl_get('m_') && !$auth->acl_getf_global('m_'))
{
- trigger_error('MODULE_NOT_EXIST');
+ // Except he is using one of the quickmod tools for users
+ $user_quickmod_actions = array(
+ 'lock' => 'f_user_lock',
+ 'unlock' => 'f_user_lock',
+ 'make_sticky' => 'f_sticky',
+ 'make_announce' => 'f_announce',
+ 'make_global' => 'f_announce',
+ 'make_normal' => array('f_announce', 'f_sticky'));
+
+ $allow_user = false;
+ if ($quickmod && isset($user_quickmod_actions[$action]) && $user->data['is_registered'] && $auth->acl_gets($user_quickmod_actions[$action], $forum_id))
+ {
+ $topic_info = get_topic_data(array($topic_id));
+ if ($topic_info[$topic_id]['topic_poster'] == $user->data['user_id'])
+ {
+ $allow_user = true;
+ }
+ }
+
+ if (!$allow_user)
+ {
+ trigger_error($user->lang['NOT_AUTHORIZED']);
+ }
}
if ($forum_id)
@@ -139,6 +161,11 @@ if ($quickmod)
$module->set_active('logs', 'topic_logs');
break;
+ case 'split':
+ case 'merge':
+ $module->set_active('main', 'topic_view');
+ break;
+
default:
trigger_error("$action not allowed as quickmod");
}
@@ -155,6 +182,11 @@ if (!$post_id)
$module->set_display('reports', 'report_details', false);
$module->set_display('main', 'post_details', false);
$module->set_display('warn', 'warn_post', false);
+
+ if (!$topic_id || $mode == 'unapproved_posts')
+ {
+ $module->set_display('queue', 'approve_details', false);
+ }
}
if (!$topic_id)
@@ -163,11 +195,6 @@ if (!$topic_id)
$module->set_display('logs', 'topic_logs', false);
}
-if (!$topic_id && !$post_id)
-{
- $module->set_display('queue', 'approve_details', false);
-}
-
if (!$forum_id)
{
$module->set_display('main', 'forum_view', false);
@@ -224,30 +251,47 @@ function extra_url()
function get_topic_data($topic_ids, $acl_list = false)
{
global $auth, $db;
- $rowset = array();
+ static $rowset = array();
+ $topics = array();
- if (implode(', ', $topic_ids) == '')
+ if (!sizeof($topic_ids))
{
return array();
}
- $sql = 'SELECT f.*, t.*
- FROM ' . TOPICS_TABLE . ' t
- LEFT JOIN ' . FORUMS_TABLE . ' f ON t.forum_id = f.forum_id
- WHERE t.topic_id IN (' . implode(', ', $topic_ids) . ')';
- $result = $db->sql_query($sql);
+ $cache_topic_ids = array_intersect($topic_ids, array_keys($rowset));
+ $topic_ids = array_diff($topic_ids, array_keys($rowset));
- while ($row = $db->sql_fetchrow($result))
+ if (sizeof($topic_ids))
{
- if ($acl_list && !$auth->acl_get($acl_list, $row['forum_id']))
+ $sql = 'SELECT f.*, t.*
+ FROM ' . TOPICS_TABLE . ' t
+ LEFT JOIN ' . FORUMS_TABLE . ' f ON t.forum_id = f.forum_id
+ WHERE t.topic_id IN (' . implode(', ', $topic_ids) . ')';
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
{
- continue;
+ $rowset[$row['topic_id']] = $row;
+
+ if ($acl_list && !$auth->acl_gets($acl_list, $row['forum_id']))
+ {
+ continue;
+ }
+
+ $topics[$row['topic_id']] = $row;
}
+ }
- $rowset[$row['topic_id']] = $row;
+ foreach ($cache_topic_ids as $id)
+ {
+ if (!$acl_list || $auth->acl_gets($acl_list, $rowset[$id]['forum_id']))
+ {
+ $topics[$id] = $rowset[$id];
+ }
}
- return $rowset;
+ return $topics;
}
/**
@@ -258,6 +302,11 @@ function get_post_data($post_ids, $acl_list = false)
global $db, $auth;
$rowset = array();
+ if (!sizeof($post_ids))
+ {
+ return array();
+ }
+
$sql = $db->sql_build_query('SELECT', array(
'SELECT' => 'p.*, u.*, t.*, f.*',
@@ -282,7 +331,7 @@ function get_post_data($post_ids, $acl_list = false)
while ($row = $db->sql_fetchrow($result))
{
- if ($acl_list && !$auth->acl_get($acl_list, $row['forum_id']))
+ if ($acl_list && !$auth->acl_gets($acl_list, $row['forum_id']))
{
continue;
}
@@ -307,6 +356,11 @@ function get_forum_data($forum_id, $acl_list = 'f_list')
global $auth, $db;
$rowset = array();
+ if (!sizeof($forum_id))
+ {
+ return array();
+ }
+
$sql = 'SELECT *
FROM ' . FORUMS_TABLE . '
WHERE forum_id ' . ((is_array($forum_id)) ? 'IN (' . implode(', ', $forum_id) . ')' : "= $forum_id");
@@ -314,7 +368,7 @@ function get_forum_data($forum_id, $acl_list = 'f_list')
while ($row = $db->sql_fetchrow($result))
{
- if ($acl_list && !$auth->acl_get($acl_list, $row['forum_id']))
+ if ($acl_list && !$auth->acl_gets($acl_list, $row['forum_id']))
{
continue;
}
@@ -331,6 +385,8 @@ function get_forum_data($forum_id, $acl_list = 'f_list')
/**
* sorting in mcp
+*
+* @param string $where_sql should either be WHERE (default if ommited) or end with AND or OR
*/
function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, &$sort_order_sql, &$total, $forum_id = 0, $topic_id = 0, $where_sql = 'WHERE')
{
@@ -375,6 +431,8 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
$type = 'posts';
$default_key = 't';
$default_dir = 'd';
+ $where_sql .= ($topic_id) ? ' topic_id = ' . $topic_id . ' AND' : '';
+
$sql = 'SELECT COUNT(post_id) AS total
FROM ' . POSTS_TABLE . "
$where_sql forum_id IN (" . (($forum_id) ? $forum_id : implode(', ', get_forum_list('m_approve'))) . ')
@@ -546,7 +604,7 @@ function check_ids(&$ids, $table, $sql_id, $acl_list = false)
$db->sql_freeresult($result);
}
- if ($acl_list && !$auth->acl_get($acl_list, $forum_id))
+ if ($acl_list && !$auth->acl_gets($acl_list, $forum_id))
{
trigger_error('NOT_AUTHORIZED');
}
diff --git a/phpBB/styles/subSilver/template/mcp_queue.html b/phpBB/styles/subSilver/template/mcp_queue.html
index b981256c94..4fb3a5b795 100644
--- a/phpBB/styles/subSilver/template/mcp_queue.html
+++ b/phpBB/styles/subSilver/template/mcp_queue.html
@@ -5,7 +5,7 @@
<th colspan="6" height="28" nowrap="nowrap">{L_DISPLAY_OPTIONS}</th>
</tr>
<tr>
- <td colspan="5" class="cat" height="28" align="center"><span class="gensmall">{L_DISPLAY_ITEMS}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select>&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /></span></td>
+ <td colspan="5" class="cat" height="28" align="center"><span class="gensmall">{L_DISPLAY_ITEMS}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> &nbsp; <!-- IF TOPIC_ID --><input type="checkbox" name="t" value="{TOPIC_ID}" checked="checked" />&nbsp; {L_ONLY_TOPIC} &nbsp; <!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></span></td>
</tr>
<tr>
<th height="28">&nbsp;{L_TOPIC}&nbsp;</th>
diff --git a/phpBB/styles/subSilver/template/mcp_reports.html b/phpBB/styles/subSilver/template/mcp_reports.html
index 3df64274d9..499db2bda5 100644
--- a/phpBB/styles/subSilver/template/mcp_reports.html
+++ b/phpBB/styles/subSilver/template/mcp_reports.html
@@ -5,7 +5,7 @@
<th colspan="5" height="28" nowrap="nowrap">{L_DISPLAY_OPTIONS}</th>
</tr>
<tr>
- <td colspan="5" class="cat" height="28" align="center"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select>&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /></span></td>
+ <td colspan="5" class="cat" height="28" align="center"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> &nbsp; <!-- IF TOPIC_ID --><input type="checkbox" name="t" value="{TOPIC_ID}" checked="checked" />&nbsp; {L_ONLY_TOPIC} &nbsp; <!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></span></td>
</tr>
<tr>
<th height="28">&nbsp;{L_POST}&nbsp;</th>
diff --git a/phpBB/styles/subSilver/template/mcp_topic.html b/phpBB/styles/subSilver/template/mcp_topic.html
index 736337d9ea..5c8ad3c15a 100644
--- a/phpBB/styles/subSilver/template/mcp_topic.html
+++ b/phpBB/styles/subSilver/template/mcp_topic.html
@@ -124,8 +124,8 @@
<!-- IF S_CAN_APPROVE --><option value="approve">{L_APPROVE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_LOCK --><option value="lock_post">{L_LOCK_POST_POSTS} [ {L_LOCK_POST_EXPLAIN} ]</option><option value="unlock_post">{L_UNLOCK_POST_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_DELETE --><option value="delete_post">{L_DELETE_POSTS}</option><!-- ENDIF -->
- <!-- IF S_CAN_MERGE --><option value="merge_posts"<!-- IF MODE == 'merge' --> selected="selected"<!-- ENDIF -->>{L_MERGE_POSTS}</option><!-- ENDIF -->
- <!-- IF S_CAN_SPLIT --><option value="split_all"<!-- IF MODE == 'split' --> selected="selected"<!-- ENDIF -->>{L_SPLIT_POSTS}</option><option value="split_beyond">{L_SPLIT_AFTER}</option><!-- ENDIF -->
+ <!-- IF S_CAN_MERGE --><option value="merge_posts"<!-- IF ACTION eq 'merge' --> selected="selected"<!-- ENDIF -->>{L_MERGE_POSTS}</option><!-- ENDIF -->
+ <!-- IF S_CAN_SPLIT --><option value="split_all"<!-- IF ACTION eq 'split' --> selected="selected"<!-- ENDIF -->>{L_SPLIT_POSTS}</option><option value="split_beyond">{L_SPLIT_AFTER}</option><!-- ENDIF -->
</select>&nbsp;<input class="btnmain" type="submit" name="mcp_topic_submit" value="{L_SUBMIT}"></form></td>
</tr>
</table>
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 6793866c9f..66535b6312 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -457,6 +457,8 @@ $s_forum_rules = '';
gen_forum_auth_level('topic', $forum_id, $topic_data['forum_status']);
// Quick mod tools
+$allow_change_type = ($auth->acl_get('m_') || ($user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'])) ? true : false;
+
$topic_mod = '';
$topic_mod .= ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'])) ? (($topic_data['topic_status'] == ITEM_UNLOCKED) ? '<option value="lock">' . $user->lang['LOCK_TOPIC'] . '</option>' : '<option value="unlock">' . $user->lang['UNLOCK_TOPIC'] . '</option>') : '';
$topic_mod .= ($auth->acl_get('m_delete', $forum_id)) ? '<option value="delete_topic">' . $user->lang['DELETE_TOPIC'] . '</option>' : '';
@@ -464,10 +466,10 @@ $topic_mod .= ($auth->acl_get('m_move', $forum_id)) ? '<option value="move">' .
$topic_mod .= ($auth->acl_get('m_split', $forum_id)) ? '<option value="split">' . $user->lang['SPLIT_TOPIC'] . '</option>' : '';
$topic_mod .= ($auth->acl_get('m_merge', $forum_id)) ? '<option value="merge">' . $user->lang['MERGE_TOPIC'] . '</option>' : '';
$topic_mod .= ($auth->acl_get('m_move', $forum_id)) ? '<option value="fork">' . $user->lang['FORK_TOPIC'] . '</option>' : '';
-$topic_mod .= ($auth->acl_get('m_', $forum_id) && $topic_data['topic_type'] != POST_NORMAL) ? '<option value="make_normal">' . $user->lang['MAKE_NORMAL'] . '</option>' : '';
-$topic_mod .= ($auth->acl_get('m_', $forum_id) && $auth->acl_get('f_sticky', $forum_id) && $topic_data['topic_type'] != POST_STICKY) ? '<option value="make_sticky">' . $user->lang['MAKE_STICKY'] . '</option>' : '';
-$topic_mod .= ($auth->acl_get('m_', $forum_id) && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_ANNOUNCE) ? '<option value="make_announce">' . $user->lang['MAKE_ANNOUNCE'] . '</option>' : '';
-$topic_mod .= ($auth->acl_get('m_', $forum_id) && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_GLOBAL) ? '<option value="make_global">' . $user->lang['MAKE_GLOBAL'] . '</option>' : '';
+$topic_mod .= ($allow_change_type && $auth->acl_gets(array('f_sticky', 'f_announce'), $forum_id) && $topic_data['topic_type'] != POST_NORMAL) ? '<option value="make_normal">' . $user->lang['MAKE_NORMAL'] . '</option>' : '';
+$topic_mod .= ($allow_change_type && $auth->acl_get('f_sticky', $forum_id) && $topic_data['topic_type'] != POST_STICKY) ? '<option value="make_sticky">' . $user->lang['MAKE_STICKY'] . '</option>' : '';
+$topic_mod .= ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_ANNOUNCE) ? '<option value="make_announce">' . $user->lang['MAKE_ANNOUNCE'] . '</option>' : '';
+$topic_mod .= ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_GLOBAL) ? '<option value="make_global">' . $user->lang['MAKE_GLOBAL'] . '</option>' : '';
$topic_mod .= ($auth->acl_get('m_', $forum_id)) ? '<option value="topic_logs">' . $user->lang['VIEW_TOPIC_LOGS'] . '</option>' : '';
// If we've got a hightlight set pass it on to pagination.