[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/phortune/controller/ -> PhortuneLandingController.php (source)

   1  <?php
   2  
   3  final class PhortuneLandingController extends PhortuneController {
   4  
   5    public function processRequest() {
   6      $request = $this->getRequest();
   7      $user = $request->getUser();
   8  
   9      $accounts = id(new PhortuneAccountQuery())
  10        ->setViewer($user)
  11        ->withMemberPHIDs(array($user->getPHID()))
  12        ->execute();
  13  
  14      if (!$accounts) {
  15        $account = $this->createUserAccount($user);
  16        $accounts = array($account);
  17      }
  18  
  19      if (count($accounts) == 1) {
  20        $account = head($accounts);
  21        $next_uri = $this->getApplicationURI($account->getID().'/');
  22      } else {
  23        $next_uri = $this->getApplicationURI('account/');
  24      }
  25  
  26      return id(new AphrontRedirectResponse())->setURI($next_uri);
  27    }
  28  
  29  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1