Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90665081
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
Sun, Nov 3, 17:02
Size
939 B
Mime Type
text/x-php
Expires
Tue, Nov 5, 17:02 (2 d)
Engine
blob
Format
Raw Data
Handle
22116493
Attached To
rPH Phabricator
Aphront403Response.php
View Options
<?php
/**
* @group aphront
*/
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
=
'You do not have privileges to access the requested page.'
;
}
$failure
=
new
AphrontRequestFailureView
();
$failure
->
setHeader
(
'403 Forbidden'
);
$failure
->
appendChild
(
phutil_tag
(
'p'
,
array
(),
$forbidden_text
));
$view
=
new
PhabricatorStandardPageView
();
$view
->
setTitle
(
'403 Forbidden'
);
$view
->
setRequest
(
$this
->
getRequest
());
$view
->
appendChild
(
$failure
);
return
$view
->
render
();
}
}
Event Timeline
Log In to Comment