From e0f77397d84b30e5d344bc3e06e5d7ce8d0437e5 Mon Sep 17 00:00:00 2001 From: Pinga <121483313+getpinga@users.noreply.github.com> Date: Wed, 6 Mar 2024 00:24:15 +0200 Subject: [PATCH] Allocation tokens can be viewed in the panel now --- cp/app/Controllers/SystemController.php | 20 +++++ cp/resources/views/admin/system/listTlds.twig | 10 --- .../views/admin/system/manageTokens.twig | 90 +++++++++++++++++++ cp/resources/views/layouts/app.twig | 2 +- cp/resources/views/partials/js-tlds.twig | 6 +- cp/routes/web.php | 1 + 6 files changed, 115 insertions(+), 14 deletions(-) create mode 100644 cp/resources/views/admin/system/manageTokens.twig diff --git a/cp/app/Controllers/SystemController.php b/cp/app/Controllers/SystemController.php index 742adc1..6fc0e6b 100644 --- a/cp/app/Controllers/SystemController.php +++ b/cp/app/Controllers/SystemController.php @@ -1065,6 +1065,26 @@ class SystemController extends Controller ]); } + public function manageTokens(Request $request, Response $response) + { + if ($_SESSION["auth_roles"] != 0) { + return $response->withHeader('Location', '/dashboard')->withStatus(302); + } + + if ($request->getMethod() === 'POST') { + return $response->withHeader('Location', '/dashboard')->withStatus(302); + } + + $db = $this->container->get('db'); + $uri = $request->getUri()->getPath(); + $tokens = $db->select("SELECT * FROM allocation_tokens"); + + return view($response,'admin/system/manageTokens.twig', [ + 'tokens' => $tokens, + 'currentUri' => $uri + ]); + } + public function managePromo(Request $request, Response $response) { if ($_SESSION["auth_roles"] != 0) { diff --git a/cp/resources/views/admin/system/listTlds.twig b/cp/resources/views/admin/system/listTlds.twig index 3a7b54f..dac3906 100644 --- a/cp/resources/views/admin/system/listTlds.twig +++ b/cp/resources/views/admin/system/listTlds.twig @@ -20,16 +20,6 @@