]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/legacy/LegacyController.php
Support redirection of legacy route 'do=configure'
[github/shaarli/Shaarli.git] / application / legacy / LegacyController.php
index 75fa9d2cfb962cf1009bea63da16ed0d41a74c93..e16dd0f43effa6921b6238f0546e7357c9cea188 100644 (file)
@@ -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 ?: '';
+    }
 }