]> git.mjollnir.org Git - moodle.git/commitdiff
Make list of participants to work on SITE course. Fix for MDL-14034 ; merged from...
authorstronk7 <stronk7>
Mon, 24 Mar 2008 01:29:30 +0000 (01:29 +0000)
committerstronk7 <stronk7>
Mon, 24 Mar 2008 01:29:30 +0000 (01:29 +0000)
user/index.php

index 1a7f0a38c9269c37ad087cfe981fd71bf4886dcd..ab1bccc1b4016b2812f049e34f7d0f9c418f9b40 100644 (file)
 
     /// Always add r.hidden to sort in order to guarantee hiddens to "win"
     /// in the resolution of duplicates later - MDL-13935
+    /// Only exception is frontpage that doesn't have such r.hidden info
+    /// because it retrieves ALL users (without role checking) - MDL-14034
     if ($table->get_sql_sort()) {
-        $sort = ' ORDER BY '.$table->get_sql_sort() . ', r.hidden DESC';
+        $sort = ' ORDER BY '.$table->get_sql_sort();
+        if ($context->id != $frontpagectx->id) {
+            $sort .= ', r.hidden DESC';
+        }
     } else {
-        $sort = ' r.hidden DESC';
+        $sort = '';
+        if ($context->id != $frontpagectx->id) {
+            $sort .= ' ORDER BY r.hidden DESC';
+        }
     }
 
     $matchcount = count_records_sql('SELECT COUNT(distinct u.id) '.$from.$where.$wheresearch);