diff --git a/main/mySpace/index.php b/main/mySpace/index.php index 118a6c9073..deb822de58 100644 --- a/main/mySpace/index.php +++ b/main/mySpace/index.php @@ -422,15 +422,12 @@ if (empty($session_id)) { $nb_posts = null; } } else { - $courses = Tracking::get_courses_followed_by_coach($user_id, $session_id); - // If is drh if ($is_drh) { $courses_of_the_platform = CourseManager::get_courses_followed_by_drh($user_id); $courses_from_session = SessionManager::get_course_list_by_session_id($session_id); $courses = array(); - foreach ($courses_from_session as $course_item) { if (api_drh_can_access_all_session_content()) { $courses[$course_item['code']] = $course_item['code']; @@ -444,7 +441,9 @@ if (empty($session_id)) { if (empty($courses)) { Display::display_warning_message(get_lang('NoResults')); } - } + } else { + $courses = Tracking::get_courses_followed_by_coach($user_id, $session_id); + } //Courses for the user $count_courses = count($courses); diff --git a/main/user/user.php b/main/user/user.php index 1c9ba97d3c..39fc82c8de 100644 --- a/main/user/user.php +++ b/main/user/user.php @@ -38,11 +38,11 @@ require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php'; global $_configuration; if (!api_is_platform_admin(true)) { - if (!api_is_course_admin() && !api_is_coach()) { - if (api_get_course_setting('allow_user_view_user_list') == 0) { - api_not_allowed(true); - } - } + if (!api_is_course_admin() && !api_is_coach()) { + if (api_get_course_setting('allow_user_view_user_list') == 0) { + api_not_allowed(true); + } + } } /* @@ -326,7 +326,7 @@ if (api_is_allowed_to_edit(null, true)) { } -/* FUNCTIONS */ +/* FUNCTIONS */ function display_user_search_form() { echo '
';