MDL-46513 mod_chat: pass has_capability result to fullname function

This commit is contained in:
Mark Nelson 2018-05-28 15:11:25 +08:00
parent dc71a8b50e
commit 88e16674b2

View 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 ' '.fullname($user, true); // XXX TODO use capability instead of true.
echo ' ' . fullname($user, $canviewfullnames);
echo "&nbsp;($usermessagecount)<br />";
}
}