Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97261059
PhabricatorSystemObjectController.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
Fri, Jan 3, 21:08
Size
999 B
Mime Type
text/x-php
Expires
Sun, Jan 5, 21:08 (2 d)
Engine
blob
Format
Raw Data
Handle
23367903
Attached To
rPH Phabricator
PhabricatorSystemObjectController.php
View Options
<?php
final
class
PhabricatorSystemObjectController
extends
PhabricatorController
{
public
function
shouldAllowPublic
()
{
return
true
;
}
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$this
->
getViewer
();
$name
=
$request
->
getURIData
(
'name'
);
$object
=
id
(
new
PhabricatorObjectQuery
())
->
setViewer
(
$viewer
)
->
withNames
(
array
(
$name
))
->
executeOne
();
if
(!
$object
)
{
return
new
Aphront404Response
();
}
$phid
=
$object
->
getPHID
();
$handles
=
$viewer
->
loadHandles
(
array
(
$phid
));
$handle
=
$handles
[
$phid
];
$object_uri
=
$handle
->
getURI
();
if
(!
strlen
(
$object_uri
))
{
return
$this
->
newDialog
()
->
setTitle
(
pht
(
'No Object URI'
))
->
appendParagraph
(
pht
(
'Object "%s" exists, but does not have a URI to redirect to.'
,
$name
))
->
addCancelButton
(
'/'
,
pht
(
'Done'
));
}
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
$object_uri
);
}
}
Event Timeline
Log In to Comment