Skip to content

Commit

Permalink
Merge branch 'MDL-64714-35' of git://github.com/cescobedo/moodle into…
Browse files Browse the repository at this point in the history
… MOODLE_35_STABLE
  • Loading branch information
andrewnicols committed Feb 13, 2019
2 parents c35399c + 1210555 commit ea2ed45
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
10 changes: 6 additions & 4 deletions auth/mnet/classes/privacy/provider.php
Expand Up @@ -273,13 +273,15 @@ public static function delete_data_for_user(approved_contextlist $contextlist) {
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]);
}
}
}
9 changes: 6 additions & 3 deletions auth/oauth2/classes/privacy/provider.php
Expand Up @@ -178,12 +178,15 @@ public static function delete_data_for_user(approved_contextlist $contextlist) {
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);
}
}

Expand Down

0 comments on commit ea2ed45

Please sign in to comment.