Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F106115478
Aphront403Response.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
Sat, Mar 22, 14:41
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Mar 24, 14:41 (2 d)
Engine
blob
Format
Raw Data
Handle
24809568
Attached To
rPH Phabricator
Aphront403Response.php
View Options
<?php
final
class
Aphront403Response
extends
AphrontHTMLResponse
{
private
$forbiddenText
;
public
function
setForbiddenText
(
$text
)
{
$this
->
forbiddenText
=
$text
;
return
$this
;
}
private
function
getForbiddenText
()
{
return
$this
->
forbiddenText
;
}
public
function
getHTTPResponseCode
()
{
return
403
;
}
public
function
buildResponseString
()
{
$forbidden_text
=
$this
->
getForbiddenText
();
if
(!
$forbidden_text
)
{
$forbidden_text
=
pht
(
'You do not have privileges to access the requested page.'
);
}
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$dialog
=
id
(
new
AphrontDialogView
())
->
setUser
(
$user
)
->
setTitle
(
pht
(
'403 Forbidden'
))
->
addCancelButton
(
'/'
,
pht
(
'Peace Out'
))
->
appendParagraph
(
$forbidden_text
);
$view
=
id
(
new
PhabricatorStandardPageView
())
->
setTitle
(
pht
(
'403 Forbidden'
))
->
setRequest
(
$request
)
->
setDeviceReady
(
true
)
->
appendChild
(
$dialog
);
return
$view
->
render
();
}
}
Event Timeline
Log In to Comment