diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-09-01 10:40:35 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-09-01 10:40:35 +0200 |
commit | 11aa4a7a29c5a6358584ce0f63c061fdb0704b18 (patch) | |
tree | e58cd5355575a132e753a7a5466f26a7c479e92a /application/legacy | |
parent | 9e2d47e519783a991962e1fe2c9f28d77756ae49 (diff) | |
download | Shaarli-11aa4a7a29c5a6358584ce0f63c061fdb0704b18.tar.gz Shaarli-11aa4a7a29c5a6358584ce0f63c061fdb0704b18.tar.zst Shaarli-11aa4a7a29c5a6358584ce0f63c061fdb0704b18.zip |
Support redirection of legacy route 'do=configure'
Diffstat (limited to 'application/legacy')
-rw-r--r-- | application/legacy/LegacyController.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/application/legacy/LegacyController.php b/application/legacy/LegacyController.php index 75fa9d2c..e16dd0f4 100644 --- a/application/legacy/LegacyController.php +++ b/application/legacy/LegacyController.php | |||
@@ -132,4 +132,21 @@ class LegacyController extends ShaarliVisitorController | |||
132 | 132 | ||
133 | return $this->redirect($response, '/feed/' . $feedType . $parameters); | 133 | return $this->redirect($response, '/feed/' . $feedType . $parameters); |
134 | } | 134 | } |
135 | |||
136 | /** Legacy route: ?do=configure */ | ||
137 | protected function configure(Request $request, Response $response): Response | ||
138 | { | ||
139 | $route = '/admin/configure'; | ||
140 | |||
141 | if (!$this->container->loginManager->isLoggedIn()) { | ||
142 | return $this->redirect($response, '/login?returnurl=' . $this->getBasePath() . $route); | ||
143 | } | ||
144 | |||
145 | return $this->redirect($response, $route); | ||
146 | } | ||
147 | |||
148 | protected function getBasePath(): string | ||
149 | { | ||
150 | return $this->container->basePath ?: ''; | ||
151 | } | ||
135 | } | 152 | } |