| @@ 555-574 (lines=20) @@ | ||
| 552 | return $viewModel; |
|
| 553 | } |
|
| 554 | ||
| 555 | public function fbshareAction() |
|
| 556 | { |
|
| 557 | $viewModel = new JsonModel(); |
|
| 558 | $viewModel->setTerminal(true); |
|
| 559 | $fbId = $this->params()->fromQuery('fbId'); |
|
| 560 | if (!$this->game) { |
|
| 561 | return $this->errorJson(); |
|
| 562 | } |
|
| 563 | $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user); |
|
| 564 | if (! $entry) { |
|
| 565 | return $this->errorJson(); |
|
| 566 | } |
|
| 567 | if (!$fbId) { |
|
| 568 | return $this->errorJson(); |
|
| 569 | } |
|
| 570 | ||
| 571 | $this->getGameService()->postFbWall($fbId, $this->game, $this->user, $entry); |
|
| 572 | ||
| 573 | return $this->successJson(); |
|
| 574 | } |
|
| 575 | ||
| 576 | public function fbrequestAction() |
|
| 577 | { |
|
| @@ 619-639 (lines=21) @@ | ||
| 616 | return $this->successJson(); |
|
| 617 | } |
|
| 618 | ||
| 619 | public function googleAction() |
|
| 620 | { |
|
| 621 | $viewModel = new ViewModel(); |
|
| 622 | $viewModel->setTerminal(true); |
|
| 623 | $googleId = $this->params()->fromQuery('googleId'); |
|
| 624 | ||
| 625 | if (!$this->game) { |
|
| 626 | return $this->errorJson(); |
|
| 627 | } |
|
| 628 | $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user); |
|
| 629 | if (! $entry) { |
|
| 630 | return $this->errorJson(); |
|
| 631 | } |
|
| 632 | if (!$googleId) { |
|
| 633 | return $this->errorJson(); |
|
| 634 | } |
|
| 635 | ||
| 636 | $this->getGameService()->postGoogle($googleId, $this->game, $this->user, $entry); |
|
| 637 | ||
| 638 | return $this->successJson(); |
|
| 639 | } |
|
| 640 | ||
| 641 | public function optinAction() |
|
| 642 | { |
|