From 869d46123f43365bbace15e69697213feb366e7e Mon Sep 17 00:00:00 2001 From: Jonas Kohl Date: Fri, 11 Oct 2024 15:10:58 +0200 Subject: Hide reply buttons when topic is locked --- src/application/views/view_topic_start.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/application/views/view_topic_start.php') diff --git a/src/application/views/view_topic_start.php b/src/application/views/view_topic_start.php index cc04ca9..d23d0f4 100644 --- a/src/application/views/view_topic_start.php +++ b/src/application/views/view_topic_start.php @@ -2,7 +2,7 @@ use mystic\forum\orm\UserPermissions; use mystic\forum\utils\RequestUtils; -$canReply = $GLOBALS["currentUser"]?->hasPermission(UserPermissions::CREATE_OWN_POST) ?? false; +$canReply = !$topic->isLocked && ($GLOBALS["currentUser"]?->hasPermission(UserPermissions::CREATE_OWN_POST) ?? false); $canEdit = ($GLOBALS["currentUser"]?->id === $topicAuthor->id && $topicAuthor->hasPermission(UserPermissions::EDIT_OWN_TOPIC)) || ($GLOBALS["currentUser"]?->hasPermission(UserPermissions::EDIT_OTHER_TOPIC)); -- cgit v1.2.3