| @@ 573-592 (lines=20) @@ | ||
| 570 | return $viewModel; |
|
| 571 | } |
|
| 572 | ||
| 573 | public function fbshareAction() |
|
| 574 | { |
|
| 575 | $viewModel = new JsonModel(); |
|
| 576 | $viewModel->setTerminal(true); |
|
| 577 | $fbId = $this->params()->fromQuery('fbId'); |
|
| 578 | if (!$this->game) { |
|
| 579 | return $this->errorJson(); |
|
| 580 | } |
|
| 581 | $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user); |
|
| 582 | if (! $entry) { |
|
| 583 | return $this->errorJson(); |
|
| 584 | } |
|
| 585 | if (!$fbId) { |
|
| 586 | return $this->errorJson(); |
|
| 587 | } |
|
| 588 | ||
| 589 | $this->getGameService()->postFbWall($fbId, $this->game, $this->user, $entry); |
|
| 590 | ||
| 591 | return $this->successJson(); |
|
| 592 | } |
|
| 593 | ||
| 594 | public function fbrequestAction() |
|
| 595 | { |
|
| @@ 637-657 (lines=21) @@ | ||
| 634 | return $this->successJson(); |
|
| 635 | } |
|
| 636 | ||
| 637 | public function googleAction() |
|
| 638 | { |
|
| 639 | $viewModel = new ViewModel(); |
|
| 640 | $viewModel->setTerminal(true); |
|
| 641 | $googleId = $this->params()->fromQuery('googleId'); |
|
| 642 | ||
| 643 | if (!$this->game) { |
|
| 644 | return $this->errorJson(); |
|
| 645 | } |
|
| 646 | $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user); |
|
| 647 | if (! $entry) { |
|
| 648 | return $this->errorJson(); |
|
| 649 | } |
|
| 650 | if (!$googleId) { |
|
| 651 | return $this->errorJson(); |
|
| 652 | } |
|
| 653 | ||
| 654 | $this->getGameService()->postGoogle($googleId, $this->game, $this->user, $entry); |
|
| 655 | ||
| 656 | return $this->successJson(); |
|
| 657 | } |
|
| 658 | ||
| 659 | public function optinAction() |
|
| 660 | { |
|