mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-02 19:52:44 +01:00
f74082aecd
Summary: Moves to PHUIObjectBox, removes old CSS Test Plan: Pull up 404 page. Reviewers: epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D10578
43 lines
1 KiB
PHP
43 lines
1 KiB
PHP
<?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('Peace Out'))
|
|
->appendParagraph($forbidden_text);
|
|
|
|
$view = id(new PhabricatorStandardPageView())
|
|
->setTitle(pht('403 Forbidden'))
|
|
->setRequest($request)
|
|
->setDeviceReady(true)
|
|
->appendChild($dialog);
|
|
|
|
return $view->render();
|
|
}
|
|
|
|
}
|