Skip to content

Commit

Permalink
MDL-28348 prevent circular references in meta handler for enrolments
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jul 17, 2011
1 parent 617027c commit ebbc9e7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions enrol/meta/locallib.php
Expand Up @@ -128,6 +128,11 @@ public function user_enrolled($ue) {
return true; return true;
} }


if ($ue->enrol === 'meta') {
// prevent circular dependencies - we can not sync meta enrolments recursively
return true;
}

// does anything want to sync with this parent? // does anything want to sync with this parent?
if (!$enrols = $DB->get_records('enrol', array('customint1'=>$ue->courseid, 'enrol'=>'meta'), 'id ASC')) { if (!$enrols = $DB->get_records('enrol', array('customint1'=>$ue->courseid, 'enrol'=>'meta'), 'id ASC')) {
return true; return true;
Expand Down

0 comments on commit ebbc9e7

Please sign in to comment.