| @@ 547-566 (lines=20) @@ | ||
| 544 | return $viewModel; |
|
| 545 | } |
|
| 546 | ||
| 547 | public function fbshareAction() |
|
| 548 | { |
|
| 549 | $viewModel = new JsonModel(); |
|
| 550 | $viewModel->setTerminal(true); |
|
| 551 | $fbId = $this->params()->fromQuery('fbId'); |
|
| 552 | if (!$this->game) { |
|
| 553 | return $this->errorJson(); |
|
| 554 | } |
|
| 555 | $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user); |
|
| 556 | if (! $entry) { |
|
| 557 | return $this->errorJson(); |
|
| 558 | } |
|
| 559 | if (!$fbId) { |
|
| 560 | return $this->errorJson(); |
|
| 561 | } |
|
| 562 | ||
| 563 | $this->getGameService()->postFbWall($fbId, $this->game, $this->user, $entry); |
|
| 564 | ||
| 565 | return $this->successJson(); |
|
| 566 | } |
|
| 567 | ||
| 568 | public function fbrequestAction() |
|
| 569 | { |
|
| @@ 611-631 (lines=21) @@ | ||
| 608 | return $this->successJson(); |
|
| 609 | } |
|
| 610 | ||
| 611 | public function googleAction() |
|
| 612 | { |
|
| 613 | $viewModel = new ViewModel(); |
|
| 614 | $viewModel->setTerminal(true); |
|
| 615 | $googleId = $this->params()->fromQuery('googleId'); |
|
| 616 | ||
| 617 | if (!$this->game) { |
|
| 618 | return $this->errorJson(); |
|
| 619 | } |
|
| 620 | $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user); |
|
| 621 | if (! $entry) { |
|
| 622 | return $this->errorJson(); |
|
| 623 | } |
|
| 624 | if (!$googleId) { |
|
| 625 | return $this->errorJson(); |
|
| 626 | } |
|
| 627 | ||
| 628 | $this->getGameService()->postGoogle($googleId, $this->game, $this->user, $entry); |
|
| 629 | ||
| 630 | return $this->successJson(); |
|
| 631 | } |
|
| 632 | ||
| 633 | public function optinAction() |
|
| 634 | { |
|