Page MenuHomec4science

PhortuneLandingController.php
No OneTemporary

File Metadata

Created
Sat, Nov 2, 16:05

PhortuneLandingController.php

<?php
final class PhortuneLandingController extends PhortuneController {
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$accounts = id(new PhortuneAccountQuery())
->setViewer($user)
->withMemberPHIDs(array($user->getPHID()))
->execute();
if (!$accounts) {
$account = $this->createUserAccount($user);
$accounts = array($account);
}
if (count($accounts) == 1) {
$account = head($accounts);
$next_uri = $this->getApplicationURI($account->getID().'/');
} else {
$next_uri = $this->getApplicationURI('account/');
}
return id(new AphrontRedirectResponse())->setURI($next_uri);
}
}

Event Timeline