mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-67312 core_user: clean subs events on user deletion
This commit is contained in:
parent
f35e360a3b
commit
c7027c037b
@ -4250,7 +4250,10 @@ function delete_user(stdClass $user) {
|
||||
|
||||
// Now do a brute force cleanup.
|
||||
|
||||
// Remove user's calendar subscriptions.
|
||||
// Delete all user events and subscription events.
|
||||
$DB->delete_records_select('event', 'userid = :userid AND subscriptionid IS NOT NULL', ['userid' => $user->id]);
|
||||
|
||||
// Now, delete all calendar subscription from the user.
|
||||
$DB->delete_records('event_subscriptions', ['userid' => $user->id]);
|
||||
|
||||
// Remove from all cohorts.
|
||||
|
Loading…
x
Reference in New Issue
Block a user