28 lines
661 B
PHP
28 lines
661 B
PHP
<?php
|
|
namespace Seria\Users;
|
|
|
|
use Index\Routing\Route;
|
|
use Index\Routing\RouteHandler;
|
|
use Sasae\SasaeEnvironment;
|
|
use Seria\Auth\AuthInfo;
|
|
|
|
class SettingsRoutes extends RouteHandler {
|
|
public function __construct(
|
|
private AuthInfo $authInfo,
|
|
private ?SasaeEnvironment $templating
|
|
) {}
|
|
|
|
#[Route('GET', '/settings')]
|
|
public function getIndex($response) {
|
|
if(!$this->authInfo->isLoggedIn())
|
|
return 403;
|
|
|
|
return $this->templating->render('settings');
|
|
}
|
|
|
|
#[Route('GET', '/settings.php')]
|
|
public function getSettingsPHP($response): void {
|
|
$response->redirect('/settings', true);
|
|
}
|
|
}
|