Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2889430
PhortuneAccountEmailRotateController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhortuneAccountEmailRotateController.php
View Options
<?php
final
class
PhortuneAccountEmailRotateController
extends
PhortuneAccountController
{
protected
function
shouldRequireAccountEditCapability
(
)
{
return
true
;
}
protected
function
handleAccountRequest
(
AphrontRequest
$request
)
{
$viewer
=
$this
->
getViewer
(
)
;
$account
=
$this
->
getAccount
(
)
;
$address
=
id
(
new
PhortuneAccountEmailQuery
(
)
)
->
setViewer
(
$viewer
)
->
withAccountPHIDs
(
array
(
$account
->
getPHID
(
)
)
)
->
withIDs
(
array
(
$request
->
getURIData
(
'addressID'
)
)
)
->
requireCapabilities
(
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
)
)
->
executeOne
(
)
;
if
(
!
$address
)
{
return
new
Aphront404Response
(
)
;
}
$address_uri
=
$address
->
getURI
(
)
;
if
(
$request
->
isFormOrHisecPost
(
)
)
{
$xactions
=
array
(
)
;
$xactions
[
]
=
$address
->
getApplicationTransactionTemplate
(
)
->
setTransactionType
(
PhortuneAccountEmailRotateTransaction
::
TRANSACTIONTYPE
)
->
setNewValue
(
true
)
;
$address
->
getApplicationTransactionEditor
(
)
->
setActor
(
$viewer
)
->
setContentSourceFromRequest
(
$request
)
->
setContinueOnMissingFields
(
true
)
->
setContinueOnNoEffect
(
true
)
->
setCancelURI
(
$address_uri
)
->
applyTransactions
(
$address
,
$xactions
)
;
return
id
(
new
AphrontRedirectResponse
(
)
)
->
setURI
(
$address_uri
)
;
}
return
$this
->
newDialog
(
)
->
setTitle
(
pht
(
'Rotate Access Key'
)
)
->
appendParagraph
(
pht
(
'Rotate the access key for email address %s?'
,
phutil_tag
(
'strong'
,
array
(
)
,
$address
->
getAddress
(
)
)
)
)
->
appendParagraph
(
pht
(
'Existing access links which have been sent to this email address '
.
'will stop working.'
)
)
->
addSubmitButton
(
pht
(
'Rotate Access Key'
)
)
->
addCancelButton
(
$address_uri
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 12:08 (4 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1124409
Default Alt Text
PhortuneAccountEmailRotateController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment