| @@ 644-663 (lines=20) @@ | ||
| 641 | return $viewModel; |
|
| 642 | } |
|
| 643 | ||
| 644 | public function fbshareAction() |
|
| 645 | { |
|
| 646 | $viewModel = new JsonModel(); |
|
| 647 | $viewModel->setTerminal(true); |
|
| 648 | $fbId = $this->params()->fromQuery('fbId'); |
|
| 649 | if (!$this->game) { |
|
| 650 | return $this->errorJson(); |
|
| 651 | } |
|
| 652 | $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user); |
|
| 653 | if (!$entry) { |
|
| 654 | return $this->errorJson(); |
|
| 655 | } |
|
| 656 | if (!$fbId) { |
|
| 657 | return $this->errorJson(); |
|
| 658 | } |
|
| 659 | ||
| 660 | $this->getGameService()->postFbWall($fbId, $this->game, $this->user, $entry); |
|
| 661 | ||
| 662 | return $this->successJson(); |
|
| 663 | } |
|
| 664 | ||
| 665 | public function fbrequestAction() |
|
| 666 | { |
|
| @@ 708-728 (lines=21) @@ | ||
| 705 | return $this->successJson(); |
|
| 706 | } |
|
| 707 | ||
| 708 | public function googleAction() |
|
| 709 | { |
|
| 710 | $viewModel = new ViewModel(); |
|
| 711 | $viewModel->setTerminal(true); |
|
| 712 | $googleId = $this->params()->fromQuery('googleId'); |
|
| 713 | ||
| 714 | if (!$this->game) { |
|
| 715 | return $this->errorJson(); |
|
| 716 | } |
|
| 717 | $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user); |
|
| 718 | if (!$entry) { |
|
| 719 | return $this->errorJson(); |
|
| 720 | } |
|
| 721 | if (!$googleId) { |
|
| 722 | return $this->errorJson(); |
|
| 723 | } |
|
| 724 | ||
| 725 | $this->getGameService()->postGoogle($googleId, $this->game, $this->user, $entry); |
|
| 726 | ||
| 727 | return $this->successJson(); |
|
| 728 | } |
|
| 729 | ||
| 730 | public function optinAction() |
|
| 731 | { |
|