mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 19:50:14 +01:00
merged fix for MDL-10469, users with doanything has no courses showing
This commit is contained in:
parent
1ad2f41253
commit
61f774e8f6
@ -719,7 +719,7 @@ function get_my_courses($userid, $sort=NULL, $fields=NULL, $doanything=false,$li
|
||||
$sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
|
||||
|
||||
// Guest's do not have any courses
|
||||
if (has_capability('moodle/legacy:guest',$sitecontext,$userid,true)) {
|
||||
if (has_capability('moodle/legacy:guest',$sitecontext,$userid,false)) {
|
||||
return(array());
|
||||
}
|
||||
|
||||
@ -811,7 +811,6 @@ ORDER BY $sort");
|
||||
if (!empty($USER->id) && ($USER->id == $userid) && $usingdefaults) {
|
||||
$USER->mycourses[$doanything] = $mycourses;
|
||||
}
|
||||
|
||||
return $mycourses;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user