Support redirection of legacy route 'do=configure'

This commit is contained in:
ArthurHoaro 2020-09-01 10:40:35 +02:00
parent 9e2d47e519
commit 11aa4a7a29
2 changed files with 19 additions and 0 deletions

View file

@ -132,4 +132,21 @@ protected function feed(Request $request, Response $response, string $feedType):
return $this->redirect($response, '/feed/' . $feedType . $parameters); 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 ?: '';
}
} }

View file

@ -94,6 +94,8 @@ public function getProcessProvider(): array
['opensearch', [], '/open-search', true], ['opensearch', [], '/open-search', true],
['dailyrss', [], '/daily-rss', false], ['dailyrss', [], '/daily-rss', false],
['dailyrss', [], '/daily-rss', true], ['dailyrss', [], '/daily-rss', true],
['configure', [], '/login?returnurl=/subfolder/admin/configure', false],
['configure', [], '/admin/configure', true],
]; ];
} }
} }