Permalink
Browse files

Merge branch 'MDL-25988_20_wip_enrolroles' of git://github.com/skodak…

…/moodle
  • Loading branch information...
2 parents a1e26b5 + 3093ce8 commit 69f9e678a336a073b862bef34516303420c1ea9c Sam Hemelryk committed Jan 18, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 enrol/database/lib.php
View
6 enrol/database/lib.php
@@ -430,8 +430,8 @@ public function sync_enrolments() {
unset($user_mapping);
// enrol all users and sync roles
- foreach ($requested_roles as $userid=>$roles) {
- foreach ($roles as $roleid) {
+ foreach ($requested_roles as $userid=>$userroles) {
+ foreach ($userroles as $roleid) {
if (empty($current_roles[$userid])) {
$this->enrol_user($instance, $userid, $roleid);
$current_roles[$userid][$roleid] = $roleid;
@@ -441,7 +441,7 @@ public function sync_enrolments() {
// unassign removed roles
foreach($current_roles[$userid] as $cr) {
- if (empty($roles[$cr])) {
+ if (empty($userroles[$cr])) {
role_unassign($cr, $userid, $context->id, 'enrol_database', $instance->id);
unset($current_roles[$userid][$cr]);
}

0 comments on commit 69f9e67

Please sign in to comment.