Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F447709
DiffusionMirrorDeleteController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
DiffusionMirrorDeleteController.php
View Options
<?php
final
class
DiffusionMirrorDeleteController
extends
DiffusionController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$response
=
$this
->
loadDiffusionContext
();
if
(
$response
)
{
return
$response
;
}
$viewer
=
$this
->
getViewer
();
$drequest
=
$this
->
getDiffusionRequest
();
$repository
=
$drequest
->
getRepository
();
$mirror
=
id
(
new
PhabricatorRepositoryMirrorQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$request
->
getURIData
(
'id'
)))
->
requireCapabilities
(
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
))
->
executeOne
();
if
(!
$mirror
)
{
return
new
Aphront404Response
();
}
$edit_uri
=
$this
->
getRepositoryControllerURI
(
$repository
,
'edit/#mirrors'
);
if
(
$request
->
isFormPost
())
{
$mirror
->
delete
();
return
id
(
new
AphrontReloadResponse
())->
setURI
(
$edit_uri
);
}
$dialog
=
id
(
new
AphrontDialogView
())
->
setUser
(
$viewer
)
->
setTitle
(
pht
(
'Really delete mirror?'
))
->
appendChild
(
pht
(
'Phabricator will stop pushing updates to this mirror.'
))
->
addSubmitButton
(
pht
(
'Delete Mirror'
))
->
addCancelButton
(
$edit_uri
);
return
id
(
new
AphrontDialogResponse
())
->
setDialog
(
$dialog
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, May 4, 5:20 PM (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
66607
Default Alt Text
DiffusionMirrorDeleteController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment