mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-31 08:58:20 +01:00
Redirect older "/panel/" settings URIs to modern location
Summary: Ref T11098. We have a fair number of these, including links in email, which we can't turn into explicit `/user/` URIs. Just redirect them to the modern places. Test Plan: Clicked "Customize Menu..." on home page. Reviewers: chad, avivey Reviewed By: avivey Subscribers: avivey Maniphest Tasks: T11098 Differential Revision: https://secure.phabricator.com/D16049
This commit is contained in:
parent
421bf2e548
commit
6ac5f84c8b
2 changed files with 15 additions and 0 deletions
|
@ -36,6 +36,8 @@ final class PhabricatorSettingsApplication extends PhabricatorApplication {
|
|||
=> 'PhabricatorSettingsMainController',
|
||||
'builtin/(?P<builtin>global)/'.$panel_pattern
|
||||
=> 'PhabricatorSettingsMainController',
|
||||
'panel/(?P<panel>[^/]+)/'
|
||||
=> 'PhabricatorSettingsMainController',
|
||||
'adjust/' => 'PhabricatorSettingsAdjustController',
|
||||
'timezone/(?P<offset>[^/]+)/'
|
||||
=> 'PhabricatorSettingsTimezoneController',
|
||||
|
|
|
@ -30,6 +30,19 @@ final class PhabricatorSettingsMainController
|
|||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
// Redirect "/panel/XYZ/" to the viewer's personal settings panel. This
|
||||
// was the primary URI before global settings were introduced and allows
|
||||
// generation of viewer-agnostic URIs for email.
|
||||
$panel = $request->getURIData('panel');
|
||||
if ($panel) {
|
||||
$panel = phutil_escape_uri($panel);
|
||||
$username = $viewer->getUsername();
|
||||
|
||||
$panel_uri = "/user/{$username}/page/{$panel}/";
|
||||
$panel_uri = $this->getApplicationURI($panel_uri);
|
||||
return id(new AphrontRedirectResponse())->setURI($panel_uri);
|
||||
}
|
||||
|
||||
$username = $request->getURIData('username');
|
||||
$builtin = $request->getURIData('builtin');
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue