| @@ 798-808 (lines=11) @@ | ||
| 795 | // Has the user finished the game ? |
|
| 796 | $lastEntry = $this->getGameService()->findLastInactiveEntry($game, $user); |
|
| 797 | ||
| 798 | if ($lastEntry === null) { |
|
| 799 | return $this->redirect()->toUrl( |
|
| 800 | $this->frontendUrl()->fromRoute( |
|
| 801 | 'postvote', |
|
| 802 | array( |
|
| 803 | 'id' => $identifier, |
|
| 804 | ||
| 805 | ) |
|
| 806 | ) |
|
| 807 | ); |
|
| 808 | } |
|
| 809 | ||
| 810 | if (!$user && !$game->getAnonymousAllowed()) { |
|
| 811 | $redirect = urlencode( |
|
| @@ 88-98 (lines=11) @@ | ||
| 85 | ||
| 86 | if (!$entry) { |
|
| 87 | $lastEntry = $sg->findLastInactiveEntry($game, $user); |
|
| 88 | if ($lastEntry === null) { |
|
| 89 | return $this->redirect()->toUrl( |
|
| 90 | $this->frontendUrl()->fromRoute( |
|
| 91 | 'postvote', |
|
| 92 | array( |
|
| 93 | 'id' => $identifier, |
|
| 94 | ||
| 95 | ) |
|
| 96 | ) |
|
| 97 | ); |
|
| 98 | } |
|
| 99 | ||
| 100 | $lastEntryId = $lastEntry->getId(); |
|
| 101 | $lastPost = $sg->getPostVotePostMapper()->findOneBy(array('entry' => $lastEntryId)); |
|
| @@ 432-442 (lines=11) @@ | ||
| 429 | // Has the user finished the game ? |
|
| 430 | $lastEntry = $this->getGameService()->findLastInactiveEntry($game, $this->user); |
|
| 431 | ||
| 432 | if ($lastEntry === null) { |
|
| 433 | return $this->redirect()->toUrl( |
|
| 434 | $this->frontendUrl()->fromRoute( |
|
| 435 | 'postvote', |
|
| 436 | array('id' => $identifier) |
|
| 437 | ) |
|
| 438 | ); |
|
| 439 | } |
|
| 440 | ||
| 441 | $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form'); |
|
| 442 | $form->setAttribute('method', 'post'); |
|
| 443 | ||
| 444 | if ($this->getRequest()->isPost()) { |
|
| 445 | $data = $this->getRequest()->getPost()->toArray(); |
|
| @@ 790-800 (lines=11) @@ | ||
| 787 | // Has the user finished the game ? |
|
| 788 | $lastEntry = $this->getGameService()->findLastInactiveEntry($game, $this->user); |
|
| 789 | ||
| 790 | if ($lastEntry === null) { |
|
| 791 | return $this->redirect()->toUrl( |
|
| 792 | $this->frontendUrl()->fromRoute( |
|
| 793 | 'postvote', |
|
| 794 | array('id' => $identifier) |
|
| 795 | ) |
|
| 796 | ); |
|
| 797 | } |
|
| 798 | ||
| 799 | $post = $sg->getPostVotePostMapper()->findOneBy(array('entry' => $lastEntry)); |
|
| 800 | ||
| 801 | $secretKey = strtoupper(substr(sha1(uniqid('pg_', true).'####'.time()), 0, 15)); |
|
| 802 | $socialLinkUrl = $this->frontendUrl()->fromRoute( |
|
| 803 | 'postvote/post', |
|