mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 22:46:55 +00:00
Rewrite all AIO interface paths to be relative
Signed-off-by: Lorenzo Moscati <lorenzo@moscati.page>
This commit is contained in:
parent
4581cf7649
commit
21fbb58c96
14 changed files with 96 additions and 79 deletions
|
|
@ -27,7 +27,15 @@ readonly class AuthMiddleware {
|
|||
if(!in_array($request->getUri()->getPath(), $publicRoutes)) {
|
||||
if(!$this->authManager->IsAuthenticated()) {
|
||||
$status = 302;
|
||||
$headers = ['Location' => '/'];
|
||||
if(count(explode('/', $request->getUri()->getPath())) > 2) {
|
||||
$location = '..';
|
||||
for($i = 0; $i < count(explode('/', $request->getUri()->getPath())) - 3; $i++) {
|
||||
$location = $location . '/..';
|
||||
}
|
||||
} else {
|
||||
$location = '.';
|
||||
}
|
||||
$headers = ['Location' => $location];
|
||||
$response = new Response($status, $headers);
|
||||
return $response;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue