Fix condition whereby a user that never accessed a session with duration to which he is subscribed could not see it in courses list - refs #8317

1.9.x
Yannick Warnier 10 years ago
parent b78c707420
commit 325c14fcb7
  1. 5
      main/inc/lib/main_api.lib.php

@ -2024,6 +2024,11 @@ function api_get_session_visibility($session_id, $course_code = null, $ignore_vi
$session_id,
api_get_user_id()
);
// If there is a session duration but there is no previous
// access by the user, then the session is still available
if (count($courseAccess) == 0) {
return SESSION_AVAILABLE;
}
$currentTime = time();
$firstAccess = api_strtotime($courseAccess['login_course_date'], 'UTC');
$userDurationData = SessionManager::getUserSession(

Loading…
Cancel
Save