Merge branch 'MDL-46513_master' of git://github.com/markn86/moodle
authorJun Pataleta <jun@moodle.com>
Wed, 6 Jun 2018 07:59:21 +0000 (15:59 +0800)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 6 Jun 2018 09:16:34 +0000 (11:16 +0200)
mod/chat/report.php

index d41a121..939cd75 100644 (file)
@@ -82,6 +82,7 @@ $strdeletesession = get_string('deletesession', 'chat');
 $navlinks = array();
 
 $canexportsess = has_capability('mod/chat:exportsession', $context);
+$canviewfullnames = has_capability('moodle/site:viewfullnames', $context);
 
 // Print a session if one has been specified.
 
@@ -213,7 +214,7 @@ foreach ($sessions as $session) {
     foreach ($session->sessionusers as $sessionuser => $usermessagecount) {
         if ($user = $DB->get_record('user', array('id' => $sessionuser))) {
             $OUTPUT->user_picture($user, array('courseid' => $course->id));
-            echo '&nbsp;'.fullname($user, true); // XXX TODO  use capability instead of true.
+            echo '&nbsp;' . fullname($user, $canviewfullnames);
             echo "&nbsp;($usermessagecount)<br />";
         }
     }