Something went wrong. Try again.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
Something went wrong. Try again.
PHP
1234567891011121314151617181920212223242526272829303132333435363738394041424344<?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('Yikes!')) ->appendParagraph($forbidden_text);
$view = id(new PhabricatorStandardPageView()) ->setTitle(pht('403 Forbidden')) ->setRequest($request) ->setDeviceReady(true) ->appendChild($dialog);
return $view->render(); }
}