]> git.mjollnir.org Git - moodle.git/commitdiff
FIxed a PHP5 notice
authormoodler <moodler>
Sat, 7 Aug 2004 13:36:57 +0000 (13:36 +0000)
committermoodler <moodler>
Sat, 7 Aug 2004 13:36:57 +0000 (13:36 +0000)
lib/datalib.php

index 0e7f340d343d38c63acdbfabf1004eee0d69668a..7fbcbabf0c1ba44b6f1c1290815ef8fd8a0ad0cd 100644 (file)
@@ -1683,7 +1683,7 @@ function get_courses($categoryid="all", $sort="c.sortorder ASC", $fields="c.*")
     if (!empty($categoryselect)) {
         $sqland = "AND ";
     }
-    if (!empty($USER)) {  // May need to check they are a teacher
+    if (!empty($USER->id)) {  // May need to check they are a teacher
         if (!iscreator()) {
             $visiblecourses = "$sqland ((c.visible > 0) OR (t.userid = '$USER->id' AND t.course = c.id))";
             $teachertable = ", {$CFG->prefix}user_teachers t";