From 11aa4a7a29c5a6358584ce0f63c061fdb0704b18 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 1 Sep 2020 10:40:35 +0200 Subject: Support redirection of legacy route 'do=configure' --- application/legacy/LegacyController.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'application/legacy/LegacyController.php') 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 return $this->redirect($response, '/feed/' . $feedType . $parameters); } + + /** Legacy route: ?do=configure */ + protected function configure(Request $request, Response $response): Response + { + $route = '/admin/configure'; + + if (!$this->container->loginManager->isLoggedIn()) { + return $this->redirect($response, '/login?returnurl=' . $this->getBasePath() . $route); + } + + return $this->redirect($response, $route); + } + + protected function getBasePath(): string + { + return $this->container->basePath ?: ''; + } } -- cgit v1.2.3