| @@ 613-632 (lines=20) @@ | ||
| 610 | return $viewModel; |
|
| 611 | } |
|
| 612 | ||
| 613 | public function fbshareAction() |
|
| 614 | { |
|
| 615 | $viewModel = new JsonModel(); |
|
| 616 | $viewModel->setTerminal(true); |
|
| 617 | $fbId = $this->params()->fromQuery('fbId'); |
|
| 618 | if (!$this->game) { |
|
| 619 | return $this->errorJson(); |
|
| 620 | } |
|
| 621 | $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user); |
|
| 622 | if (! $entry) { |
|
| 623 | return $this->errorJson(); |
|
| 624 | } |
|
| 625 | if (!$fbId) { |
|
| 626 | return $this->errorJson(); |
|
| 627 | } |
|
| 628 | ||
| 629 | $this->getGameService()->postFbWall($fbId, $this->game, $this->user, $entry); |
|
| 630 | ||
| 631 | return $this->successJson(); |
|
| 632 | } |
|
| 633 | ||
| 634 | public function fbrequestAction() |
|
| 635 | { |
|
| @@ 677-697 (lines=21) @@ | ||
| 674 | return $this->successJson(); |
|
| 675 | } |
|
| 676 | ||
| 677 | public function googleAction() |
|
| 678 | { |
|
| 679 | $viewModel = new ViewModel(); |
|
| 680 | $viewModel->setTerminal(true); |
|
| 681 | $googleId = $this->params()->fromQuery('googleId'); |
|
| 682 | ||
| 683 | if (!$this->game) { |
|
| 684 | return $this->errorJson(); |
|
| 685 | } |
|
| 686 | $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user); |
|
| 687 | if (! $entry) { |
|
| 688 | return $this->errorJson(); |
|
| 689 | } |
|
| 690 | if (!$googleId) { |
|
| 691 | return $this->errorJson(); |
|
| 692 | } |
|
| 693 | ||
| 694 | $this->getGameService()->postGoogle($googleId, $this->game, $this->user, $entry); |
|
| 695 | ||
| 696 | return $this->successJson(); |
|
| 697 | } |
|
| 698 | ||
| 699 | public function optinAction() |
|
| 700 | { |
|