From 9648c1f1f7fa79930d30adfc426a93964efd7aa7 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Fri, 29 Nov 2013 20:25:41 -0500 Subject: [PATCH] Fixed issue with visibility of pages without link - refs BT#7008 --- index.php | 5 +---- main/inc/lib/userportal.lib.php | 6 +++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index 6cba105ddb..88c3eae65b 100644 --- a/index.php +++ b/index.php @@ -182,10 +182,7 @@ global $_configuration; if ($_configuration['hide_global_announcements_when_not_connected'] && isset($_user['user_id'])) { $controller->tpl->assign('announcements_block', $announcements_block); } -//hiding home top whe user not connected -if ($_configuration['hide_home_top_when_connected'] && !isset($_user['user_id'])) { - $controller->tpl->assign('home_page_block', $controller->return_home_page()); -} +$controller->tpl->assign('home_page_block', $controller->return_home_page()); $controller->tpl->assign('hot_courses', $hot_courses); $controller->tpl->assign('navigation_course_links', $controller->return_navigation_links()); $controller->tpl->assign('notice_block', $controller->return_notice()); diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php index 9c5b1ed43d..cd54e3fbe9 100644 --- a/main/inc/lib/userportal.lib.php +++ b/main/inc/lib/userportal.lib.php @@ -208,7 +208,7 @@ class IndexManager { /* Includes a created page */ function return_home_page() { - + global $_configuration; // Including the page for the news $html = ''; @@ -216,6 +216,10 @@ class IndexManager { $open = @(string)file_get_contents(api_get_path(SYS_PATH).$this->home.$_GET['include']); $html = api_to_system_encoding($open, api_detect_encoding(strip_tags($open))); } else { + //hiding home top when user not connected + if ($_configuration['hide_home_top_when_connected'] && isset($_user['user_id'])) { + return $html; + } if (!empty($_SESSION['user_language_choice'])) { $user_selected_language = $_SESSION['user_language_choice']; } elseif (!empty($_SESSION['_user']['language'])) {