3 final class PhabricatorMustVerifyEmailController
4 extends PhabricatorAuthController
{
6 public function shouldRequireEmailVerification() {
7 // NOTE: We don't technically need this since PhabricatorController forces
8 // us here in either case, but it's more consistent with intent.
12 public function handleRequest(AphrontRequest
$request) {
13 $viewer = $this->getViewer();
15 $email = $viewer->loadPrimaryEmail();
17 if ($viewer->getIsEmailVerified()) {
18 return id(new AphrontRedirectResponse())->setURI('/');
21 $email_address = $email->getAddress();
24 if ($request->isFormPost()) {
25 $email->sendVerificationEmail($viewer);
26 $sent = new PHUIInfoView();
27 $sent->setSeverity(PHUIInfoView
::SEVERITY_NOTICE
);
28 $sent->setTitle(pht('Email Sent'));
31 'Another verification email was sent to %s.',
32 phutil_tag('strong', array(), $email_address)));
36 'You must verify your email address to log in. You should have a '.
37 'new email message with verification instructions in your inbox (%s).',
38 phutil_tag('strong', array(), $email_address));
41 'If you did not receive an email, you can click the button below '.
42 'to try sending another one.');
44 $dialog = id(new AphrontDialogView())
46 ->setTitle(pht('Check Your Email'))
47 ->appendParagraph($must_verify)
48 ->appendParagraph($send_again)
49 ->addSubmitButton(pht('Send Another Email'));
56 return $this->newPage()
57 ->setTitle(pht('Must Verify Email'))