Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/engine/PhabricatorAuthInviteEngine.php
Show All 29 Lines | final class PhabricatorAuthInviteEngine extends Phobject { | ||||
private function shouldVerify() { | private function shouldVerify() { | ||||
return $this->userHasConfirmedVerify; | return $this->userHasConfirmedVerify; | ||||
} | } | ||||
public function processInviteCode($code) { | public function processInviteCode($code) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$invite = id(new PhabricatorAuthInvite())->loadOneWhere( | $invite = id(new PhabricatorAuthInviteQuery()) | ||||
'verificationHash = %s', | ->setViewer($viewer) | ||||
PhabricatorHash::digestForIndex($code)); | ->withVerificationCodes(array($code)) | ||||
->executeOne(); | |||||
if (!$invite) { | if (!$invite) { | ||||
throw id(new PhabricatorAuthInviteInvalidException( | throw id(new PhabricatorAuthInviteInvalidException( | ||||
pht('Bad Invite Code'), | pht('Bad Invite Code'), | ||||
pht( | pht( | ||||
'The invite code in the link you clicked is invalid. Check that '. | 'The invite code in the link you clicked is invalid. Check that '. | ||||
'you followed the link correctly.'))) | 'you followed the link correctly.'))) | ||||
->setCancelButtonURI('/') | ->setCancelButtonURI('/') | ||||
->setCancelButtonText(pht('Curses!')); | ->setCancelButtonText(pht('Curses!')); | ||||
▲ Show 20 Lines • Show All 207 Lines • Show Last 20 Lines |