diff options
Diffstat (limited to 'src/application')
-rw-r--r-- | src/application/views/view_post.php | 2 | ||||
-rw-r--r-- | src/application/views/view_topic_start.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/application/views/view_post.php b/src/application/views/view_post.php index b41f418..e2fcc36 100644 --- a/src/application/views/view_post.php +++ b/src/application/views/view_post.php @@ -12,7 +12,7 @@ $isImage = fn(string $m) => str_starts_with($m, "image/") || str_starts_with($m, $fileAttachments = array_filter($attachments, fn(Attachment $a) => !$isImage($a->mimeType)); $imageAttachments = array_filter($attachments, fn(Attachment $a) => $isImage($a->mimeType)); -$canReply = $GLOBALS["currentUser"]?->hasPermission(UserPermissions::CREATE_OWN_POST) ?? false; +$canReply = !$topic->isLocked && ($GLOBALS["currentUser"]?->hasPermission(UserPermissions::CREATE_OWN_POST) ?? false); $canEdit = ($GLOBALS["currentUser"]?->id === $postAuthor?->id && $postAuthor?->hasPermission(UserPermissions::EDIT_OWN_POST)) || ($GLOBALS["currentUser"]?->hasPermission(UserPermissions::EDIT_OTHER_POST)); 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)); |