From 4d93bc9e19a88084881a2b36a27ea9656027b7a2 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Mon, 24 Mar 2008 01:29:30 +0000 Subject: [PATCH] Make list of participants to work on SITE course. Fix for MDL-14034 ; merged from 19_STABLE --- user/index.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/user/index.php b/user/index.php index 1a7f0a38c9..ab1bccc1b4 100644 --- a/user/index.php +++ b/user/index.php @@ -450,10 +450,18 @@ /// 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); -- 2.39.5