diff options
author | Oliver Schramm <oliver.schramm97@gmail.com> | 2014-07-16 18:31:12 +0200 |
---|---|---|
committer | Oliver Schramm <oliver.schramm97@gmail.com> | 2015-07-19 21:26:47 +0200 |
commit | 7d31232846e29311e5b76bf32f41f64da7985a79 (patch) | |
tree | 5e84f565cd94d54a854f5ef5006e5dd112b3884e | |
parent | df56b2ed364e24f803047c9f64d168432ba2680c (diff) | |
download | forums-7d31232846e29311e5b76bf32f41f64da7985a79.tar forums-7d31232846e29311e5b76bf32f41f64da7985a79.tar.gz forums-7d31232846e29311e5b76bf32f41f64da7985a79.tar.bz2 forums-7d31232846e29311e5b76bf32f41f64da7985a79.tar.xz forums-7d31232846e29311e5b76bf32f41f64da7985a79.zip |
[ticket/8708] Apply permission 'f_announce_global'
PHPBB3-8708
-rw-r--r-- | phpBB/includes/functions_posting.php | 13 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 3 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_main.php | 2 | ||||
-rw-r--r-- | phpBB/mcp.php | 4 | ||||
-rw-r--r-- | phpBB/posting.php | 3 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/mcp_forum.html | 6 | ||||
-rw-r--r-- | phpBB/viewtopic.php | 4 |
7 files changed, 17 insertions, 18 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 9109c48ab6..e4520d7f03 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -337,18 +337,15 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL) $toggle = false; $topic_types = array( - 'sticky' => array('const' => POST_STICKY, 'lang' => 'POST_STICKY'), - 'announce' => array('const' => POST_ANNOUNCE, 'lang' => 'POST_ANNOUNCEMENT'), - 'global' => array('const' => POST_GLOBAL, 'lang' => 'POST_GLOBAL') + 'sticky' => array('const' => POST_STICKY, 'lang' => 'POST_STICKY'), + 'announce' => array('const' => POST_ANNOUNCE, 'lang' => 'POST_ANNOUNCEMENT'), + 'announce_global' => array('const' => POST_GLOBAL, 'lang' => 'POST_GLOBAL') ); $topic_type_array = array(); foreach ($topic_types as $auth_key => $topic_value) { - // We do not have a special post global announcement permission - $auth_key = ($auth_key == 'global') ? 'announce' : $auth_key; - if ($auth->acl_get('f_' . $auth_key, $forum_id)) { $toggle = true; @@ -378,8 +375,8 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL) $template->assign_vars(array( 'S_TOPIC_TYPE_STICKY' => ($auth->acl_get('f_sticky', $forum_id)), - 'S_TOPIC_TYPE_ANNOUNCE' => ($auth->acl_get('f_announce', $forum_id))) - ); + 'S_TOPIC_TYPE_ANNOUNCE' => ($auth->acl_gets('f_announce', 'f_announce_global', $forum_id)), + )); } return $toggle; diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 9a280c0ea5..06bbf1ce41 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -131,9 +131,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) : '', diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 2659a4bf01..66e59bb74d 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -362,7 +362,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; diff --git a/phpBB/mcp.php b/phpBB/mcp.php index cb53f4eec9..a5fa09ba2b 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -111,8 +111,8 @@ if (!$auth->acl_getf_global('m_')) 'lock' => 'f_user_lock', 'make_sticky' => 'f_sticky', 'make_announce' => 'f_announce', - 'make_global' => 'f_announce', - 'make_normal' => array('f_announce', 'f_sticky') + 'make_global' => 'f_announce_global', + 'make_normal' => array('f_announce', 'f_announce_global', 'f_sticky') ); $allow_user = false; diff --git a/phpBB/posting.php b/phpBB/posting.php index 7f89bdbadf..52cd1093c0 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1202,6 +1202,9 @@ if ($submit || $preview || $refresh) switch ($post_data['topic_type']) { case POST_GLOBAL: + $auth_option = 'f_announce_global'; + break; + case POST_ANNOUNCE: $auth_option = 'f_announce'; break; diff --git a/phpBB/styles/prosilver/template/mcp_forum.html b/phpBB/styles/prosilver/template/mcp_forum.html index 8fdec01212..f0d8d45e40 100644 --- a/phpBB/styles/prosilver/template/mcp_forum.html +++ b/phpBB/styles/prosilver/template/mcp_forum.html @@ -131,10 +131,8 @@ <!-- IF S_CAN_SYNC --><option value="resync">{L_RESYNC}</option><!-- ENDIF --> <!-- IF S_CAN_MAKE_NORMAL --><option value="make_normal">{L_MAKE_NORMAL}</option><!-- ENDIF --> <!-- IF S_CAN_MAKE_STICKY --><option value="make_sticky">{L_MAKE_STICKY}</option><!-- ENDIF --> - <!-- IF S_CAN_MAKE_ANNOUNCE --> - <option value="make_announce">{L_MAKE_ANNOUNCE}</option> - <option value="make_global">{L_MAKE_GLOBAL}</option> - <!-- ENDIF --> + <!-- IF S_CAN_MAKE_ANNOUNCE --><option value="make_announce">{L_MAKE_ANNOUNCE}</option><!-- ENDIF --> + <!-- IF S_CAN_MAKE_ANNOUNCE_GLOBAL --><option value="make_global">{L_MAKE_GLOBAL}</option><!-- ENDIF --> </select> <input class="button2" type="submit" value="{L_SUBMIT}" /> <div><a href="#" onclick="marklist('mcp', 'topic_id_list', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', 'topic_id_list', false); return false;">{L_UNMARK_ALL}</a></div> diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 4a42d78b2b..b9cb226920 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -583,10 +583,10 @@ $quickmod_array = array( 'merge' => array('MERGE_POSTS', $auth->acl_get('m_merge', $forum_id)), 'merge_topic' => array('MERGE_TOPIC', $auth->acl_get('m_merge', $forum_id)), 'fork' => array('FORK_TOPIC', $auth->acl_get('m_move', $forum_id)), - 'make_normal' => array('MAKE_NORMAL', ($allow_change_type && $auth->acl_gets('f_sticky', 'f_announce', $forum_id) && $topic_data['topic_type'] != POST_NORMAL)), + 'make_normal' => array('MAKE_NORMAL', ($allow_change_type && $auth->acl_gets('f_sticky', 'f_announce', 'f_announce_global', $forum_id) && $topic_data['topic_type'] != POST_NORMAL)), 'make_sticky' => array('MAKE_STICKY', ($allow_change_type && $auth->acl_get('f_sticky', $forum_id) && $topic_data['topic_type'] != POST_STICKY)), 'make_announce' => array('MAKE_ANNOUNCE', ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_ANNOUNCE)), - 'make_global' => array('MAKE_GLOBAL', ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_GLOBAL)), + 'make_global' => array('MAKE_GLOBAL', ($allow_change_type && $auth->acl_get('f_announce_global', $forum_id) && $topic_data['topic_type'] != POST_GLOBAL)), 'topic_logs' => array('VIEW_TOPIC_LOGS', $auth->acl_get('m_', $forum_id)), ); |