From 74a524ded12c6527745957ac219e1ca34828aa6c Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Fri, 10 Apr 2026 13:37:26 +0200 Subject: switch routing to attributes --- src/Controllers/UserController.php | 57 -------------------------------------- 1 file changed, 57 deletions(-) delete mode 100755 src/Controllers/UserController.php (limited to 'src/Controllers/UserController.php') diff --git a/src/Controllers/UserController.php b/src/Controllers/UserController.php deleted file mode 100755 index d102160..0000000 --- a/src/Controllers/UserController.php +++ /dev/null @@ -1,57 +0,0 @@ -headers->get("authorization") ?: ""); - $user = User::fetchWithAccessToken($accessToken); - - if (empty($user)) { - throw new UnauthorizedError(); - } - - $userId = $request->get("userId"); - if ($user->getId() !== $userId) { - throw new UnauthorizedError(); - } - - $body = json_decode($request->getContent(), true); - RequestValidator::validateJson(); - - $filterId = md5($userId . random_bytes(512)); - - Database::getInstance()->query(<< $filterId, - "account_data" => isset($body["account_data"]) ? json_encode($body["account_data"]) : null, - "event_fields" => isset($body["event_fields"]) ? json_encode($body["event_fields"]) : null, - "event_format" => isset($body["event_format"]) ? json_encode($body["event_format"]) : null, - "presence" => isset($body["presence"]) ? json_encode($body["presence"]) : null, - "room" => isset($body["room"]) ? json_encode($body["room"]) : null, - "user_id" => $userId, - ]); - - return new JsonResponse([ - "filter_id" => $filterId, - ]); - } -} -- cgit v1.2.3