]> git.mjollnir.org Git - moodle.git/commitdiff
Putting in a placeholder when counting or gettig users in group 0
authormoodler <moodler>
Sat, 31 Jan 2004 04:03:46 +0000 (04:03 +0000)
committermoodler <moodler>
Sat, 31 Jan 2004 04:03:46 +0000 (04:03 +0000)
(return nothing for now)

lib/datalib.php

index 207a75ea610f58e80947239b48789c91a92d8e8b..f6858d7af60f14b37306895261b6722a886fadd2 100644 (file)
@@ -1102,7 +1102,10 @@ function get_course_students($courseid, $sort="s.timeaccess", $dir="", $page=0,
         $select .= " AND u.lastname $LIKE '$lastinitial%' ";
     }
 
-    if ($group) {
+    if ($group === 0) {   /// Need something here to get all students not in a group
+        return array();
+
+    } else if ($group !== NULL) {
         $groupmembers = ", {$CFG->prefix}groups_members gm ";
         $select .= " AND u.id = gm.userid AND gm.groupid = '$group'";
     }
@@ -1144,7 +1147,11 @@ function count_course_students($course, $search="", $firstinitial="", $lastiniti
     if ($lastinitial) {
         $select .= " AND u.lastname $LIKE '$lastinitial%'";
     } 
-    if ($group) {
+
+    if ($group === 0) {   /// Need something here to get all students not in a group
+        return 0;
+
+    } else if ($group !== NULL) {
         $groupmembers = ", {$CFG->prefix}groups_members gm ";
         $select .= " AND u.id = gm.userid AND gm.groupid = '$group'";
     }