Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F119861679
PhabricatorOAuthClientDeleteController.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, Jun 29, 22:56
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jul 1, 22:56 (2 d)
Engine
blob
Format
Raw Data
Handle
27089908
Attached To
rPH Phabricator
PhabricatorOAuthClientDeleteController.php
View Options
<?php
final
class
PhabricatorOAuthClientDeleteController
extends
PhabricatorOAuthClientController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$this
->
getViewer
();
$client
=
id
(
new
PhabricatorOAuthServerClientQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$request
->
getURIData
(
'id'
)))
->
requireCapabilities
(
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
))
->
executeOne
();
if
(!
$client
)
{
return
new
Aphront404Response
();
}
// TODO: This should be "disable", not "delete"!
if
(
$request
->
isFormPost
())
{
$client
->
delete
();
$app_uri
=
$this
->
getApplicationURI
();
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
$app_uri
);
}
return
$this
->
newDialog
()
->
setTitle
(
pht
(
'Delete OAuth Application?'
))
->
appendParagraph
(
pht
(
'Really delete the OAuth application %s?'
,
phutil_tag
(
'strong'
,
array
(),
$client
->
getName
())))
->
addCancelButton
(
$client
->
getViewURI
())
->
addSubmitButton
(
pht
(
'Delete Application'
));
}
}
Event Timeline
Log In to Comment