| @@ 620-639 (lines=20) @@ | ||
| 617 | return $viewModel; |
|
| 618 | } |
|
| 619 | ||
| 620 | public function fbshareAction() { |
|
| 621 | $viewModel = new JsonModel(); |
|
| 622 | $viewModel->setTerminal(true); |
|
| 623 | $fbId = $this->params()->fromQuery('fbId'); |
|
| 624 | if (!$this->game) { |
|
| 625 | return $this->errorJson(); |
|
| 626 | } |
|
| 627 | $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user); |
|
| 628 | if (!$entry) { |
|
| 629 | return $this->errorJson(); |
|
| 630 | } |
|
| 631 | if (!$fbId) { |
|
| 632 | return $this->errorJson(); |
|
| 633 | } |
|
| 634 | ||
| 635 | $this->getGameService()->postFbWall($fbId, $this->game, $this->user, $entry); |
|
| 636 | ||
| 637 | return $this->successJson(); |
|
| 638 | } |
|
| 639 | ||
| 640 | public function fbrequestAction() { |
|
| 641 | $viewModel = new ViewModel(); |
|
| 642 | $viewModel->setTerminal(true); |
|
| @@ 681-701 (lines=21) @@ | ||
| 678 | return $this->successJson(); |
|
| 679 | } |
|
| 680 | ||
| 681 | public function googleAction() { |
|
| 682 | $viewModel = new ViewModel(); |
|
| 683 | $viewModel->setTerminal(true); |
|
| 684 | $googleId = $this->params()->fromQuery('googleId'); |
|
| 685 | ||
| 686 | if (!$this->game) { |
|
| 687 | return $this->errorJson(); |
|
| 688 | } |
|
| 689 | $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user); |
|
| 690 | if (!$entry) { |
|
| 691 | return $this->errorJson(); |
|
| 692 | } |
|
| 693 | if (!$googleId) { |
|
| 694 | return $this->errorJson(); |
|
| 695 | } |
|
| 696 | ||
| 697 | $this->getGameService()->postGoogle($googleId, $this->game, $this->user, $entry); |
|
| 698 | ||
| 699 | return $this->successJson(); |
|
| 700 | } |
|
| 701 | ||
| 702 | public function optinAction() { |
|
| 703 | $userService = $this->getServiceLocator()->get('zfcuser_user_service'); |
|
| 704 | ||