Browse files

Merge branch 'w36_MDL-29306_m21_dbenrolroles' of git://github.com/sko…

…dak/moodle into MOODLE_21_STABLE
  • Loading branch information...
2 parents 786a905 + 3dfac46 commit 4a277f4f4e26330293ce2653ccc6ed698ac77e03 Sam Hemelryk committed Sep 12, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 enrol/database/lib.php
View
8 enrol/database/lib.php
@@ -446,6 +446,14 @@ public function sync_enrolments() {
}
}
+ // assign extra roles
+ foreach ($userroles as $roleid) {
+ if (empty($current_roles[$userid][$roleid])) {
+ role_assign($roleid, $userid, $context->id, 'enrol_database', $instance->id);
+ $current_roles[$userid][$roleid] = $roleid;
+ }
+ }
+
// unassign removed roles
foreach($current_roles[$userid] as $cr) {
if (empty($userroles[$cr])) {

0 comments on commit 4a277f4

Please sign in to comment.