Allow to the invited users enter in their assigned courses only - refs BT#9070

1.10.x
Angel Fernando Quiroz Campos 10 years ago
parent a86668d36f
commit fc1a4a9e74
  1. 10
      main/course_home/course_home.php
  2. 5
      main/inc/lib/course.lib.php

@ -142,8 +142,18 @@ define('TOOL_ADMIN_VISIBLE', 'tooladminvisible');
$user_id = api_get_user_id();
$course_code = api_get_course_id();
$sessionId = api_get_session_id();
$show_message = '';
if (api_is_invited_user()) {
$isInASession = $sessionId > 0;
$isSubscribed = CourseManager::is_user_subscribed_in_course($user_id, $course_code, $isInASession, $sessionId);
if (!$isSubscribed) {
api_not_allowed(true);
}
}
//Deleting group session
Session::erase('toolgroup');
Session::erase('_gid');

@ -4535,6 +4535,11 @@ class CourseManager
public static function return_hot_courses($days = 30, $limit = 5)
{
global $_configuration;
if (api_is_invited_user()) {
return array();
}
$limit = intval($limit);
// Getting my courses

Loading…
Cancel
Save