From 253f18632242a113c97a3e5d70ee6f65c3f9ce84 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 9 Oct 2008 14:17:02 +0000 Subject: - Do not show link to user/group profiles if user has no permission to view the linked page and gets a denied message anyway. (Bug #15088) - Do not display last post link and sort display options for search engines. (Bug #15088) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8987 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 3 +++ phpBB/includes/functions.php | 2 +- phpBB/includes/functions_display.php | 19 ++++++++++++++----- phpBB/index.php | 11 +++++++---- phpBB/styles/prosilver/template/forumlist_body.html | 2 +- phpBB/styles/prosilver/template/overall_footer.html | 2 +- phpBB/styles/prosilver/template/search_results.html | 2 +- phpBB/styles/prosilver/template/viewforum_body.html | 6 ++++-- phpBB/styles/prosilver/template/viewtopic_body.html | 4 +++- phpBB/styles/subsilver2/template/forumlist_body.html | 2 +- phpBB/styles/subsilver2/template/index_body.html | 4 +++- phpBB/styles/subsilver2/template/viewforum_body.html | 6 ++++-- phpBB/styles/subsilver2/template/viewtopic_body.html | 2 ++ 13 files changed, 45 insertions(+), 20 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 67d353de98..55fdac3d17 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -130,6 +130,9 @@
  • [Fix] Use phpBB 3.1.x method for storing cached data to prevent PHP bug with our usage of var_export(). (Thanks to Techie Micheal and HoL for pointing out possible problems)
  • [Fix] Check users pm preferences for pm's sent to groups. (Bug #33245)
  • [Fix] Do not allow password reminders if u_passchg permission is not given. (Bug #14806)
  • +
  • [Fix] Implemented strict check for cached user permissions and existing ACL options. This fix makes sure cached permissions are valid, even if they got already cached.
  • +
  • [Fix] Do not show link to user/group profiles if user has no permission to view the linked page and gets a denied message anyway. (Bug #15088)
  • +
  • [Fix] Do not display last post link and sort display options for search engines. (Bug #15088)
  • [Change] No longer allow the direct use of MULTI_INSERT in sql_build_array. sql_multi_insert() must be used.
  • [Change] Display warning in ACP if config.php file is left writable.
  • diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 862314aba9..fabb1e1aa3 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3681,7 +3681,7 @@ function page_header($page_title = '', $display_online_list = true) 'U_SEARCH_UNANSWERED' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unanswered'), 'U_SEARCH_ACTIVE_TOPICS'=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=active_topics'), 'U_DELETE_COOKIES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=delete_cookies'), - 'U_TEAM' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=leaders'), + 'U_TEAM' => ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=leaders'), 'U_RESTORE_PERMISSIONS' => ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm') : '', 'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false, diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 5b0dd8258d..44bd0214fa 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -260,7 +260,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod meta_refresh(3, $redirect); trigger_error($message); } - + } // Grab moderators ... if necessary @@ -656,7 +656,7 @@ function topic_generate_pagination($replies, $url) */ function get_moderators(&$forum_moderators, $forum_id = false) { - global $config, $template, $db, $phpbb_root_path, $phpEx; + global $config, $template, $db, $phpbb_root_path, $phpEx, $user, $auth; // Have we disabled the display of moderators? If so, then return // from whence we came ... @@ -715,7 +715,16 @@ function get_moderators(&$forum_moderators, $forum_id = false) } else { - $forum_moderators[$row['forum_id']][] = '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; + $group_name = (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']); + + if ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')) + { + $forum_moderators[$row['forum_id']][] = '' . $group_name . ''; + } + else + { + $forum_moderators[$row['forum_id']][] = '' . $group_name . ''; + } } } $db->sql_freeresult($result); @@ -1037,7 +1046,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, if (!is_null($notify_status) && $notify_status !== '') { - + if (isset($_GET['unwatch'])) { $uid = request_var('uid', 0); @@ -1084,7 +1093,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, { $token = request_var('hash', ''); $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); - + if ($_GET['watch'] == $mode && check_link_hash($token, "{$mode}_$match_id")) { $is_watching = true; diff --git a/phpBB/index.php b/phpBB/index.php index 11568c2db9..2d1329c511 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -60,22 +60,25 @@ else } $result = $db->sql_query($sql); -$legend = ''; +$legend = array(); while ($row = $db->sql_fetchrow($result)) { $colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : ''; + $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']; - if ($row['group_name'] == 'BOTS') + if ($row['group_name'] == 'BOTS' || ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile'))) { - $legend .= (($legend != '') ? ', ' : '') . '' . $user->lang['G_BOTS'] . ''; + $legend[] = '' . $group_name . ''; } else { - $legend .= (($legend != '') ? ', ' : '') . '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; + $legend[] = '' . $group_name . ''; } } $db->sql_freeresult($result); +$legend = implode(', ', $legend); + // Generate birthday list if required ... $birthday_list = ''; if ($config['load_birthdays'] && $config['allow_birthdays']) diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index 29b75240c1..8ed80883e9 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -42,7 +42,7 @@
    {forumrow.POSTS} {L_POSTS}
    {L_LAST_POST} {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL} - {LAST_POST_IMG}
    {L_POSTED_ON_DATE} {forumrow.LAST_POST_TIME}{L_NO_POSTS}
    + {LAST_POST_IMG}
    {L_POSTED_ON_DATE} {forumrow.LAST_POST_TIME}{L_NO_POSTS}
    diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html index 4abe2bb2a4..fd8af31db6 100644 --- a/phpBB/styles/prosilver/template/overall_footer.html +++ b/phpBB/styles/prosilver/template/overall_footer.html @@ -13,7 +13,7 @@
  • {L_BOOKMARK_TOPIC}
  • {L_BUMP_TOPIC}
  • -
  • {L_THE_TEAM}{L_DELETE_COOKIES}{S_TIMEZONE}
  • +
  • {L_THE_TEAM}{L_DELETE_COOKIES}{S_TIMEZONE}
  • diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html index 3924fa3944..9159b126f1 100644 --- a/phpBB/styles/prosilver/template/search_results.html +++ b/phpBB/styles/prosilver/template/search_results.html @@ -66,7 +66,7 @@
    {searchresults.TOPIC_VIEWS}
    {L_POST_BY_AUTHOR} {searchresults.LAST_POST_AUTHOR_FULL} - {LAST_POST_IMG}
    {L_POSTED_ON_DATE} {searchresults.LAST_POST_TIME}
    + {LAST_POST_IMG}
    {L_POSTED_ON_DATE} {searchresults.LAST_POST_TIME}
    diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index 056afb0548..b3f81df865 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -147,7 +147,7 @@
    {topicrow.REPLIES} {L_REPLIES}
    {topicrow.VIEWS} {L_VIEWS}
    {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} - {LAST_POST_IMG}
    {L_POSTED_ON_DATE} {topicrow.LAST_POST_TIME}
    + {LAST_POST_IMG}
    {L_POSTED_ON_DATE} {topicrow.LAST_POST_TIME}
    @@ -173,9 +173,11 @@
    {L_PREVIOUS} {L_NEXT} + +

    @@ -204,7 +206,7 @@ -

    {L_WHO_IS_ONLINE}

    +

    {L_WHO_IS_ONLINE}{L_WHO_IS_ONLINE}

    {LOGGED_IN_USER_LIST}

    diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index ee89b3b15f..5231d7934f 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -229,8 +229,10 @@
    {L_PREVIOUS} {L_NEXT} + +
    @@ -264,7 +266,7 @@ -

    {L_WHO_IS_ONLINE}

    +

    {L_WHO_IS_ONLINE}{L_WHO_IS_ONLINE}

    {LOGGED_IN_USER_LIST}

    diff --git a/phpBB/styles/subsilver2/template/forumlist_body.html b/phpBB/styles/subsilver2/template/forumlist_body.html index 70e4ca813f..368610ebe1 100644 --- a/phpBB/styles/subsilver2/template/forumlist_body.html +++ b/phpBB/styles/subsilver2/template/forumlist_body.html @@ -60,7 +60,7 @@

    {forumrow.LAST_POST_TIME}

    {forumrow.LAST_POSTER_FULL} - {LAST_POST_IMG} + {LAST_POST_IMG}

    {L_NO_POSTS}

    diff --git a/phpBB/styles/subsilver2/template/index_body.html b/phpBB/styles/subsilver2/template/index_body.html index 3958743229..bf523dc3f2 100644 --- a/phpBB/styles/subsilver2/template/index_body.html +++ b/phpBB/styles/subsilver2/template/index_body.html @@ -10,7 +10,9 @@ -{L_DELETE_COOKIES} | {L_THE_TEAM}
    + +{L_DELETE_COOKIES} | {L_THE_TEAM}
    +
    diff --git a/phpBB/styles/subsilver2/template/viewforum_body.html b/phpBB/styles/subsilver2/template/viewforum_body.html index c196bc60a0..c4375b6415 100644 --- a/phpBB/styles/subsilver2/template/viewforum_body.html +++ b/phpBB/styles/subsilver2/template/viewforum_body.html @@ -58,7 +58,7 @@

    {topicrow.LAST_POST_TIME}

    {topicrow.LAST_POST_AUTHOR_FULL} - {LAST_POST_IMG} + {LAST_POST_IMG}

    @@ -209,7 +209,7 @@

    {topicrow.LAST_POST_TIME}

    {topicrow.LAST_POST_AUTHOR_FULL} - {LAST_POST_IMG} + {LAST_POST_IMG}

    @@ -226,6 +226,7 @@ + @@ -235,6 +236,7 @@
    {L_DISPLAY_TOPICS}: {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} 
    + diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html index cf264ca4f8..b177a15250 100644 --- a/phpBB/styles/subsilver2/template/viewtopic_body.html +++ b/phpBB/styles/subsilver2/template/viewtopic_body.html @@ -290,11 +290,13 @@ +
    {L_DISPLAY_POSTS}: {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} 
    + -- cgit v1.2.1