2014-05-02 09:40:23 +02:00
|
|
|
<?php
|
2014-05-12 10:31:34 +02:00
|
|
|
class DeleteCommentJob extends AbstractCommentJob
|
2014-05-02 09:40:23 +02:00
|
|
|
{
|
|
|
|
public function execute()
|
|
|
|
{
|
|
|
|
$post = $this->comment->getPost();
|
|
|
|
|
|
|
|
CommentModel::remove($this->comment);
|
|
|
|
|
2014-05-04 19:23:09 +02:00
|
|
|
Logger::log('{user} removed comment from {post}', [
|
2014-05-02 09:40:23 +02:00
|
|
|
'user' => TextHelper::reprUser(Auth::getCurrentUser()),
|
|
|
|
'post' => TextHelper::reprPost($post)]);
|
|
|
|
}
|
|
|
|
|
2014-05-12 10:31:34 +02:00
|
|
|
public function getRequiredSubArguments()
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getRequiredPrivileges()
|
2014-05-02 09:40:23 +02:00
|
|
|
{
|
2014-05-04 16:27:15 +02:00
|
|
|
return new Privilege(
|
2014-05-02 09:40:23 +02:00
|
|
|
Privilege::DeleteComment,
|
2014-05-04 16:27:15 +02:00
|
|
|
Access::getIdentity($this->comment->getCommenter()));
|
2014-05-02 09:40:23 +02:00
|
|
|
}
|
|
|
|
|
2014-05-12 10:31:34 +02:00
|
|
|
public function isAuthenticationRequired()
|
2014-05-02 09:40:23 +02:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-05-12 10:31:34 +02:00
|
|
|
public function isConfirmedEmailRequired()
|
2014-05-02 09:40:23 +02:00
|
|
|
{
|
2014-05-06 13:06:42 +02:00
|
|
|
return false;
|
2014-05-02 09:40:23 +02:00
|
|
|
}
|
|
|
|
}
|