mirror of
https://github.com/moodle/moodle.git
synced 2025-08-10 11:26:41 +02:00
MDL-78129 communication_matrix: Update room membership on unennrol
This commit is contained in:
parent
2dc30d662e
commit
d72ebf1bf2
1 changed files with 13 additions and 11 deletions
|
@ -1699,17 +1699,6 @@ function role_unassign($roleid, $userid, $contextid, $component = '', $itemid =
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the room membership and power levels when the user role changes.
|
|
||||||
if (\core_communication\api::is_available() && $coursecontext = $context->get_course_context(false)) {
|
|
||||||
$communication = \core_communication\api::load_by_instance(
|
|
||||||
'core_course',
|
|
||||||
'coursecommunication',
|
|
||||||
$coursecontext->instanceid,
|
|
||||||
);
|
|
||||||
|
|
||||||
$communication->update_room_membership([$userid]);
|
|
||||||
}
|
|
||||||
|
|
||||||
role_unassign_all(array('roleid'=>$roleid, 'userid'=>$userid, 'contextid'=>$contextid, 'component'=>$component, 'itemid'=>$itemid), false, false);
|
role_unassign_all(array('roleid'=>$roleid, 'userid'=>$userid, 'contextid'=>$contextid, 'component'=>$component, 'itemid'=>$itemid), false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1772,6 +1761,19 @@ function role_unassign_all(array $params, $subcontexts = false, $includemanual =
|
||||||
$event->add_record_snapshot('role_assignments', $ra);
|
$event->add_record_snapshot('role_assignments', $ra);
|
||||||
$event->trigger();
|
$event->trigger();
|
||||||
core_course_category::role_assignment_changed($ra->roleid, $context);
|
core_course_category::role_assignment_changed($ra->roleid, $context);
|
||||||
|
|
||||||
|
// Update the room membership and power levels when the user role changes.
|
||||||
|
if (\core_communication\api::is_available() && $coursecontext = $context->get_course_context(false)) {
|
||||||
|
$communication = \core_communication\api::load_by_instance(
|
||||||
|
'core_course',
|
||||||
|
'coursecommunication',
|
||||||
|
$coursecontext->instanceid,
|
||||||
|
);
|
||||||
|
|
||||||
|
$communication->update_room_membership([$ra->userid]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($ras);
|
unset($ras);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue