From: moodler Date: Sun, 17 Aug 2003 01:46:00 +0000 (+0000) Subject: Use the new get_recent_enrolments() function in datalib to find users X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=6c38b7e0129864c237893f30037eaee8ba9b75fc;p=moodle.git Use the new get_recent_enrolments() function in datalib to find users in recent_activity --- diff --git a/course/lib.php b/course/lib.php index f25bad8a0d..1c9f4f3299 100644 --- a/course/lib.php +++ b/course/lib.php @@ -234,20 +234,16 @@ function print_recent_activity($course) { $heading = false; $content = false; - $logs = get_records_select("log", "time > '$timestart' AND course = '$course->id' AND - module = 'course' AND action = 'enrol'", "time ASC"); + $users = get_recent_enrolments($course->id, $timestart); - if ($logs) { - foreach ($logs as $key => $log) { + if ($users) { + foreach ($users as $user) { if (! $heading) { print_headline(get_string("newusers").":"); $heading = true; $content = true; } - $user = get_record("user", "id", $log->info); - if (isstudent($course->id, $user->id)) { - echo "

id&course=$course->id\">$user->firstname $user->lastname

"; - } + echo "

id&course=$course->id\">$user->firstname $user->lastname

"; } }