| @@ 761-785 (lines=25) @@ | ||
| 758 | return $viewModel; |
|
| 759 | } |
|
| 760 | ||
| 761 | public function fbshareAction() |
|
| 762 | { |
|
| 763 | $viewModel = new JsonModel(); |
|
| 764 | $viewModel->setTerminal(true); |
|
| 765 | $identifier = $this->getEvent()->getRouteMatch()->getParam('id'); |
|
| 766 | $fbId = $this->params()->fromQuery('fbId'); |
|
| 767 | $user = $this->zfcUserAuthentication()->getIdentity(); |
|
| 768 | $sg = $this->getGameService(); |
|
| 769 | ||
| 770 | $game = $sg->checkGame($identifier); |
|
| 771 | if (!$game) { |
|
| 772 | return $this->errorJson(); |
|
| 773 | } |
|
| 774 | $entry = $sg->checkExistingEntry($game, $user); |
|
| 775 | if (! $entry) { |
|
| 776 | return $this->errorJson(); |
|
| 777 | } |
|
| 778 | if (!$fbId) { |
|
| 779 | return $this->errorJson(); |
|
| 780 | } |
|
| 781 | ||
| 782 | $sg->postFbWall($fbId, $game, $user, $entry); |
|
| 783 | ||
| 784 | return $this->successJson(); |
|
| 785 | } |
|
| 786 | ||
| 787 | public function fbrequestAction() |
|
| 788 | { |
|
| @@ 838-862 (lines=25) @@ | ||
| 835 | return $this->successJson(); |
|
| 836 | } |
|
| 837 | ||
| 838 | public function googleAction() |
|
| 839 | { |
|
| 840 | $viewModel = new ViewModel(); |
|
| 841 | $viewModel->setTerminal(true); |
|
| 842 | $identifier = $this->getEvent()->getRouteMatch()->getParam('id'); |
|
| 843 | $googleId = $this->params()->fromQuery('googleId'); |
|
| 844 | $user = $this->zfcUserAuthentication()->getIdentity(); |
|
| 845 | $sg = $this->getGameService(); |
|
| 846 | ||
| 847 | $game = $sg->checkGame($identifier); |
|
| 848 | if (!$game) { |
|
| 849 | return $this->errorJson(); |
|
| 850 | } |
|
| 851 | $entry = $sg->checkExistingEntry($game, $user); |
|
| 852 | if (! $entry) { |
|
| 853 | return $this->errorJson(); |
|
| 854 | } |
|
| 855 | if (!$googleId) { |
|
| 856 | return $this->errorJson(); |
|
| 857 | } |
|
| 858 | ||
| 859 | $sg->postGoogle($googleId, $game, $user, $entry); |
|
| 860 | ||
| 861 | return $this->successJson(); |
|
| 862 | } |
|
| 863 | ||
| 864 | public function optinAction() |
|
| 865 | { |
|