datalib: get_courses_wmanagers() exclude the sitecourse
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:49:10 +0000 (07:49 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:49:10 +0000 (07:49 +0000)
Should never return the sitecourse - so we exclude it explicitly.

lib/datalib.php

index 49835aef6e01994f5e8645accdb02aac584e05a5..19e92c2e664941e87f629b6083350603a9a50b6a 100644 (file)
@@ -660,9 +660,9 @@ function get_courses_wmanagers($categoryid=0, $sort="c.sortorder ASC", $fields=a
         $sortstatement = "ORDER BY $sort";
     }
 
-    $where = '';
+    $where = 'WHERE c.id != ' . SITEID;
     if ($categoryclause !== ''){
-        $where = "WHERE $categoryclause";
+        $where = "$where AND $categoryclause";
     }
 
     // pull out all courses matching the cat