diff --git a/main/inc/lib/main_api.lib.php b/main/inc/lib/main_api.lib.php index eaddea0604..af054f835c 100644 --- a/main/inc/lib/main_api.lib.php +++ b/main/inc/lib/main_api.lib.php @@ -2802,7 +2802,11 @@ function api_is_course_visible_for_user( $userid = null, $cid = null ) { } if( empty ($userid) or strval(intval($userid)) != $userid ) { - return false; + if ( api_is_anonymous() ) { + $userid = api_get_anonymous_id(); + } else { + return false; + } } $cid = Database::escape_string($cid); global $is_platformAdmin;