### Eclipse Workspace Patch 1.0
#P moodle
Index: course/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/lib.php,v
retrieving revision 1.538.2.66
diff -u -r1.538.2.66 lib.php
--- course/lib.php	17 Dec 2008 12:40:09 -0000	1.538.2.66
+++ course/lib.php	20 Dec 2008 14:26:22 -0000
@@ -834,7 +834,14 @@
 
 /// Firstly, have there been any new enrolments?
 
-    $users = get_recent_enrolments($course->id, $timestart);
+    $sql = "SELECT DISTINCT u.id, u.firstname, u.lastname, ra.timemodified
+                            FROM {$CFG->prefix}user u INNER JOIN
+                                 {$CFG->prefix}role_assignments ra
+                            ON u.id = ra.userid AND ra.contextid ".get_related_contexts_string($context)."
+                            WHERE ra.timemodified > '$timestart'
+                            ORDER BY ra.timemodified ASC";
+    
+    $users = get_records_sql($sql);
 
     //Accessibility: new users now appear in an <OL> list.
     if ($users) {
