diff options
author | Jonas Kohl | 2024-10-11 15:10:58 +0200 |
---|---|---|
committer | Jonas Kohl | 2024-10-11 15:10:58 +0200 |
commit | 869d46123f43365bbace15e69697213feb366e7e (patch) | |
tree | 8feb6a52dd98c894f6fc56186876a9d05a898181 | |
parent | c8af8a5fcbe6ffa493187604a6cc350066db57a2 (diff) |
Hide reply buttons when topic is lockedv0.4.3
-rw-r--r-- | src/application/views/view_post.php | 2 | ||||
-rw-r--r-- | src/application/views/view_topic_start.php | 2 | ||||
-rw-r--r-- | src/index.php | 2 |
3 files changed, 3 insertions, 3 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)); diff --git a/src/index.php b/src/index.php index 4f184ce..42f995f 100644 --- a/src/index.php +++ b/src/index.php @@ -12,7 +12,7 @@ use mystic\forum\utils\RequestUtils; header_remove("X-Powered-By"); -const MYSTICBB_VERSION = "0.4.2"; +const MYSTICBB_VERSION = "0.4.3"; if (($_SERVER["HTTP_USER_AGENT"] ?? "") === "") { http_response_code(403); |