MDL-44725 Availability: Replace groupmembersonly - core_availability (2)

Remove groupmembersonly usage in the core_availability API, and change
the update code (used in backup) so that it considers groupmembersonly
when restoring old backups.
This commit is contained in:
sam marshall
2014-09-02 13:03:09 +01:00
parent 061e6b2864
commit 3d962d49cb
5 changed files with 13 additions and 49 deletions
+1 -7
View File
@@ -113,8 +113,7 @@ class info_module extends info {
* Checks if an activity is visible to the given user.
*
* Unlike other checks in the availability system, this check includes the
* $cm->visible flag and also (if enabled) the groupmembersonly feature.
* It is equivalent to $cm->uservisible.
* $cm->visible flag. It is equivalent to $cm->uservisible.
*
* If you have already checked (or do not care whether) the user has access
* to the course, you can set $checkcourse to false to save it checking
@@ -160,11 +159,6 @@ class info_module extends info {
$cm = $DB->get_record('course_modules', array('id' => $cmorid), '*', MUST_EXIST);
}
// Check the groupmembersonly feature.
if (!groups_course_module_visible($cm, $userid)) {
return false;
}
// If requested, check user can access the course.
if ($checkcourse) {
$coursecontext = \context_course::instance($cm->course);