Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F424461
PhabricatorAuthNeedsMultiFactorController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
PhabricatorAuthNeedsMultiFactorController.php
View Options
<?php
final
class
PhabricatorAuthNeedsMultiFactorController
extends
PhabricatorAuthController
{
public
function
shouldRequireMultiFactorEnrollment
()
{
// Users need access to this controller in order to enroll in multi-factor
// auth.
return
false
;
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$viewer
=
$request
->
getUser
();
$panel
=
id
(
new
PhabricatorMultiFactorSettingsPanel
())
->
setUser
(
$viewer
)
->
setViewer
(
$viewer
)
->
setOverrideURI
(
$this
->
getApplicationURI
(
'/multifactor/'
))
->
processRequest
(
$request
);
if
(
$panel
instanceof
AphrontResponse
)
{
return
$panel
;
}
$crumbs
=
$this
->
buildApplicationCrumbs
();
$crumbs
->
addTextCrumb
(
pht
(
'Add Multi-Factor Auth'
));
$viewer
->
updateMultiFactorEnrollment
();
if
(!
$viewer
->
getIsEnrolledInMultiFactor
())
{
$help
=
id
(
new
PHUIInfoView
())
->
setTitle
(
pht
(
'Add Multi-Factor Authentication To Your Account'
))
->
setSeverity
(
PHUIInfoView
::
SEVERITY_WARNING
)
->
setErrors
(
array
(
pht
(
'Before you can use Phabricator, you need to add multi-factor '
.
'authentication to your account.'
),
pht
(
'Multi-factor authentication helps secure your account by '
.
'making it more difficult for attackers to gain access or '
.
'take sensitive actions.'
),
pht
(
'To learn more about multi-factor authentication, click the '
.
'%s button below.'
,
phutil_tag
(
'strong'
,
array
(),
pht
(
'Help'
))),
pht
(
'To add an authentication factor, click the %s button below.'
,
phutil_tag
(
'strong'
,
array
(),
pht
(
'Add Authentication Factor'
))),
pht
(
'To continue, add at least one authentication factor to your '
.
'account.'
),
));
}
else
{
$help
=
id
(
new
PHUIInfoView
())
->
setTitle
(
pht
(
'Multi-Factor Authentication Configured'
))
->
setSeverity
(
PHUIInfoView
::
SEVERITY_NOTICE
)
->
setErrors
(
array
(
pht
(
'You have successfully configured multi-factor authentication '
.
'for your account.'
),
pht
(
'You can make adjustments from the Settings panel later.'
),
pht
(
'When you are ready, %s.'
,
phutil_tag
(
'strong'
,
array
(),
phutil_tag
(
'a'
,
array
(
'href'
=>
'/'
,
),
pht
(
'continue to Phabricator'
)))),
));
}
return
$this
->
buildApplicationPage
(
array
(
$crumbs
,
$help
,
$panel
,
),
array
(
'title'
=>
pht
(
'Add Multi-Factor Authentication'
),
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, May 2, 9:23 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
57241
Default Alt Text
PhabricatorAuthNeedsMultiFactorController.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment