Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2017-10-29 21:28:12 +0300
committerdartcafe <github@dartcafe.de>2017-10-29 21:28:12 +0300
commit262371a9781e08cca92dafb2bee6534768883964 (patch)
tree33973f0c4be7eb72ab0509fc093d8e02eb2f52ad /lib
parent9d2e07ac79fc173e2232e7ca23f2375f61f3086c (diff)
edited / added no access teplate
Added no.create and no.delete templates and changed desing a little bit.
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/PageController.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php
index 024cdd40..96cb62bf 100644
--- a/lib/Controller/PageController.php
+++ b/lib/Controller/PageController.php
@@ -260,6 +260,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);