From: thepurpleblob Date: Wed, 21 May 2008 12:03:22 +0000 (+0000) Subject: MDL-14832 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9d5a4b235e63bdc10e6bd9e2a9ec792f943ec97e;p=moodle.git MDL-14832 Don't show a user name more than once. Only show them in the most 'senior' role. Merged from STABLE_19 --- diff --git a/course/lib.php b/course/lib.php index 7b3db0a5c6..db38429a1b 100644 --- a/course/lib.php +++ b/course/lib.php @@ -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) {