diff --git a/Web/Models/Entities/Comment.php b/Web/Models/Entities/Comment.php index 884fdf47..9115ad3e 100644 --- a/Web/Models/Entities/Comment.php +++ b/Web/Models/Entities/Comment.php @@ -49,6 +49,7 @@ class Comment extends Post { return $this->getOwner()->getId() == $user->getId() || $this->getTarget()->getOwner()->getId() == $user->getId() || - $this->getTarget() instanceof Post && $this->getTarget()->getTargetWall() < 0 && (new Clubs)->get(abs($this->getTarget()->getTargetWall()))->canBeModifiedBy($user); + $this->getTarget() instanceof Post && $this->getTarget()->getTargetWall() < 0 && (new Clubs)->get(abs($this->getTarget()->getTargetWall()))->canBeModifiedBy($user) || + $this->getTarget() instanceof Topic && $this->getTarget()->canBeModifiedBy($user); } } diff --git a/Web/Presenters/TopicsPresenter.php b/Web/Presenters/TopicsPresenter.php index de27fd38..5fb8eaff 100644 --- a/Web/Presenters/TopicsPresenter.php +++ b/Web/Presenters/TopicsPresenter.php @@ -160,7 +160,10 @@ final class TopicsPresenter extends OpenVKPresenter $topic->setTitle(ovk_proc_strtr($title, 127)); $topic->setClosed(empty($this->postParam("close")) ? 0 : 1); - $topic->setPinned(empty($this->postParam("pin")) ? 0 : 1); + + if($topic->getClub()->canBeModifiedBy($this->user->identity)) + $topic->setPinned(empty($this->postParam("pin")) ? 0 : 1); + $topic->save(); $this->flash("succ", tr("changes_saved"), tr("topic_changes_saved_comment")); diff --git a/Web/Presenters/templates/Topics/Edit.xml b/Web/Presenters/templates/Topics/Edit.xml index c40f28b2..0f3a7a5d 100644 --- a/Web/Presenters/templates/Topics/Edit.xml +++ b/Web/Presenters/templates/Topics/Edit.xml @@ -32,7 +32,9 @@ {_topic_settings}