Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2891977
PassphraseCredentialDestroyController.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
PassphraseCredentialDestroyController.php
View Options
<?php
final
class
PassphraseCredentialDestroyController
extends
PassphraseController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$request
->
getViewer
(
)
;
$id
=
$request
->
getURIData
(
'id'
)
;
$credential
=
id
(
new
PassphraseCredentialQuery
(
)
)
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$id
)
)
->
requireCapabilities
(
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
)
)
->
executeOne
(
)
;
if
(
!
$credential
)
{
return
new
Aphront404Response
(
)
;
}
$type
=
PassphraseCredentialType
::
getTypeByConstant
(
$credential
->
getCredentialType
(
)
)
;
if
(
!
$type
)
{
throw
new
Exception
(
pht
(
'Credential has invalid type "%s"!'
,
$type
)
)
;
}
$view_uri
=
'/K'
.
$credential
->
getID
(
)
;
if
(
$request
->
isFormPost
(
)
)
{
$xactions
=
array
(
)
;
$xactions
[
]
=
id
(
new
PassphraseCredentialTransaction
(
)
)
->
setTransactionType
(
PassphraseCredentialDestroyTransaction
::
TRANSACTIONTYPE
)
->
setNewValue
(
1
)
;
$editor
=
id
(
new
PassphraseCredentialTransactionEditor
(
)
)
->
setActor
(
$viewer
)
->
setContinueOnMissingFields
(
true
)
->
setContentSourceFromRequest
(
$request
)
->
applyTransactions
(
$credential
,
$xactions
)
;
return
id
(
new
AphrontRedirectResponse
(
)
)
->
setURI
(
$view_uri
)
;
}
return
$this
->
newDialog
(
)
->
setUser
(
$viewer
)
->
setTitle
(
pht
(
'Really destroy credential?'
)
)
->
appendChild
(
pht
(
'This credential will be deactivated and the secret will be '
.
'unrecoverably destroyed. Anything relying on this credential '
.
'will cease to function. This operation can not be undone.'
)
)
->
addSubmitButton
(
pht
(
'Destroy Credential'
)
)
->
addCancelButton
(
$view_uri
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 16:01 (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1126283
Default Alt Text
PassphraseCredentialDestroyController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment