aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_display.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-07-16 14:02:06 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-07-16 14:02:06 +0000
commit683930ca4a31d502b704bbb9366938b4ed6562b1 (patch)
treecd1f3d62969335b3904f8bcea01a0fa3d8ac70a7 /phpBB/includes/functions_display.php
parentd4675c109aa65a909b97061643222f4f2d9fb140 (diff)
downloadforums-683930ca4a31d502b704bbb9366938b4ed6562b1.tar
forums-683930ca4a31d502b704bbb9366938b4ed6562b1.tar.gz
forums-683930ca4a31d502b704bbb9366938b4ed6562b1.tar.bz2
forums-683930ca4a31d502b704bbb9366938b4ed6562b1.tar.xz
forums-683930ca4a31d502b704bbb9366938b4ed6562b1.zip
- 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
Diffstat (limited to 'phpBB/includes/functions_display.php')
-rw-r--r--phpBB/includes/functions_display.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 849c3c60a0..a28d91a7e9 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -368,6 +368,24 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$s_subforums_list = (string) implode(', ', $s_subforums_list);
$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(
'S_IS_CAT' => false,
'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_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_POST' => $last_post_url)
);