MDL-82169 user: remove access to non-existent $options array.

This commit is contained in:
Paul Holden
2024-06-11 21:24:27 +01:00
parent d3ae1391ab
commit c63e3c5756
+2 -10
View File
@@ -1415,17 +1415,9 @@ class core_user {
// Params to be passed to the user view page.
$params = ['id' => $user->id];
// Get courseid if provided.
if (isset($options['courseid'])) {
$params['courseid'] = $options['courseid'];
}
// Get courseid from context if provided.
if ($context) {
$coursecontext = $context->get_course_context(false);
if ($coursecontext) {
$params['courseid'] = $coursecontext->instanceid;
}
if ($context && $coursecontext = $context->get_course_context(false)) {
$params['courseid'] = $coursecontext->instanceid;
}
// If courseid is not set or is set to site id, then return profile page, otherwise return view page.