From 019ce6a141fdf255cbaa9cb5aba33615571d28a7 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 19 Oct 2013 20:13:46 +0200 Subject: [PATCH] Fixed comment removal --- config.ini | 2 +- src/Controllers/CommentController.php | 1 + src/Views/comment-small.phtml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config.ini b/config.ini index a1c5ba91..dca175ab 100644 --- a/config.ini +++ b/config.ini @@ -88,7 +88,7 @@ deleteUser.all=nobody listComments=anonymous addComment=registered -deleteComment.self=registered +deleteComment.own=registered deleteComment.all=moderator listTags=anonymous diff --git a/src/Controllers/CommentController.php b/src/Controllers/CommentController.php index f1ab6267..28ba813f 100644 --- a/src/Controllers/CommentController.php +++ b/src/Controllers/CommentController.php @@ -90,6 +90,7 @@ class CommentController public function deleteAction($id) { $comment = Model_Comment::locate($id); + R::preload($comment, ['commenter' => 'user']); PrivilegesHelper::confirmWithException(Privilege::DeleteComment, PrivilegesHelper::getIdentitySubPrivilege($comment->commenter)); R::trash($comment); $this->context->transport->success = true; diff --git a/src/Views/comment-small.phtml b/src/Views/comment-small.phtml index 18b9d77c..db42fbb1 100644 --- a/src/Views/comment-small.phtml +++ b/src/Views/comment-small.phtml @@ -17,7 +17,7 @@ context->comment->commenter->name ?> -
[deleted user]
+ [deleted user]