mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-64714 core_auth: Fix early break foreach in delete_data_for_user
This commit is contained in:
parent
a62e275984
commit
00b4f9e234
2 changed files with 12 additions and 7 deletions
|
@ -273,13 +273,15 @@ class provider implements
|
|||
return;
|
||||
}
|
||||
|
||||
$userid = $contextlist->get_user()->id;
|
||||
foreach ($contextlist->get_contexts() as $context) {
|
||||
if ($context->contextlevel != CONTEXT_USER) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
if ($context->instanceid == $userid) {
|
||||
// Because we only use user contexts the instance ID is the user ID.
|
||||
$DB->delete_records('mnet_log', ['userid' => $context->instanceid]);
|
||||
}
|
||||
|
||||
// Because we only use user contexts the instance ID is the user ID.
|
||||
$DB->delete_records('mnet_log', ['userid' => $context->instanceid]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -178,12 +178,15 @@ class provider implements
|
|||
if (empty($contextlist->count())) {
|
||||
return;
|
||||
}
|
||||
$userid = $contextlist->get_user()->id;
|
||||
foreach ($contextlist->get_contexts() as $context) {
|
||||
if ($context->contextlevel != CONTEXT_USER) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
if ($context->instanceid == $userid) {
|
||||
// Because we only use user contexts the instance ID is the user ID.
|
||||
static::delete_user_data($context->instanceid);
|
||||
}
|
||||
// Because we only use user contexts the instance ID is the user ID.
|
||||
static::delete_user_data($context->instanceid);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue