MDL-64205 users: Do not delete the actual records of unconfirmed users
There is an automatic data privacy request created to get rid of all the personal data upon the user deletion. With the actual user record absent, the data privacy requests page throws an error. Let's do here same as we do in `delete_incomplete_users_task` and let us not delete the actual user record.
This commit is contained in:
committed by
David Monllao
parent
f66db7a52b
commit
32b1faf8b7
@@ -54,9 +54,8 @@ class delete_unconfirmed_users_task extends scheduled_task {
|
||||
WHERE confirmed = 0 AND timecreated > 0
|
||||
AND timecreated < ? AND deleted = 0", array($cuttime));
|
||||
foreach ($rs as $user) {
|
||||
delete_user($user); // We MUST delete user properly first.
|
||||
$DB->delete_records('user', array('id' => $user->id)); // This is a bloody hack, but it might work.
|
||||
mtrace(" Deleted unconfirmed user for ".fullname($user, true)." ($user->id)");
|
||||
delete_user($user);
|
||||
mtrace(" Deleted unconfirmed user ".fullname($user, true)." ($user->id)");
|
||||
}
|
||||
$rs->close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user