| @@ 508-527 (lines=20) @@ | ||
| 505 | return $viewModel; |
|
| 506 | } |
|
| 507 | ||
| 508 | public function fbshareAction() |
|
| 509 | { |
|
| 510 | $viewModel = new JsonModel(); |
|
| 511 | $viewModel->setTerminal(true); |
|
| 512 | $fbId = $this->params()->fromQuery('fbId'); |
|
| 513 | if (!$this->game) { |
|
| 514 | return $this->errorJson(); |
|
| 515 | } |
|
| 516 | $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user); |
|
| 517 | if (! $entry) { |
|
| 518 | return $this->errorJson(); |
|
| 519 | } |
|
| 520 | if (!$fbId) { |
|
| 521 | return $this->errorJson(); |
|
| 522 | } |
|
| 523 | ||
| 524 | $this->getGameService()->postFbWall($fbId, $this->game, $this->user, $entry); |
|
| 525 | ||
| 526 | return $this->successJson(); |
|
| 527 | } |
|
| 528 | ||
| 529 | public function fbrequestAction() |
|
| 530 | { |
|
| @@ 572-592 (lines=21) @@ | ||
| 569 | return $this->successJson(); |
|
| 570 | } |
|
| 571 | ||
| 572 | public function googleAction() |
|
| 573 | { |
|
| 574 | $viewModel = new ViewModel(); |
|
| 575 | $viewModel->setTerminal(true); |
|
| 576 | $googleId = $this->params()->fromQuery('googleId'); |
|
| 577 | ||
| 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 (!$googleId) { |
|
| 586 | return $this->errorJson(); |
|
| 587 | } |
|
| 588 | ||
| 589 | $this->getGameService()->postGoogle($googleId, $this->game, $this->user, $entry); |
|
| 590 | ||
| 591 | return $this->successJson(); |
|
| 592 | } |
|
| 593 | ||
| 594 | public function optinAction() |
|
| 595 | { |
|