diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-01-15 14:50:10 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-01-15 14:50:10 +0100 |
commit | 2d0da0b920035c90d56db5dbec6d62f5b50ba0c2 (patch) | |
tree | e2303e59a05dd24b100d9bc35b1409f00d68aa6e /src/gemini/Gemini.php | |
parent | 254eb4a9959e4c281fdeb47378a654de978cb1e4 (diff) |
account management
Diffstat (limited to 'src/gemini/Gemini.php')
-rw-r--r-- | src/gemini/Gemini.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/gemini/Gemini.php b/src/gemini/Gemini.php index 4567958..9d34b30 100644 --- a/src/gemini/Gemini.php +++ b/src/gemini/Gemini.php @@ -94,6 +94,20 @@ class Gemini $response = $buildingController->levelUp($request); } + else if (preg_match('@village/(\d+)/(\d+)/building/(\w+)/manage@', $request->getPath(), $routeMatch)) { + $request + ->set('x', $routeMatch[1]) + ->set('y', $routeMatch[2]) + ->set('type', $routeMatch[3]); + + if ($request->get('type') === 'Storage') { + $response = new Response( + statusCode: Status::REDIRECT_PERMANENT, + meta: "/village/{$routeMatch[1]}/{$routeMatch[2]}/storage/config" + ); + } + } + else if (preg_match('@village/(\d+)/(\d+)/unit/(\w+)/create@', $request->getPath(), $routeMatch)) { $request ->set('x', $routeMatch[1]) @@ -189,6 +203,26 @@ class Gemini $response = $eventController->cancel($request); } + else if (preg_match('@account/username@', $request->getPath(), $routeMatch)) { + $userController = new User(); + $response = $userController->accountUsername($request); + } + + else if (preg_match('@account/email@', $request->getPath(), $routeMatch)) { + $userController = new User(); + $response = $userController->accountEmail($request); + } + + else if (preg_match('@account/password@', $request->getPath(), $routeMatch)) { + $userController = new User(); + $response = $userController->accountPassword($request); + } + + else if (preg_match('@account$@', $request->getPath(), $routeMatch)) { + $userController = new User(); + $response = $userController->account($request); + } + return $response; }); |