Commit 1570e29c authored by Ben Bradshaw's avatar Ben Bradshaw
Browse files

[#3160] Removing New Topic and Reply links for users who aren't group

members and would therefore get access denied if they tried to use them
parent 1a8a8a1b
......@@ -8,7 +8,7 @@
{include file="interaction:forum:simplepost.tpl" post=$post groupadmins=$groupadmins nosubject=true}
{/if}
<div class="postbtns">
{if $moderator || !$closed}<a href="{$WWWROOT}interaction/forum/editpost.php?parent={$post->id|escape}" id="btn-reply">{str tag="Reply" section=interaction.forum}</a>{/if}
{if $moderator || ($membership && !$closed)}<a href="{$WWWROOT}interaction/forum/editpost.php?parent={$post->id|escape}" id="btn-reply">{str tag="Reply" section=interaction.forum}</a>{/if}
{if ($moderator || !$closed) && $post->canedit} | {/if}
{if $post->canedit}<a href="{$WWWROOT}interaction/forum/editpost.php?id={$post->id|escape}" id="btn-edit"> {str tag="edit"}</a>{/if}
{if $moderator && $post->parent} | <a href="{$WWWROOT}interaction/forum/deletepost.php?id={$post->id|escape}" id="btn-delete"> {str tag="delete"}</a>{/if}
......
......@@ -13,10 +13,11 @@
<div id="forumdescription">{$forum->description}</div>
<div id="viewforum">
<h3>{str tag=Topics section="interaction.forum"}</h3>
{if $membership}
<span class="forumaddicon fr">
<a href="{$WWWROOT}interaction/forum/edittopic.php?forum={$forum->id|escape}" id="btn-newtopic">{str tag="newtopic" section="interaction.forum}</a>
</span>
{/if}
<label>{str tag="groupadminlist" section="interaction.forum"}</label>
{foreach name=groupadmins from=$groupadmins item=groupadmin}<a href="{$WWWROOT}user/view.php?id={$groupadmin}" class="groupadmin s">
<img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=20&amp;id={$groupadmin}" alt="">
......
......@@ -192,11 +192,13 @@ function buildpost($postindex, $parentsubject, &$posts){
$children[] = buildpost($index, $parentsubject, $posts);
}
}
$membership = user_can_access_forum((int)$topic->forumid);
$smarty = smarty_core();
$smarty->assign('post', $posts[$postindex]);
$smarty->assign('groupadmins', $groupadmins);
$smarty->assign('children', $children);
$smarty->assign('moderator', $moderator);
$smarty->assign('membership', $membership);
$smarty->assign('closed', $topic->closed);
return $smarty->fetch('interaction:forum:post.tpl');
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment