1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-04 04:32:43 +01:00
phorge-phorge/src/aphront/response/Aphront403Response.php

37 lines
913 B
PHP
Raw Normal View History

<?php
2012-11-29 08:57:13 +01:00
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');
2013-02-13 23:50:15 +01:00
$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();
}
}