mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 20:38:52 +00:00
- Handle forum links/redirects within viewforum if no read permission given (to display login box or error message) (Bug #13467)
- Prevent changing postable forum having subforums to link forum without moving subforums out first git-svn-id: file:///svn/phpbb/trunk@7895 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
d4675c109a
commit
683930ca4a
7 changed files with 36 additions and 6 deletions
|
@ -249,6 +249,8 @@ p a {
|
||||||
<li>[Change] Improved utf8_clean_string with a more complete list of homographs and NFKC normalization</li>
|
<li>[Change] Improved utf8_clean_string with a more complete list of homographs and NFKC normalization</li>
|
||||||
<li>[Fix] Fixed error messages that ACP Database can give (Bug #13463)</li>
|
<li>[Fix] Fixed error messages that ACP Database can give (Bug #13463)</li>
|
||||||
<li>[Fix] Fixed potential issues with databases that use tables names is uppercase</li>
|
<li>[Fix] Fixed potential issues with databases that use tables names is uppercase</li>
|
||||||
|
<li>[Fix] Handle forum links/redirects within viewforum if no read permission given (to display login box or error message) (Bug #13467)</li>
|
||||||
|
<li>[Fix] Prevent changing postable forum having subforums to link forum without moving subforums out first</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
@ -991,6 +991,13 @@ class acp_forums
|
||||||
|
|
||||||
if ($row['forum_type'] == FORUM_POST && $row['forum_type'] != $forum_data_sql['forum_type'])
|
if ($row['forum_type'] == FORUM_POST && $row['forum_type'] != $forum_data_sql['forum_type'])
|
||||||
{
|
{
|
||||||
|
// Has subforums and want to change into a link?
|
||||||
|
if ($row['right_id'] - $row['left_id'] > 1 && $forum_data_sql['forum_type'] == FORUM_LINK)
|
||||||
|
{
|
||||||
|
$errors[] = $user->lang['FORUM_WITH_SUBFORUMS_NOT_TO_LINK'];
|
||||||
|
return $errors;
|
||||||
|
}
|
||||||
|
|
||||||
// we're turning a postable forum into a non-postable forum
|
// we're turning a postable forum into a non-postable forum
|
||||||
if ($forum_data_sql['type_action'] == 'move')
|
if ($forum_data_sql['type_action'] == 'move')
|
||||||
{
|
{
|
||||||
|
|
|
@ -1546,10 +1546,9 @@ class acp_users
|
||||||
|
|
||||||
delete_attachments('attach', $marked);
|
delete_attachments('attach', $marked);
|
||||||
|
|
||||||
$log = (sizeof($log_attachments) == 1) ? 'ATTACHMENT_DELETED' : 'ATTACHMENTS_DELETED';
|
|
||||||
$message = (sizeof($log_attachments) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED'];
|
$message = (sizeof($log_attachments) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED'];
|
||||||
|
|
||||||
add_log('admin', $log, implode(', ', $log_attachments));
|
add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode(', ', $log_attachments));
|
||||||
trigger_error($message . adm_back_link($this->u_action . '&u=' . $user_id));
|
trigger_error($message . adm_back_link($this->u_action . '&u=' . $user_id));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -368,6 +368,24 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||||
$s_subforums_list = (string) implode(', ', $s_subforums_list);
|
$s_subforums_list = (string) implode(', ', $s_subforums_list);
|
||||||
$catless = ($row['parent_id'] == $root_data['forum_id']) ? true : false;
|
$catless = ($row['parent_id'] == $root_data['forum_id']) ? true : false;
|
||||||
|
|
||||||
|
if ($row['forum_type'] != FORUM_LINK)
|
||||||
|
{
|
||||||
|
$u_viewforum = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// If the forum is a link and we count redirects we need to visit it
|
||||||
|
// If the forum is having a password or no read access we do not expose the link, but instead handle it in viewforum
|
||||||
|
if (($row['forum_flags'] & FORUM_FLAG_LINK_TRACK) || $row['forum_password'] || !$auth->acl_get('f_read', $forum_id))
|
||||||
|
{
|
||||||
|
$u_viewforum = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$u_viewforum = $row['forum_link'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$template->assign_block_vars('forumrow', array(
|
$template->assign_block_vars('forumrow', array(
|
||||||
'S_IS_CAT' => false,
|
'S_IS_CAT' => false,
|
||||||
'S_NO_CAT' => $catless && !$last_catless,
|
'S_NO_CAT' => $catless && !$last_catless,
|
||||||
|
@ -397,7 +415,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||||
'L_FORUM_FOLDER_ALT' => $folder_alt,
|
'L_FORUM_FOLDER_ALT' => $folder_alt,
|
||||||
'L_MODERATOR_STR' => $l_moderator,
|
'L_MODERATOR_STR' => $l_moderator,
|
||||||
|
|
||||||
'U_VIEWFORUM' => ($row['forum_type'] != FORUM_LINK || ($row['forum_flags'] & FORUM_FLAG_LINK_TRACK) || $row['forum_password']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : $row['forum_link'],
|
'U_VIEWFORUM' => $u_viewforum,
|
||||||
'U_LAST_POSTER' => get_username_string('profile', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
|
'U_LAST_POSTER' => get_username_string('profile', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
|
||||||
'U_LAST_POST' => $last_post_url)
|
'U_LAST_POST' => $last_post_url)
|
||||||
);
|
);
|
||||||
|
|
|
@ -402,6 +402,8 @@ $lang = array_merge($lang, array(
|
||||||
'LOG_ADMIN_AUTH_FAIL' => '<strong>Failed administration login attempt</strong>',
|
'LOG_ADMIN_AUTH_FAIL' => '<strong>Failed administration login attempt</strong>',
|
||||||
'LOG_ADMIN_AUTH_SUCCESS' => '<strong>Successful administration login</strong>',
|
'LOG_ADMIN_AUTH_SUCCESS' => '<strong>Successful administration login</strong>',
|
||||||
|
|
||||||
|
'LOG_ATTACHMENTS_DELETED' => '<strong>Removed user attachments</strong><br />» %s',
|
||||||
|
|
||||||
'LOG_ATTACH_EXT_ADD' => '<strong>Added or edited attachment extension</strong><br />» %s',
|
'LOG_ATTACH_EXT_ADD' => '<strong>Added or edited attachment extension</strong><br />» %s',
|
||||||
'LOG_ATTACH_EXT_DEL' => '<strong>Removed attachment extension</strong><br />» %s',
|
'LOG_ATTACH_EXT_DEL' => '<strong>Removed attachment extension</strong><br />» %s',
|
||||||
'LOG_ATTACH_EXT_UPDATE' => '<strong>Updated attachment extension</strong><br />» %s',
|
'LOG_ATTACH_EXT_UPDATE' => '<strong>Updated attachment extension</strong><br />» %s',
|
||||||
|
|
|
@ -102,6 +102,8 @@ $lang = array_merge($lang, array(
|
||||||
'FORUM_TYPE' => 'Forum type',
|
'FORUM_TYPE' => 'Forum type',
|
||||||
'FORUM_UPDATED' => 'Forum information updated successfully.',
|
'FORUM_UPDATED' => 'Forum information updated successfully.',
|
||||||
|
|
||||||
|
'FORUM_WITH_SUBFORUMS_NOT_TO_LINK' => 'You want to change a postable forum having subforums to a link. Please move all subforums out of this forum before you proceed, because after changing to a link you are no longer able to see the subforums currently connected to this forum.',
|
||||||
|
|
||||||
'GENERAL_FORUM_SETTINGS' => 'General forum settings',
|
'GENERAL_FORUM_SETTINGS' => 'General forum settings',
|
||||||
|
|
||||||
'LINK' => 'Link',
|
'LINK' => 'Link',
|
||||||
|
|
|
@ -77,7 +77,7 @@ if (isset($_GET['e']) && !$user->data['is_registered'])
|
||||||
}
|
}
|
||||||
|
|
||||||
// Permissions check
|
// Permissions check
|
||||||
if (!$auth->acl_gets('f_list', 'f_read', $forum_id))
|
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 ($user->data['user_id'] != ANONYMOUS)
|
if ($user->data['user_id'] != ANONYMOUS)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue