3 final class Aphront403Response
extends AphrontHTMLResponse
{
5 private $forbiddenText;
6 public function setForbiddenText($text) {
7 $this->forbiddenText
= $text;
10 private function getForbiddenText() {
11 return $this->forbiddenText
;
14 public function getHTTPResponseCode() {
18 public function buildResponseString() {
19 $forbidden_text = $this->getForbiddenText();
20 if (!$forbidden_text) {
22 pht('You do not have privileges to access the requested page.');
25 $request = $this->getRequest();
26 $user = $request->getUser();
28 $dialog = id(new AphrontDialogView())
30 ->setTitle(pht('403 Forbidden'))
31 ->addCancelButton('/', pht('Yikes!'))
32 ->appendParagraph($forbidden_text);
34 $view = id(new PhabricatorStandardPageView())
35 ->setTitle(pht('403 Forbidden'))
36 ->setRequest($request)
37 ->setDeviceReady(true)
38 ->appendChild($dialog);
40 return $view->render();