]> git.mjollnir.org Git - moodle.git/commitdiff
Sort group members by last access by default
authormoodler <moodler>
Sat, 10 Jan 2004 16:52:33 +0000 (16:52 +0000)
committermoodler <moodler>
Sat, 10 Jan 2004 16:52:33 +0000 (16:52 +0000)
lib/datalib.php

index 06d4011bdb84c8407878f009a8d56185bb777c8d..0c88b64796a1a92b28780bf77dd37867c742d92f 100644 (file)
@@ -1454,14 +1454,14 @@ function get_groups($courseid, $userid=0) {
 * 
 * @param       type description
 */
-function get_users_in_group($groupid) {
+function get_users_in_group($groupid, $sort="u.lastaccess DESC") {
     global $CFG;
     return get_records_sql("SELECT DISTINCT u.*
                               FROM {$CFG->prefix}user u,
                                    {$CFG->prefix}groups_members m 
                              WHERE m.groupid = '$groupid'
                                AND m.userid = u.id 
-                          ORDER BY u.id");
+                          ORDER BY $sort");
 }
 
 /**