From f6f319f852b4c57f1542d8fcf41dfc3543eb9c63 Mon Sep 17 00:00:00 2001 From: moodler Date: Sat, 25 Sep 2004 15:19:40 +0000 Subject: [PATCH] Merged fox for bug 1991 to head --- lib/datalib.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/datalib.php b/lib/datalib.php index 8f962f7729..f21a833ebf 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -1456,9 +1456,11 @@ function get_course_teachers($courseid, $sort='t.authority ASC', $exceptions='') global $CFG; if (!empty($exceptions)) { - $except = ' AND u.id NOT IN ('. $exceptions .') '; - } else { - $except = ''; + $exceptions = ' AND u.id NOT IN ('. $exceptions .') '; + } + + if (!empty($sort)) { + $sort = ' ORDER by '.$sort; } return get_records_sql("SELECT u.id, u.username, u.firstname, u.lastname, u.maildisplay, u.mailformat, u.maildigest, @@ -1467,8 +1469,7 @@ function get_course_teachers($courseid, $sort='t.authority ASC', $exceptions='') FROM {$CFG->prefix}user u, {$CFG->prefix}user_teachers t WHERE t.course = '$courseid' AND t.userid = u.id - AND u.deleted = '0' AND u.confirmed = '1' $except - ORDER BY $sort"); + AND u.deleted = '0' AND u.confirmed = '1' $exceptions $sort"); } /** @@ -2675,4 +2676,4 @@ function print_object($object) { // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140: -?> \ No newline at end of file +?> -- 2.39.5