-
Bug
-
Resolution: Fixed
-
Minor
-
3.5.8, 3.6.6, 3.7.2, STABLE backlog
-
MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
-
MOODLE_36_STABLE, MOODLE_37_STABLE
-
MDL-67016-master-user-profile-see-own-courses -
See https://tracker.moodle.org/browse/MDL-21394.
Our version is Moodle 3.5.8. The problem is still present in master.
Configure "mycourses" as a hidden user field, login as a user without the capability "moodle/user:viewhiddendetails" and you can't see your own courses.
Solution would just be to check for $iscurrentuser, e.g.:
if (!isset($hiddenfields['mycourses']) || $iscurrentuser) { |
$showallcourses = optional_param('showallcourses', 0, PARAM_INT); |
if ($mycourses = enrol_get_all_users_courses($user->id, true, null)) { |
$shown = 0; |