| @@ 525-544 (lines=20) @@ | ||
| 522 | return $viewModel; |
|
| 523 | } |
|
| 524 | ||
| 525 | public function fbshareAction() |
|
| 526 | { |
|
| 527 | $viewModel = new JsonModel(); |
|
| 528 | $viewModel->setTerminal(true); |
|
| 529 | $fbId = $this->params()->fromQuery('fbId'); |
|
| 530 | if (!$this->game) { |
|
| 531 | return $this->errorJson(); |
|
| 532 | } |
|
| 533 | $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user); |
|
| 534 | if (! $entry) { |
|
| 535 | return $this->errorJson(); |
|
| 536 | } |
|
| 537 | if (!$fbId) { |
|
| 538 | return $this->errorJson(); |
|
| 539 | } |
|
| 540 | ||
| 541 | $this->getGameService()->postFbWall($fbId, $this->game, $this->user, $entry); |
|
| 542 | ||
| 543 | return $this->successJson(); |
|
| 544 | } |
|
| 545 | ||
| 546 | public function fbrequestAction() |
|
| 547 | { |
|
| @@ 589-609 (lines=21) @@ | ||
| 586 | return $this->successJson(); |
|
| 587 | } |
|
| 588 | ||
| 589 | public function googleAction() |
|
| 590 | { |
|
| 591 | $viewModel = new ViewModel(); |
|
| 592 | $viewModel->setTerminal(true); |
|
| 593 | $googleId = $this->params()->fromQuery('googleId'); |
|
| 594 | ||
| 595 | if (!$this->game) { |
|
| 596 | return $this->errorJson(); |
|
| 597 | } |
|
| 598 | $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user); |
|
| 599 | if (! $entry) { |
|
| 600 | return $this->errorJson(); |
|
| 601 | } |
|
| 602 | if (!$googleId) { |
|
| 603 | return $this->errorJson(); |
|
| 604 | } |
|
| 605 | ||
| 606 | $this->getGameService()->postGoogle($googleId, $this->game, $this->user, $entry); |
|
| 607 | ||
| 608 | return $this->successJson(); |
|
| 609 | } |
|
| 610 | ||
| 611 | public function optinAction() |
|
| 612 | { |
|