From 26cee43786a4f9c621d1ebc26d4fe90bc0b46aa6 Mon Sep 17 00:00:00 2001 From: Michael Hawkins Date: Mon, 18 Jun 2018 10:12:09 +0800 Subject: [PATCH] MDL-62618 forum: Made full names displayed consistent --- mod/forum/lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index c0bf984e078..fa122eabc75 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -3819,6 +3819,7 @@ function forum_print_discussion_header(&$post, $forum, $group = -1, $datestring $post->subject = format_string($post->subject,true); + $canviewfullnames = has_capability('moodle/site:viewfullnames', $modcontext); $timeddiscussion = !empty($CFG->forum_enabletimedposts) && ($post->timestart || $post->timeend); $timedoutsidewindow = ''; if ($timeddiscussion && ($post->timestart > time() || ($post->timeend != 0 && $post->timeend < time()))) { @@ -3856,7 +3857,7 @@ function forum_print_discussion_header(&$post, $forum, $group = -1, $datestring echo ''; // User name echo '
'; - $fullname = fullname($postuser, has_capability('moodle/site:viewfullnames', $modcontext)); + $fullname = fullname($postuser, $canviewfullnames); echo ''.$fullname.''; echo '
'; echo ''; @@ -3924,7 +3925,7 @@ function forum_print_discussion_header(&$post, $forum, $group = -1, $datestring // In QA forums we check that the user can view participants. if ($forum->type !== 'qanda' || $canviewparticipants) { echo ''. - fullname($usermodified).'
'; + fullname($usermodified, $canviewfullnames).'
'; $parenturl = (empty($post->lastpostid)) ? '' : '&parent='.$post->lastpostid; } -- 2.11.4.GIT