Permalink
Browse files

MDL-30528 stop recreating role_assignments on every login attempt for…

… each user

Credit goes to Luis Gustavo Mueller de Alcantara.
  • Loading branch information...
skodak authored and Sam Hemelryk committed Dec 3, 2011
1 parent a33d85b commit cad8d5ccb07b6e2a1945388c223564cffe3cd228
Showing with 1 addition and 1 deletion.
  1. +1 −1 enrol/database/lib.php
View
@@ -185,7 +185,7 @@ public function sync_user_enrolments($user) {
$existing = array();
foreach ($current as $r) {
- if (in_array($r->id, $roles)) {
+ if (in_array($r->roleid, $roles)) {
$existing[$r->roleid] = $r->roleid;
} else {
role_unassign($r->roleid, $user->id, $context->id, 'enrol_database', $instance->id);

0 comments on commit cad8d5c

Please sign in to comment.