]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14832
authorthepurpleblob <thepurpleblob>
Wed, 21 May 2008 12:03:22 +0000 (12:03 +0000)
committerthepurpleblob <thepurpleblob>
Wed, 21 May 2008 12:03:22 +0000 (12:03 +0000)
Don't show a user name more than once. Only show them in the
most 'senior' role.

Merged from STABLE_19

course/lib.php

index 7b3db0a5c6c82858584e9ba08cd43afe282efd12..db38429a1b834a614267b9315680318afd1b1f41 100644 (file)
@@ -1883,7 +1883,16 @@ function print_course($course) {
                     $aliasnames = get_records('role_names', 'contextid', $context->id,'','roleid,contextid,name');
                 }
 
+                // keep a note of users displayed to eliminate duplicates
+                $usersshown = array();
                 foreach ($rusers as $ra) {
+
+                    // if we've already displayed user don't again
+                    if (in_array($ra->user->id,$usersshown)) {
+                        continue;
+                    }
+                    $usersshown[] = $ra->user->id;
+
                     if ($ra->hidden == 0 || $canseehidden) {
                         $fullname = fullname($ra->user, $canviewfullnames); 
                         if ($ra->hidden == 1) {