From f0005e55a02eb41c6480825e6a6046ac5722d725 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Fri, 13 Nov 2015 17:31:05 -0500 Subject: [PATCH] Fix access to gamification progress page - refs BT#10524 #TMI --- main/gamification/my_progress.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main/gamification/my_progress.php b/main/gamification/my_progress.php index 249b8d3140..5493b00589 100644 --- a/main/gamification/my_progress.php +++ b/main/gamification/my_progress.php @@ -33,11 +33,15 @@ if (empty($sessionId)) { ); $lastCourseAccess = $trackCourseAccessRepository->getLastAccessByUser($user); + $lastSessionId = 0; + if ($lastCourseAccess) { $lastSessionId = $lastCourseAccess->getSessionId(); } - if (!empty($lastSessionId)) { + $UserIsSubscribedToSession = SessionManager::isUserSubscribedAsStudent($lastSessionId, $user->getId()); + + if (!empty($lastSessionId) && $UserIsSubscribedToSession) { $urlWithSession = api_get_self() . '?' . http_build_query([ 'session_id' => $lastCourseAccess->getSessionId() ]);