MDL-67016 profile: current user should see his own courses
authorDaniel Poggenpohl <daniel.poggenpohl@fernuni-hagen.de>
Thu, 31 Oct 2019 13:35:56 +0000 (14:35 +0100)
committerDaniel Poggenpohl <daniel.poggenpohl@fernuni-hagen.de>
Thu, 31 Oct 2019 13:35:56 +0000 (14:35 +0100)
lib/myprofilelib.php

index 397d5b3..87c792d 100644 (file)
@@ -227,7 +227,7 @@ function core_myprofile_navigation(core_user\output\myprofile\tree $tree, $user,
         $tree->add_node($node);
     }
 
-    if (!isset($hiddenfields['mycourses'])) {
+    if ($iscurrentuser || !isset($hiddenfields['mycourses'])) {
         $showallcourses = optional_param('showallcourses', 0, PARAM_INT);
         if ($mycourses = enrol_get_all_users_courses($user->id, true, null)) {
             $shown = 0;