fixed category sync cleanup

This commit is contained in:
Petr Skoda 2010-09-17 12:35:22 +00:00
parent 894843b465
commit ac86edd01a

View file

@ -250,9 +250,11 @@ function enrol_category_sync_full() {
if (!$roles = get_roles_with_capability('enrol/category:synchronised', CAP_ALLOW, $syscontext)) {
// yay, nothing to do, so let's remove all leftovers
if ($instances = $DB->get_records('enrol', array('enrol'=>'category'))) {
foreach ($instances as $instance) {
$plugin->delete_instance($instance);
}
}
}
list($roleids, $params) = $DB->get_in_or_equal(array_keys($roles), SQL_PARAMS_NAMED, 'r000');
$params['courselevel'] = CONTEXT_COURSE;