MDL-62618 user: Display full names consistently on users page
[moodle.git] / user / classes / participants_table.php
index 645a0ca..8f999f5 100644 (file)
@@ -366,7 +366,8 @@ class participants_table extends \table_sql {
         $enrolstatusoutput = '';
         $canreviewenrol = has_capability('moodle/course:enrolreview', $this->context);
         if ($canreviewenrol) {
-            $fullname = fullname($data);
+            $canviewfullnames = has_capability('moodle/site:viewfullnames', $this->context);
+            $fullname = fullname($data, $canviewfullnames);
             $coursename = format_string($this->course->fullname, true, array('context' => $this->context));
             require_once($CFG->dirroot . '/enrol/locallib.php');
             $manager = new \course_enrolment_manager($PAGE, $this->course);