Path: blob/master/src/applications/auth/controller/PhabricatorMustVerifyEmailController.php
12256 views
<?php12final class PhabricatorMustVerifyEmailController3extends PhabricatorAuthController {45public function shouldRequireEmailVerification() {6// NOTE: We don't technically need this since PhabricatorController forces7// us here in either case, but it's more consistent with intent.8return false;9}1011public function handleRequest(AphrontRequest $request) {12$viewer = $this->getViewer();1314$email = $viewer->loadPrimaryEmail();1516if ($viewer->getIsEmailVerified()) {17return id(new AphrontRedirectResponse())->setURI('/');18}1920$email_address = $email->getAddress();2122$sent = null;23if ($request->isFormPost()) {24$email->sendVerificationEmail($viewer);25$sent = new PHUIInfoView();26$sent->setSeverity(PHUIInfoView::SEVERITY_NOTICE);27$sent->setTitle(pht('Email Sent'));28$sent->appendChild(29pht(30'Another verification email was sent to %s.',31phutil_tag('strong', array(), $email_address)));32}3334$must_verify = pht(35'You must verify your email address to log in. You should have a '.36'new email message with verification instructions in your inbox (%s).',37phutil_tag('strong', array(), $email_address));3839$send_again = pht(40'If you did not receive an email, you can click the button below '.41'to try sending another one.');4243$dialog = id(new AphrontDialogView())44->setUser($viewer)45->setTitle(pht('Check Your Email'))46->appendParagraph($must_verify)47->appendParagraph($send_again)48->addSubmitButton(pht('Send Another Email'));4950$view = array(51$sent,52$dialog,53);5455return $this->newPage()56->setTitle(pht('Must Verify Email'))57->appendChild($view);5859}6061}626364