summaryrefslogtreecommitdiff
path: root/sqlbox
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-02-14 10:52:30 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-02-14 10:55:34 +0100
commit56d20224c2d57ae8682a41c9f46e7d048ce9f79e (patch)
treea72a14377a49481d4600bf44be529da5e7a9260a /sqlbox
parent78780e9fc7a7663e0a3865bb7fd475eecde24750 (diff)
downloadsqltutor-plugin-56d20224c2d57ae8682a41c9f46e7d048ce9f79e.tar.gz
sqltutor-plugin-56d20224c2d57ae8682a41c9f46e7d048ce9f79e.tar.bz2
sqltutor-plugin-56d20224c2d57ae8682a41c9f46e7d048ce9f79e.zip
reportall: Show only enrolled users
Diffstat (limited to 'sqlbox')
-rw-r--r--sqlbox/reportall.php8
1 files changed, 7 insertions, 1 deletions
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;