mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
Merge pull request #3781 from Elsensee/ticket/8708-2
[ticket/8708] Add extra permission for posting global announcements * Elsensee/ticket/8708-2: [ticket/8708] Apply permission 'f_announce_global' [ticket/8708] Add f_announce_global permission
This commit is contained in:
@@ -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;
|
||||
|
@@ -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) : '',
|
||||
|
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user