]> git.mjollnir.org Git - moodle.git/commitdiff
merged fix for MDL-10469, users with doanything has no courses showing
authortoyomoyo <toyomoyo>
Wed, 18 Jul 2007 07:02:54 +0000 (07:02 +0000)
committertoyomoyo <toyomoyo>
Wed, 18 Jul 2007 07:02:54 +0000 (07:02 +0000)
lib/datalib.php

index 5d0f936928f86246d1d53071e474a02858924551..cca5b983567a9d4c50f30dee2950694adf3f46f7 100644 (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;
 }