Fix access to gamification progress page - refs BT#10524 #TMI

1.10.x
Angel Fernando Quiroz Campos 10 years ago
parent fe32a14abf
commit f0005e55a0
  1. 6
      main/gamification/my_progress.php

@ -33,11 +33,15 @@ if (empty($sessionId)) {
); );
$lastCourseAccess = $trackCourseAccessRepository->getLastAccessByUser($user); $lastCourseAccess = $trackCourseAccessRepository->getLastAccessByUser($user);
$lastSessionId = 0;
if ($lastCourseAccess) { if ($lastCourseAccess) {
$lastSessionId = $lastCourseAccess->getSessionId(); $lastSessionId = $lastCourseAccess->getSessionId();
} }
if (!empty($lastSessionId)) { $UserIsSubscribedToSession = SessionManager::isUserSubscribedAsStudent($lastSessionId, $user->getId());
if (!empty($lastSessionId) && $UserIsSubscribedToSession) {
$urlWithSession = api_get_self() . '?' . http_build_query([ $urlWithSession = api_get_self() . '?' . http_build_query([
'session_id' => $lastCourseAccess->getSessionId() 'session_id' => $lastCourseAccess->getSessionId()
]); ]);

Loading…
Cancel
Save