Send 403 for admin pages without being admin
Summary: I've also moved the response generation for 404 from ##AphrontDefaultApplicationConfiguration## to ##buildResponseString()## Test Plan: Visit / Visit /mail/ Visit /x/ Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley, vrana Differential Revision: https://secure.phabricator.com/D1406
This commit is contained in:
@@ -466,22 +466,6 @@ class AphrontDefaultApplicationConfiguration
|
||||
'redirect' => $response->getURI(),
|
||||
));
|
||||
}
|
||||
} else if ($response instanceof Aphront404Response) {
|
||||
|
||||
$failure = new AphrontRequestFailureView();
|
||||
$failure->setHeader('404 Not Found');
|
||||
$failure->appendChild(
|
||||
'<p>The page you requested was not found.</p>');
|
||||
|
||||
$view = new PhabricatorStandardPageView();
|
||||
$view->setTitle('404 Not Found');
|
||||
$view->setRequest($this->getRequest());
|
||||
$view->appendChild($failure);
|
||||
|
||||
$response = new AphrontWebpageResponse();
|
||||
$response->setContent($view->render());
|
||||
$response->setHTTPResponseCode(404);
|
||||
return $response;
|
||||
}
|
||||
|
||||
return $response;
|
||||
|
||||
Reference in New Issue
Block a user