diff options
author | v1r0x <vinzenz.rosenkranz@gmail.com> | 2016-03-14 01:22:11 +0300 |
---|---|---|
committer | v1r0x <vinzenz.rosenkranz@gmail.com> | 2016-03-14 01:22:11 +0300 |
commit | e663757dd1a63076ce6857c577fcae7a69d245f3 (patch) | |
tree | 1aa4ddcc6aa6fb6ef280c0cc039181b3599c1ded /controller | |
parent | 0c0b2344d571eb18b9cc4a2df4dfd1c3ee7aabf3 (diff) | |
parent | b53f01a45ae73608d8e566138539fb7b8456cdda (diff) |
Merge pull request #17 from v1r0x/fix-pollid-typo
fix pollid typo in controller
Diffstat (limited to 'controller')
-rw-r--r-- | controller/pagecontroller.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/controller/pagecontroller.php b/controller/pagecontroller.php index 44679f18..237fcd9a 100644 --- a/controller/pagecontroller.php +++ b/controller/pagecontroller.php @@ -31,6 +31,7 @@ use \OCP\IAvatarManager; use \OCP\ILogger; use \OCP\IRequest; use \OCP\IURLGenerator; +use OCP\Security\ISecureRandom; use \OCP\AppFramework\Http\TemplateResponse; use \OCP\AppFramework\Http\RedirectResponse; use \OCP\AppFramework\Controller; @@ -264,7 +265,10 @@ class PageController extends Controller { $event->setDescription(htmlspecialchars($pollDesc)); $event->setOwner($userId); $event->setCreated(date('Y-m-d H:i:s')); - $event->setHash(\OC::$server->getSecureRandom()->getMediumStrengthGenerator()->generate(16)); + $event->setHash(\OC::$server->getSecureRandom()->getMediumStrengthGenerator()->generate(16, + ISecureRandom::CHAR_DIGITS. + ISecureRandom::CHAR_LOWER. + ISecureRandom::CHAR_UPPER)); $accessValues = json_decode($accessValues); $groups = $accessValues->groups; @@ -302,10 +306,12 @@ class PageController extends Controller { } } else { $event->setType(1); + $ins = $this->eventMapper->insert($event); + $poll_id = $ins->getId(); foreach($chosenDates as $el) { $text = new Text(); $text->setText($el); - $text->setPollId($pollId); + $text->setPollId($poll_id); $this->textMapper->insert($text); } } |