| @@ 731-750 (lines=20) @@ | ||
| 728 | return $viewModel; |
|
| 729 | } |
|
| 730 | ||
| 731 | public function fbshareAction() |
|
| 732 | { |
|
| 733 | $viewModel = new JsonModel(); |
|
| 734 | $viewModel->setTerminal(true); |
|
| 735 | $fbId = $this->params()->fromQuery('fbId'); |
|
| 736 | if (!$this->game) { |
|
| 737 | return $this->errorJson(); |
|
| 738 | } |
|
| 739 | $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user); |
|
| 740 | if (!$entry) { |
|
| 741 | return $this->errorJson(); |
|
| 742 | } |
|
| 743 | if (!$fbId) { |
|
| 744 | return $this->errorJson(); |
|
| 745 | } |
|
| 746 | ||
| 747 | $this->getGameService()->postFbWall($fbId, $this->game, $this->user, $entry); |
|
| 748 | ||
| 749 | return $this->successJson(); |
|
| 750 | } |
|
| 751 | ||
| 752 | public function fbrequestAction() |
|
| 753 | { |
|
| @@ 795-815 (lines=21) @@ | ||
| 792 | return $this->successJson(); |
|
| 793 | } |
|
| 794 | ||
| 795 | public function googleAction() |
|
| 796 | { |
|
| 797 | $viewModel = new ViewModel(); |
|
| 798 | $viewModel->setTerminal(true); |
|
| 799 | $googleId = $this->params()->fromQuery('googleId'); |
|
| 800 | ||
| 801 | if (!$this->game) { |
|
| 802 | return $this->errorJson(); |
|
| 803 | } |
|
| 804 | $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user); |
|
| 805 | if (!$entry) { |
|
| 806 | return $this->errorJson(); |
|
| 807 | } |
|
| 808 | if (!$googleId) { |
|
| 809 | return $this->errorJson(); |
|
| 810 | } |
|
| 811 | ||
| 812 | $this->getGameService()->postGoogle($googleId, $this->game, $this->user, $entry); |
|
| 813 | ||
| 814 | return $this->successJson(); |
|
| 815 | } |
|
| 816 | ||
| 817 | public function optinAction() |
|
| 818 | { |
|