Moved various .php file redirects into the LegacyRouter.

This commit is contained in:
flash 2023-09-08 20:47:54 +00:00
parent c3bed1c0e3
commit 1248c0d2f6
5 changed files with 36 additions and 20 deletions

View file

@ -1,4 +0,0 @@
<?php
namespace Misuzu;
Tools::redirect($msz->getURLs()->format('auth-login'));

View file

@ -1,4 +0,0 @@
<?php
namespace Misuzu;
Tools::redirect($msz->getURLs()->format('manage-general-overview'));

View file

@ -1,4 +0,0 @@
<?php
namespace Misuzu;
Tools::redirect($msz->getURLs()->format('manage-news-categories'));

View file

@ -1,8 +0,0 @@
<?php
namespace Misuzu;
$authInfo = $msz->getAuthInfo();
if(!$authInfo->isLoggedIn())
Template::throwError(401);
Tools::redirect($msz->getURLs()->format('settings-account'));

View file

@ -129,8 +129,44 @@ class LegacyRoutes extends RouteHandler {
}), true);
}
#[Route('GET', '/auth')]
#[Route('GET', '/auth/index.php')]
public function getAuthIndexPHP($response, $request): void {
$response->redirect($this->urls->format('auth-login'), true);
}
#[Route('GET', '/settings.php')]
public function getSettingsPHP($response): void {
$response->redirect($this->urls->format('settings-index'), true);
}
#[Route('GET', '/settings')]
public function getSettingsIndex($response): void {
$response->redirect($this->urls->format('settings-account'));
}
#[Route('GET', '/settings/index.php')]
public function getSettingsIndexPHP($response): void {
$response->redirect($this->urls->format('settings-account'), true);
}
#[Route('GET', '/manage')]
public function getManageIndex($response): void {
$response->redirect($this->urls->format('manage-general-overview'));
}
#[Route('GET', '/manage/index.php')]
public function getManageIndexPHP($response): void {
$response->redirect($this->urls->format('manage-general-overview'), true);
}
#[Route('GET', '/manage/news')]
public function getManageNewsIndex($response): void {
$response->redirect($this->urls->format('manage-news-categories'));
}
#[Route('GET', '/manage/news/index.php')]
public function getManageNewsIndexPHP($response): void {
$response->redirect($this->urls->format('manage-news-categories'), true);
}
}