Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F436225
PhabricatorMustVerifyEmailController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorMustVerifyEmailController.php
View Options
<?php
final
class
PhabricatorMustVerifyEmailController
extends
PhabricatorAuthController
{
public
function
shouldRequireEmailVerification
()
{
// NOTE: We don't technically need this since PhabricatorController forces
// us here in either case, but it's more consistent with intent.
return
false
;
}
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$this
->
getViewer
();
$email
=
$viewer
->
loadPrimaryEmail
();
if
(
$viewer
->
getIsEmailVerified
())
{
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
'/'
);
}
$email_address
=
$email
->
getAddress
();
$sent
=
null
;
if
(
$request
->
isFormPost
())
{
$email
->
sendVerificationEmail
(
$viewer
);
$sent
=
new
PHUIInfoView
();
$sent
->
setSeverity
(
PHUIInfoView
::
SEVERITY_NOTICE
);
$sent
->
setTitle
(
pht
(
'Email Sent'
));
$sent
->
appendChild
(
pht
(
'Another verification email was sent to %s.'
,
phutil_tag
(
'strong'
,
array
(),
$email_address
)));
}
$must_verify
=
pht
(
'You must verify your email address to log in. You should have a '
.
'new email message with verification instructions in your inbox (%s).'
,
phutil_tag
(
'strong'
,
array
(),
$email_address
));
$send_again
=
pht
(
'If you did not receive an email, you can click the button below '
.
'to try sending another one.'
);
$dialog
=
id
(
new
AphrontDialogView
())
->
setUser
(
$viewer
)
->
setTitle
(
pht
(
'Check Your Email'
))
->
appendParagraph
(
$must_verify
)
->
appendParagraph
(
$send_again
)
->
addSubmitButton
(
pht
(
'Send Another Email'
));
$view
=
array
(
$sent
,
$dialog
,
);
return
$this
->
newPage
()
->
setTitle
(
pht
(
'Must Verify Email'
))
->
appendChild
(
$view
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 3, 10:38 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
61469
Default Alt Text
PhabricatorMustVerifyEmailController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment