Use the new get_recent_enrolments() function in datalib to find users

in recent_activity
This commit is contained in:
moodler 2003-08-17 01:46:00 +00:00
parent 0a08581d61
commit 6c38b7e012

View file

@ -234,22 +234,18 @@ function print_recent_activity($course) {
$heading = false; $heading = false;
$content = false; $content = false;
$logs = get_records_select("log", "time > '$timestart' AND course = '$course->id' AND $users = get_recent_enrolments($course->id, $timestart);
module = 'course' AND action = 'enrol'", "time ASC");
if ($logs) { if ($users) {
foreach ($logs as $key => $log) { foreach ($users as $user) {
if (! $heading) { if (! $heading) {
print_headline(get_string("newusers").":"); print_headline(get_string("newusers").":");
$heading = true; $heading = true;
$content = true; $content = true;
} }
$user = get_record("user", "id", $log->info);
if (isstudent($course->id, $user->id)) {
echo "<p><font size=1><a href=\"../user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</a></font></p>"; echo "<p><font size=1><a href=\"../user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</a></font></p>";
} }
} }
}
// Next, have there been any modifications to the course structure? // Next, have there been any modifications to the course structure?