Path: blob/master/src/aphront/response/Aphront403Response.php
12241 views
<?php12final class Aphront403Response extends AphrontHTMLResponse {34private $forbiddenText;5public function setForbiddenText($text) {6$this->forbiddenText = $text;7return $this;8}9private function getForbiddenText() {10return $this->forbiddenText;11}1213public function getHTTPResponseCode() {14return 403;15}1617public function buildResponseString() {18$forbidden_text = $this->getForbiddenText();19if (!$forbidden_text) {20$forbidden_text =21pht('You do not have privileges to access the requested page.');22}2324$request = $this->getRequest();25$user = $request->getUser();2627$dialog = id(new AphrontDialogView())28->setUser($user)29->setTitle(pht('403 Forbidden'))30->addCancelButton('/', pht('Yikes!'))31->appendParagraph($forbidden_text);3233$view = id(new PhabricatorStandardPageView())34->setTitle(pht('403 Forbidden'))35->setRequest($request)36->setDeviceReady(true)37->appendChild($dialog);3839return $view->render();40}4142}434445