From 56d20224c2d57ae8682a41c9f46e7d048ce9f79e Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Thu, 14 Feb 2013 10:52:30 +0100 Subject: reportall: Show only enrolled users --- sqlbox/reportall.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sqlbox/reportall.php') diff --git a/sqlbox/reportall.php b/sqlbox/reportall.php index 7ba70ce..abb799c 100644 --- a/sqlbox/reportall.php +++ b/sqlbox/reportall.php @@ -47,7 +47,13 @@ $table = new html_table; $table->head = array_merge(array("Nutzer", "Fortschritt"), $b); $table->align = array_merge(array("left", "left"), array_fill(0, count($b), 'center')); -$users = $DB->get_records("user", array('deleted'=>'0')); +$users = $DB->get_records_sql("select u.* from {enrol} e, {user_enrolments} ue, {user} u + where e.courseid=:courseid and + ue.enrolid = e.id and + ue.userid = u.id and + u.deleted = 0", + array('courseid'=>$course->id)); + foreach ($users as $user) { if (isguestuser($user)) continue; -- cgit