MDL-47246 mod_forum: Limit last post restriction to Q and A

This commit is contained in:
David Monllao 2014-12-05 11:35:28 +08:00
parent 2d84748c26
commit cbebd40dfb

View File

@ -3770,8 +3770,8 @@ function forum_print_discussion_header(&$post, $forum, $group=-1, $datestring=""
$usermodified->id = $post->usermodified;
$usermodified = username_load_fields_from_object($usermodified, $post, 'um');
// Show link to last poster and their post if user can see them.
if ($canviewparticipants) {
// In QA forums we check that the user can view participants.
if ($forum->type !== 'qanda' || $canviewparticipants) {
echo '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$post->usermodified.'&amp;course='.$forum->course.'">'.
fullname($usermodified).'</a><br />';
$parenturl = (empty($post->lastpostid)) ? '' : '&amp;parent='.$post->lastpostid;