Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97599869
PhabricatorMustVerifyEmailController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jan 5, 14:55
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jan 7, 14:55 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23349003
Attached To
rPH Phabricator
PhabricatorMustVerifyEmailController.php
View Options
<?php
final
class
PhabricatorMustVerifyEmailController
extends
PhabricatorAuthController
{
public
function
shouldRequireLogin
()
{
return
false
;
}
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
processRequest
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$email
=
$user
->
loadPrimaryEmail
();
if
(
$user
->
getIsEmailVerified
())
{
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
'/'
);
}
$email_address
=
$email
->
getAddress
();
$sent
=
null
;
if
(
$request
->
isFormPost
())
{
$email
->
sendVerificationEmail
(
$user
);
$sent
=
new
AphrontErrorView
();
$sent
->
setSeverity
(
AphrontErrorView
::
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 login. You should have a '
.
'new email message from Phabricator 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
(
$user
)
->
setTitle
(
pht
(
'Check Your Email'
))
->
appendParagraph
(
$must_verify
)
->
appendParagraph
(
$send_again
)
->
addSubmitButton
(
pht
(
'Send Another Email'
));
return
$this
->
buildApplicationPage
(
array
(
$sent
,
$dialog
,
),
array
(
'title'
=>
pht
(
'Must Verify Email'
),
));
}
}
Event Timeline
Log In to Comment