Remove product literal strings in "pht()", part 12
[phabricator.git] / src / applications / auth / controller / PhabricatorMustVerifyEmailController.php
blob2f15460eac63f399a70ccf1fdd6bf16d0e06e8c3
1 <?php
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.
9 return false;
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();
23 $sent = null;
24 if ($request->isFormPost()) {
25 $email->sendVerificationEmail($viewer);
26 $sent = new PHUIInfoView();
27 $sent->setSeverity(PHUIInfoView::SEVERITY_NOTICE);
28 $sent->setTitle(pht('Email Sent'));
29 $sent->appendChild(
30 pht(
31 'Another verification email was sent to %s.',
32 phutil_tag('strong', array(), $email_address)));
35 $must_verify = pht(
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));
40 $send_again = pht(
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())
45 ->setUser($viewer)
46 ->setTitle(pht('Check Your Email'))
47 ->appendParagraph($must_verify)
48 ->appendParagraph($send_again)
49 ->addSubmitButton(pht('Send Another Email'));
51 $view = array(
52 $sent,
53 $dialog,
56 return $this->newPage()
57 ->setTitle(pht('Must Verify Email'))
58 ->appendChild($view);