Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2341795
PhabricatorCountdownDeleteController.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
PhabricatorCountdownDeleteController.php
View Options
<?php
final
class
PhabricatorCountdownDeleteController
extends
PhabricatorCountdownController
{
private
$id
;
public
function
willProcessRequest
(
array
$data
)
{
$this
->
id
=
$data
[
'id'
];
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$timer
=
id
(
new
PhabricatorTimer
())->
load
(
$this
->
id
);
if
(!
$timer
)
{
return
new
Aphront404Response
();
}
if
((
$timer
->
getAuthorPHID
()
!==
$user
->
getPHID
())
&&
$user
->
getIsAdmin
()
===
false
)
{
return
new
Aphront403Response
();
}
if
(
$request
->
isFormPost
())
{
$timer
->
delete
();
return
id
(
new
AphrontRedirectResponse
())
->
setURI
(
'/countdown/'
);
}
$dialog
=
new
AphrontDialogView
();
$dialog
->
setUser
(
$request
->
getUser
());
$dialog
->
setTitle
(
'Really delete this countdown?'
);
$dialog
->
appendChild
(
hsprintf
(
'<p>Are you sure you want to delete the countdown "%s"?</p>'
,
$timer
->
getTitle
()));
$dialog
->
addSubmitButton
(
'Delete'
);
$dialog
->
addCancelButton
(
'/countdown/'
);
$dialog
->
setSubmitURI
(
$request
->
getPath
());
return
id
(
new
AphrontDialogResponse
())->
setDialog
(
$dialog
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Sep 16, 9:38 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
443822
Default Alt Text
PhabricatorCountdownDeleteController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment