Permalink
Browse files

Fixed a PHP5 notice

  • Loading branch information...
moodler
moodler committed Dec 15, 2004
1 parent a97e45b commit fb97c774fccc5a222f87e584a652ee108bff85a3
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/datalib.php
View
@@ -1867,7 +1867,7 @@ function get_courses_page($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) and !empty($USER->id)) { // May need to check they are a teacher
if (!iscreator()) {
$visiblecourses = "$sqland ((c.visible > 0) OR t.userid = '$USER->id')";
$teachertable = "LEFT JOIN {$CFG->prefix}user_teachers t ON t.course=c.id";

0 comments on commit fb97c77

Please sign in to comment.