aboutsummaryrefslogtreecommitdiffhomepage
path: root/application
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-09-01 10:40:35 +0200
committerArthurHoaro <arthur@hoa.ro>2020-09-01 10:40:35 +0200
commit11aa4a7a29c5a6358584ce0f63c061fdb0704b18 (patch)
treee58cd5355575a132e753a7a5466f26a7c479e92a /application
parent9e2d47e519783a991962e1fe2c9f28d77756ae49 (diff)
downloadShaarli-11aa4a7a29c5a6358584ce0f63c061fdb0704b18.tar.gz
Shaarli-11aa4a7a29c5a6358584ce0f63c061fdb0704b18.tar.zst
Shaarli-11aa4a7a29c5a6358584ce0f63c061fdb0704b18.zip
Support redirection of legacy route 'do=configure'
Diffstat (limited to 'application')
-rw-r--r--application/legacy/LegacyController.php17
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}