diff --git a/main/user/user.php b/main/user/user.php index aeba8d108d..12a8a0aa20 100644 --- a/main/user/user.php +++ b/main/user/user.php @@ -129,6 +129,9 @@ if (api_is_allowed_to_edit(null, true)) { $sql_query .= " AND user.user_id = au.user_id AND access_url_id = $current_access_url_id "; } + //only users no coaches/teachers + $sql_query .= " AND session_course_user.status = 0 "; + $sql_query .= $sort_by_first_name ? ' ORDER BY user.firstname, user.lastname' : ' ORDER BY user.lastname, user.firstname'; $rs = Database::query($sql_query); @@ -172,6 +175,10 @@ if (api_is_allowed_to_edit(null, true)) { $sql_query .= " AND user.user_id = au.user_id AND access_url_id = $current_access_url_id "; } + //only users no teachers/coaches + $sql_query .= " AND course_user.status = 5 "; + + $sql_query .= ($sort_by_first_name ? " ORDER BY user.firstname, user.lastname" : " ORDER BY user.lastname, user.firstname"); $rs = Database::query($sql_query);