Commit 69f9e678 authored by Sam Hemelryk's avatar Sam Hemelryk
Browse files

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

parents a1e26b5e 3093ce80
......@@ -430,8 +430,8 @@ class enrol_database_plugin extends enrol_plugin {
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 @@ class enrol_database_plugin extends enrol_plugin {
// 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]);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment