Fixing visibility for a teacher in a course included in a session

skala
Julio Montoya 13 years ago
parent c787f599c5
commit a5fa7b8646
  1. 10
      main/inc/lib/document.lib.php

@ -1209,8 +1209,8 @@ return 'application/octet-stream';
}
} else {
$user_status = SessionManager::get_user_status_in_session($user_id, $course_info['code'], $session_id);
if (in_array($user_status, array('0', '6'))) {
//is true if is an student or a coach
if (in_array($user_status, array('0', '2', '6'))) {
//is true if is an student, course session teacher or coach
$user_in_course = true;
}
}
@ -2491,9 +2491,13 @@ return 'application/octet-stream';
if (CourseManager::is_user_subscribed_in_course($user_id, $course_info['code'])) {
$user_in_course = true;
}
//Check if course is open then we can consider that the student is regitered to the course
if (isset($course_info) && in_array($course_info['visibility'], array(2, 3))) {
$user_in_course = true;
}
} else {
$user_status = SessionManager::get_user_status_in_session($user_id, $course_info['code'], $session_id);
if (in_array($user_status, array('0', '6'))) { //user and coach
if (in_array($user_status, array('0', '2', '6'))) { //is true if is an student, course session teacher or coach
$user_in_course = true;
}
}

Loading…
Cancel
Save