diff options
Diffstat (limited to 'application/legacy')
-rw-r--r-- | application/legacy/LegacyController.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/application/legacy/LegacyController.php b/application/legacy/LegacyController.php index 26465d2c..efc14409 100644 --- a/application/legacy/LegacyController.php +++ b/application/legacy/LegacyController.php | |||
@@ -42,7 +42,7 @@ class LegacyController extends ShaarliVisitorController | |||
42 | $parameters = count($request->getQueryParams()) > 0 ? '?' . http_build_query($request->getQueryParams()) : ''; | 42 | $parameters = count($request->getQueryParams()) > 0 ? '?' . http_build_query($request->getQueryParams()) : ''; |
43 | 43 | ||
44 | if (!$this->container->loginManager->isLoggedIn()) { | 44 | if (!$this->container->loginManager->isLoggedIn()) { |
45 | return $this->redirect($response, '/login' . $parameters); | 45 | return $this->redirect($response, '/login?returnurl=/admin/shaare' . $parameters); |
46 | } | 46 | } |
47 | 47 | ||
48 | return $this->redirect($response, '/admin/shaare' . $parameters); | 48 | return $this->redirect($response, '/admin/shaare' . $parameters); |
@@ -52,7 +52,7 @@ class LegacyController extends ShaarliVisitorController | |||
52 | protected function addlink(Request $request, Response $response): Response | 52 | protected function addlink(Request $request, Response $response): Response |
53 | { | 53 | { |
54 | if (!$this->container->loginManager->isLoggedIn()) { | 54 | if (!$this->container->loginManager->isLoggedIn()) { |
55 | return $this->redirect($response, '/login'); | 55 | return $this->redirect($response, '/login?returnurl=/admin/add-shaare'); |
56 | } | 56 | } |
57 | 57 | ||
58 | return $this->redirect($response, '/admin/add-shaare'); | 58 | return $this->redirect($response, '/admin/add-shaare'); |
@@ -61,7 +61,9 @@ class LegacyController extends ShaarliVisitorController | |||
61 | /** Legacy route: ?do=login */ | 61 | /** Legacy route: ?do=login */ |
62 | protected function login(Request $request, Response $response): Response | 62 | protected function login(Request $request, Response $response): Response |
63 | { | 63 | { |
64 | return $this->redirect($response, '/login'); | 64 | $returnurl = $request->getQueryParam('returnurl'); |
65 | |||
66 | return $this->redirect($response, '/login' . ($returnurl ? '?returnurl=' . $returnurl : '')); | ||
65 | } | 67 | } |
66 | 68 | ||
67 | /** Legacy route: ?do=logout */ | 69 | /** Legacy route: ?do=logout */ |