Minor - improving code.

1.9.x
Julio Montoya 11 years ago
parent cc5b2ec93b
commit ed678500f4
  1. 7
      main/mySpace/index.php
  2. 12
      main/user/user.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);

@ -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 '<form method="get" action="user.php">';

Loading…
Cancel
Save