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 @@
- - - {{ __('Manage Reserved Names') }} - - - - - - - {{ __('Create New TLD') }} diff --git a/cp/resources/views/admin/system/manageTokens.twig b/cp/resources/views/admin/system/manageTokens.twig new file mode 100644 index 0000000..9d55582 --- /dev/null +++ b/cp/resources/views/admin/system/manageTokens.twig @@ -0,0 +1,90 @@ +{% extends "layouts/app.twig" %} + +{% block title %}{{ __('Manage Allocation Tokens') }}{% endblock %} + +{% block content %} +
+ + + +
+
+
+ + {% include 'partials/flash.twig' %} +
+
+ {{ csrf.field | raw }} +
+ + + + + + + + + + + + + + + + + {% if tokens is not empty %} + {% for token in tokens %} + + + + + + + + + + + + + {% endfor %} + {% else %} + + + + {% endif %} + +
{{ __('Token') }}{{ __('Domain') }}{{ __('Type') }}{{ __('Status') }}{{ __('Registrars') }}{{ __('TLDs') }}{{ __('Actions') }}{{ __('Premiums') }}{{ __('Discounts') }}
{{ token.token }}{{ token.domain_name }}{{ token.tokenType is empty ? 'Default' : token.tokenType }}{{ token.tokenStatus is empty ? 'OK' : token.tokenStatus }}{{ token.registrars is empty ? 'All' : token.registrars }}{{ token.tlds is empty ? 'All' : token.tlds }}{{ token.eppActions is empty ? 'All' : token.eppActions }}{{ token.reducePremium is empty ? 'N/A' : token.reducePremium }}{{ token.reduceYears is empty ? 'N/A' : token.reduceYears }} + Edit +
No tokens found.
+
+
+
+
+
+ {% include 'partials/footer.twig' %} +
+{% endblock %} \ No newline at end of file diff --git a/cp/resources/views/layouts/app.twig b/cp/resources/views/layouts/app.twig index 399cea6..b5f448a 100644 --- a/cp/resources/views/layouts/app.twig +++ b/cp/resources/views/layouts/app.twig @@ -194,7 +194,7 @@
-
  • +
  • {{ __('Settings') }}`; + return ` `; } // Mapping of database string values to script names @@ -67,8 +67,8 @@ resizableColumns:false, columns:[ {formatter:"responsiveCollapse", width:30, minWidth:30, hozAlign:"center", resizable:false, headerSort:false, responsive:0}, - {title:"TLD", field:"tld", width:350, minWidth:50, headerSort:true, resizable:false, formatter: tldLinkFormatter, responsive:0}, - { title: "{{ __('Script') }}", field: "idn_table", width:250, minWidth:80, headerSort:true, resizable:false, formatter: scriptNameFormatter, responsive:2}, + {title:"TLD", field:"tld", width:400, minWidth:50, headerSort:true, resizable:false, formatter: tldLinkFormatter, responsive:0}, + { title: "{{ __('Script') }}", field: "idn_table", width:300, minWidth:80, headerSort:true, resizable:false, formatter: scriptNameFormatter, responsive:2}, {title:"DNSSEC", field:"secure", width:250, minWidth:80, headerSort:true, resizable:false, formatter: secureFormatter, responsive:2}, {title: "{{ __('Actions') }}", formatter: actionsFormatter, headerSort: false, resizable:false, download:false, hozAlign: "center", responsive:0, cellClick:function(e, cell){ e.stopPropagation(); }}, ], diff --git a/cp/routes/web.php b/cp/routes/web.php index 6e65251..6a9e151 100644 --- a/cp/routes/web.php +++ b/cp/routes/web.php @@ -120,6 +120,7 @@ $app->group('', function ($route) { $route->map(['GET', 'POST'], '/registry/tld/{tld}', SystemController::class . ':manageTld')->setName('manageTld'); $route->get('/registry/tlds', SystemController::class .':listTlds')->setName('listTlds'); $route->map(['GET', 'POST'], '/registry/reserved', SystemController::class .':manageReserved')->setName('manageReserved'); + $route->map(['GET', 'POST'], '/registry/tokens', SystemController::class .':manageTokens')->setName('manageTokens'); $route->post('/registry/promotions', SystemController::class . ':managePromo')->setName('managePromo'); $route->post('/registry/phases', SystemController::class . ':managePhases')->setName('managePhases');