mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-24 01:20:40 +01:00
Merge branch '3.2.x'
This commit is contained in:
commit
6259789e02
@ -537,7 +537,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
// Create last post link information, if appropriate
|
||||
if ($row['forum_last_post_id'])
|
||||
{
|
||||
if ($row['forum_password_last_post'] === '' && $auth->acl_get('f_read', $row['forum_id_last_post']))
|
||||
if ($row['forum_password_last_post'] === '' && $auth->acl_gets('f_read', 'f_list_topics', $row['forum_id_last_post']))
|
||||
{
|
||||
$last_post_subject = censor_text($row['forum_last_post_subject']);
|
||||
$last_post_subject_truncated = truncate_string($last_post_subject, 30, 255, false, $user->lang['ELLIPSIS']);
|
||||
|
@ -335,6 +335,7 @@ INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_icons', 1);
|
||||
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_ignoreflood', 1);
|
||||
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_img', 1);
|
||||
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_list', 1);
|
||||
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_list_topics', 1);
|
||||
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_noapprove', 1);
|
||||
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_poll', 1);
|
||||
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_post', 1);
|
||||
@ -573,13 +574,13 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT
|
||||
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 16, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option = 'f_';
|
||||
|
||||
# Read Only Access (f_)
|
||||
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 17, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_read', 'f_search', 'f_subscribe', 'f_print');
|
||||
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 17, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_list_topics', 'f_read', 'f_search', 'f_subscribe', 'f_print');
|
||||
|
||||
# Limited Access (f_)
|
||||
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 18, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_announce_global', 'f_attach', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock', 'f_votechg');
|
||||
|
||||
# Bot Access (f_)
|
||||
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 19, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_read', 'f_print');
|
||||
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 19, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_list_topics', 'f_read', 'f_print');
|
||||
|
||||
# On Moderation Queue (f_)
|
||||
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 20, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_announce_global', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock', 'f_votechg', 'f_noapprove');
|
||||
|
@ -107,6 +107,7 @@ $lang = array_merge($lang, array(
|
||||
// Forum Permissions
|
||||
$lang = array_merge($lang, array(
|
||||
'ACL_F_LIST' => 'Can see forum',
|
||||
'ACL_F_LIST_TOPICS' => 'Can see topics',
|
||||
'ACL_F_READ' => 'Can read forum',
|
||||
'ACL_F_SEARCH' => 'Can search the forum',
|
||||
'ACL_F_SUBSCRIBE' => 'Can subscribe forum',
|
||||
|
@ -53,7 +53,7 @@ $lang = array_merge($lang, array(
|
||||
'NEW_POSTS_LOCKED' => 'New posts [ Locked ]', // Not used anymore
|
||||
'NO_NEW_POSTS_HOT' => 'No new posts [ Popular ]', // Not used anymore
|
||||
'NO_NEW_POSTS_LOCKED' => 'No new posts [ Locked ]', // Not used anymore
|
||||
'NO_READ_ACCESS' => 'You do not have the required permissions to read topics within this forum.',
|
||||
'NO_READ_ACCESS' => 'You do not have the required permissions to view or read topics within this forum.',
|
||||
'NO_UNREAD_POSTS_HOT' => 'No unread posts [ Popular ]',
|
||||
'NO_UNREAD_POSTS_LOCKED' => 'No unread posts [ Locked ]',
|
||||
|
||||
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\db\migration\data\v32x;
|
||||
|
||||
class f_list_topics_permission_add extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\v321',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('permission.add', array('f_list_topics', false, 'f_read')),
|
||||
);
|
||||
}
|
||||
}
|
@ -136,6 +136,11 @@ class pagination
|
||||
*/
|
||||
public function generate_template_pagination($base_url, $block_var_name, $start_name, $num_items, $per_page, $start = 1, $reverse_count = false, $ignore_on_page = false)
|
||||
{
|
||||
if (empty($base_url))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$total_pages = ceil($num_items / $per_page);
|
||||
$on_page = $this->get_on_page($per_page, $start);
|
||||
$u_previous_page = $u_next_page = '';
|
||||
|
@ -260,6 +260,7 @@ class permissions
|
||||
|
||||
// Forum Permissions
|
||||
'f_list' => array('lang' => 'ACL_F_LIST', 'cat' => 'actions'),
|
||||
'f_list_topics' => array('lang' => 'ACL_F_LIST_TOPICS', 'cat' => 'actions'),
|
||||
'f_read' => array('lang' => 'ACL_F_READ', 'cat' => 'actions'),
|
||||
'f_search' => array('lang' => 'ACL_F_SEARCH', 'cat' => 'actions'),
|
||||
'f_subscribe' => array('lang' => 'ACL_F_SUBSCRIBE', 'cat' => 'actions'),
|
||||
|
@ -165,7 +165,7 @@
|
||||
<i class="icon fa-file fa-fw icon-red icon-md" aria-hidden="true"></i><span class="sr-only">{NEW_POST}</span>
|
||||
</a>
|
||||
<!-- ENDIF -->
|
||||
<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
|
||||
<!-- IF topicrow.U_VIEW_TOPIC --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a><!-- ELSE -->{topicrow.TOPIC_TITLE}<!-- ENDIF -->
|
||||
<!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED -->
|
||||
<a href="{topicrow.U_MCP_QUEUE}" title="{L_TOPIC_UNAPPROVED}">
|
||||
<i class="icon fa-question fa-fw icon-blue" aria-hidden="true"></i><span class="sr-only">{L_TOPIC_UNAPPROVED}</span>
|
||||
@ -224,7 +224,7 @@
|
||||
<dd class="views">{topicrow.VIEWS} <dfn>{L_VIEWS}</dfn></dd>
|
||||
<dd class="lastpost">
|
||||
<span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL}
|
||||
<!-- IF not S_IS_BOT -->
|
||||
<!-- IF not S_IS_BOT and topicrow.U_LAST_POST -->
|
||||
<a href="{topicrow.U_LAST_POST}" title="{L_GOTO_LAST_POST}">
|
||||
<i class="icon fa-external-link-square fa-fw icon-lightgray icon-md" aria-hidden="true"></i><span class="sr-only">{VIEW_LATEST_POST}</span>
|
||||
</a>
|
||||
|
@ -87,7 +87,7 @@ if (isset($_GET['e']) && !$user->data['is_registered'])
|
||||
}
|
||||
|
||||
// Permissions check
|
||||
if (!$auth->acl_gets('f_list', 'f_read', $forum_id) || ($forum_data['forum_type'] == FORUM_LINK && $forum_data['forum_link'] && !$auth->acl_get('f_read', $forum_id)))
|
||||
if (!$auth->acl_gets('f_list', 'f_list_topics', 'f_read', $forum_id) || ($forum_data['forum_type'] == FORUM_LINK && $forum_data['forum_link'] && !$auth->acl_get('f_read', $forum_id)))
|
||||
{
|
||||
if ($user->data['user_id'] != ANONYMOUS)
|
||||
{
|
||||
@ -196,7 +196,7 @@ if (!($forum_data['forum_type'] == FORUM_POST || (($forum_data['forum_flags'] &
|
||||
|
||||
// Ok, if someone has only list-access, we only display the forum list.
|
||||
// We also make this circumstance available to the template in case we want to display a notice. ;)
|
||||
if (!$auth->acl_get('f_read', $forum_id))
|
||||
if (!$auth->acl_gets('f_read', 'f_list_topics', $forum_id))
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_NO_READ_ACCESS' => true,
|
||||
@ -747,7 +747,7 @@ if (count($shadow_topic_list))
|
||||
}
|
||||
|
||||
// Do not include those topics the user has no permission to access
|
||||
if (!$auth->acl_get('f_read', $row['forum_id']))
|
||||
if (!$auth->acl_gets('f_read', 'f_list_topics', $row['forum_id']))
|
||||
{
|
||||
// We need to remove any trace regarding this topic. :)
|
||||
unset($rowset[$orig_topic_id]);
|
||||
@ -890,7 +890,7 @@ if (count($topic_list))
|
||||
|
||||
// Generate all the URIs ...
|
||||
$view_topic_url_params = 'f=' . $row['forum_id'] . '&t=' . $topic_id;
|
||||
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params);
|
||||
$view_topic_url = $auth->acl_get('f_read', $forum_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params) : false;
|
||||
|
||||
$topic_unapproved = (($row['topic_visibility'] == ITEM_UNAPPROVED || $row['topic_visibility'] == ITEM_REAPPROVE) && $auth->acl_get('m_approve', $row['forum_id']));
|
||||
$posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_posts_unapproved'] && $auth->acl_get('m_approve', $row['forum_id']));
|
||||
@ -944,8 +944,8 @@ if (count($topic_list))
|
||||
'S_TOPIC_LOCKED' => ($row['topic_status'] == ITEM_LOCKED) ? true : false,
|
||||
'S_TOPIC_MOVED' => ($row['topic_status'] == ITEM_MOVED) ? true : false,
|
||||
|
||||
'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&view=unread') . '#unread',
|
||||
'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
|
||||
'U_NEWEST_POST' => $auth->acl_get('f_read', $forum_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&view=unread') . '#unread' : false,
|
||||
'U_LAST_POST' => $auth->acl_get('f_read', $forum_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'] : false,
|
||||
'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
|
||||
'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
|
||||
'U_VIEW_TOPIC' => $view_topic_url,
|
||||
|
Loading…
x
Reference in New Issue
Block a user