merged fix for MDL-10469, users with doanything has no courses showing

This commit is contained in:
toyomoyo 2007-07-18 07:02:54 +00:00
parent 1ad2f41253
commit 61f774e8f6

View File

@ -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;
}