diff options
author | splitt3r <splitt3r@users.noreply.github.com> | 2017-11-10 00:15:59 +0300 |
---|---|---|
committer | splitt3r <splitt3r@users.noreply.github.com> | 2017-11-10 00:15:59 +0300 |
commit | e2c664a8c61b4c9f878466829b0184e6b7b1fe26 (patch) | |
tree | 80cec2fdfa8a3c6b3b549fb804a9957320a2169e /lib | |
parent | 8caf86af5b6783f4b1064d5bf2835e1bc265e308 (diff) | |
parent | fa62e628d15cc14c57177a24803a71899788fad4 (diff) |
Merge branch 'develop' into cleanup
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/PageController.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 7f13b246..b29c2cb0 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -228,9 +228,11 @@ class PageController extends Controller { if ($poll->getType() === 0) { $dates = $this->dateMapper->findByPoll($poll->getId()); $votes = $this->participationMapper->findByPoll($poll->getId()); + $participants = $this->participationMapper->listParticipantsByPoll($poll->getId()); } else { $dates = $this->textMapper->findByPoll($poll->getId()); $votes = $this->participationTextMapper->findByPoll($poll->getId()); + $participants = $this->participationTextMapper->listParticipantsByPoll($poll->getId()); } $comments = $this->commentMapper->findByPoll($poll->getId()); try { @@ -244,6 +246,7 @@ class PageController extends Controller { 'dates' => $dates, 'comments' => $comments, 'votes' => $votes, + 'participants' => $participants, 'notification' => $notification, 'userId' => $this->userId, 'userMgr' => $this->userMgr, @@ -263,6 +266,10 @@ class PageController extends Controller { * @return RedirectResponse */ public function deletePoll($pollId) { + $pollToDelete = $this->eventMapper->find($pollId); + if ($this->userId !== $pollToDelete->getOwner()) { + return new TemplateResponse('polls', 'no.delete.tmpl'); + } $poll = new Event(); $poll->setId($pollId); $this->eventMapper->delete($poll); |