Massive update on the automated registrar OTE check

This commit is contained in:
Pinga 2024-02-27 09:42:35 +02:00
parent f3b798db38
commit e3e560929f
7 changed files with 300 additions and 111 deletions

View file

@ -333,9 +333,15 @@ class RegistrarsController extends Controller
[ $registrar['id'] ]); [ $registrar['id'] ]);
// Check if RegistrarOTE is not empty // Check if RegistrarOTE is not empty
if (is_array($registrarOte) && !empty($registrarOte)) { if (is_array($registrarOte) && !empty($registrarOte)) {
// Split the results into two groups // Calculate the total number of elements
$firstHalf = array_slice($registrarOte, 0, 5); $totalElements = count($registrarOte);
$secondHalf = array_slice($registrarOte, 5);
// Calculate the size of the first half. If the total number is odd, add 1 to include the extra item in the first half.
$firstHalfSize = ceil($totalElements / 2);
// Split the array into two halves
$firstHalf = array_slice($registrarOte, 0, $firstHalfSize);
$secondHalf = array_slice($registrarOte, $firstHalfSize);
} else { } else {
// If RegistrarOTE is empty, set both halves to empty arrays // If RegistrarOTE is empty, set both halves to empty arrays
$firstHalf = []; $firstHalf = [];
@ -387,9 +393,15 @@ class RegistrarsController extends Controller
[ $registrar['id'] ]); [ $registrar['id'] ]);
// Check if RegistrarOTE is not empty // Check if RegistrarOTE is not empty
if (is_array($registrarOte) && !empty($registrarOte)) { if (is_array($registrarOte) && !empty($registrarOte)) {
// Split the results into two groups // Calculate the total number of elements
$firstHalf = array_slice($registrarOte, 0, 5); $totalElements = count($registrarOte);
$secondHalf = array_slice($registrarOte, 5);
// Calculate the size of the first half. If the total number is odd, add 1 to include the extra item in the first half.
$firstHalfSize = ceil($totalElements / 2);
// Split the array into two halves
$firstHalf = array_slice($registrarOte, 0, $firstHalfSize);
$secondHalf = array_slice($registrarOte, $firstHalfSize);
} else { } else {
// If RegistrarOTE is empty, set both halves to empty arrays // If RegistrarOTE is empty, set both halves to empty arrays
$firstHalf = []; $firstHalf = [];
@ -442,7 +454,7 @@ class RegistrarsController extends Controller
$contacts = $db->select("SELECT * FROM registrar_contact WHERE registrar_id = ?", $contacts = $db->select("SELECT * FROM registrar_contact WHERE registrar_id = ?",
[ $registrar['id'] ]); [ $registrar['id'] ]);
$ote = $db->select("SELECT * FROM registrar_ote WHERE registrar_id = ?", $registrarOte = $db->select("SELECT * FROM registrar_ote WHERE registrar_id = ?",
[ $registrar['id'] ]); [ $registrar['id'] ]);
$user_id = $db->selectValue("SELECT user_id FROM registrar_users WHERE registrar_id = ?", $user_id = $db->selectValue("SELECT user_id FROM registrar_users WHERE registrar_id = ?",
[ $registrar['id'] ]); [ $registrar['id'] ]);
@ -450,6 +462,22 @@ class RegistrarsController extends Controller
[ $user_id ]); [ $user_id ]);
$whitelist = $db->select("SELECT * FROM registrar_whitelist WHERE registrar_id = ?", $whitelist = $db->select("SELECT * FROM registrar_whitelist WHERE registrar_id = ?",
[ $registrar['id'] ]); [ $registrar['id'] ]);
// Check if RegistrarOTE is not empty
if (is_array($registrarOte) && !empty($registrarOte)) {
// Calculate the total number of elements
$totalElements = count($registrarOte);
// Calculate the size of the first half. If the total number is odd, add 1 to include the extra item in the first half.
$firstHalfSize = ceil($totalElements / 2);
// Split the array into two halves
$firstHalf = array_slice($registrarOte, 0, $firstHalfSize);
$secondHalf = array_slice($registrarOte, $firstHalfSize);
} else {
// If RegistrarOTE is empty, set both halves to empty arrays
$firstHalf = [];
$secondHalf = [];
}
$_SESSION['registrars_to_update'] = [$registrar['clid']]; $_SESSION['registrars_to_update'] = [$registrar['clid']];
$_SESSION['registrars_user_email'] = [$user['email']]; $_SESSION['registrars_user_email'] = [$user['email']];
@ -457,7 +485,8 @@ class RegistrarsController extends Controller
return view($response,'admin/registrars/updateRegistrar.twig', [ return view($response,'admin/registrars/updateRegistrar.twig', [
'registrar' => $registrar, 'registrar' => $registrar,
'contacts' => $contacts, 'contacts' => $contacts,
'ote' => $ote, 'firstHalf' => $firstHalf,
'secondHalf' => $secondHalf,
'user' => $user, 'user' => $user,
'whitelist' => $whitelist, 'whitelist' => $whitelist,
'currentUri' => $uri, 'currentUri' => $uri,
@ -970,7 +999,7 @@ class RegistrarsController extends Controller
if ($registrar) { if ($registrar) {
$contacts = $db->select("SELECT * FROM registrar_contact WHERE registrar_id = ?", $contacts = $db->select("SELECT * FROM registrar_contact WHERE registrar_id = ?",
[ $registrar['id'] ]); [ $registrar['id'] ]);
$ote = $db->select("SELECT * FROM registrar_ote WHERE registrar_id = ?", $registrarOte = $db->select("SELECT * FROM registrar_ote WHERE registrar_id = ?",
[ $registrar['id'] ]); [ $registrar['id'] ]);
$user_id = $db->selectValue("SELECT user_id FROM registrar_users WHERE registrar_id = ?", $user_id = $db->selectValue("SELECT user_id FROM registrar_users WHERE registrar_id = ?",
[ $registrar['id'] ]); [ $registrar['id'] ]);
@ -978,6 +1007,22 @@ class RegistrarsController extends Controller
[ $user_id ]); [ $user_id ]);
$whitelist = $db->select("SELECT * FROM registrar_whitelist WHERE registrar_id = ?", $whitelist = $db->select("SELECT * FROM registrar_whitelist WHERE registrar_id = ?",
[ $registrar['id'] ]); [ $registrar['id'] ]);
// Check if RegistrarOTE is not empty
if (is_array($registrarOte) && !empty($registrarOte)) {
// Calculate the total number of elements
$totalElements = count($registrarOte);
// Calculate the size of the first half. If the total number is odd, add 1 to include the extra item in the first half.
$firstHalfSize = ceil($totalElements / 2);
// Split the array into two halves
$firstHalf = array_slice($registrarOte, 0, $firstHalfSize);
$secondHalf = array_slice($registrarOte, $firstHalfSize);
} else {
// If RegistrarOTE is empty, set both halves to empty arrays
$firstHalf = [];
$secondHalf = [];
}
$_SESSION['registrars_to_update'] = [$registrar['clid']]; $_SESSION['registrars_to_update'] = [$registrar['clid']];
$_SESSION['registrars_user_email'] = [$user['email']]; $_SESSION['registrars_user_email'] = [$user['email']];
@ -985,7 +1030,8 @@ class RegistrarsController extends Controller
return view($response,'admin/registrars/updateRegistrarUser.twig', [ return view($response,'admin/registrars/updateRegistrarUser.twig', [
'registrar' => $registrar, 'registrar' => $registrar,
'contacts' => $contacts, 'contacts' => $contacts,
'ote' => $ote, 'firstHalf' => $firstHalf,
'secondHalf' => $secondHalf,
'user' => $user, 'user' => $user,
'whitelist' => $whitelist, 'whitelist' => $whitelist,
'currentUri' => $uri, 'currentUri' => $uri,
@ -1000,5 +1046,119 @@ class RegistrarsController extends Controller
return $response->withHeader('Location', '/registrars')->withStatus(302); return $response->withHeader('Location', '/registrars')->withStatus(302);
} }
} }
public function oteCheck(Request $request, Response $response)
{
$db = $this->container->get('db');
// Get the current URI
$uri = $request->getUri()->getPath();
if ($_SESSION["auth_roles"] != 0) {
$reg_id = $db->selectValue('SELECT registrar_id FROM registrar_users WHERE user_id = ?', [$_SESSION['auth_user_id']]);
if (!$reg_id) {
return $response->withHeader('Location', '/dashboard')->withStatus(302);
}
} else {
$queryParams = $request->getQueryParams();
$reg_id = $queryParams['reg'] ?? '1';
}
if (!preg_match('/^\d+$/', $reg_id)) {
$this->container->get('flash')->addMessage('error', 'Invalid registrar');
return $response->withHeader('Location', '/dashboard')->withStatus(302);
}
$registrar = $db->selectRow('SELECT id,name FROM registrar WHERE id = ?',
[ $reg_id ]);
if ($registrar) {
$host = envi('DB_HOST');
$dsn = "mysql:host=$host;dbname=registryTransaction;charset=utf8mb4";
$options = [
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
\PDO::ATTR_EMULATE_PREPARES => false,
];
try {
$pdo = new \PDO($dsn, envi('DB_USERNAME'), envi('DB_PASSWORD'), $options);
$commands = $db->select('SELECT command FROM registrar_ote WHERE registrar_id = ? ORDER by command',
[ $registrar['id'] ]);
$commands = array_map(function($item) {
return $item['command'];
}, $commands);
// Function to execute query and fetch first result
function fetchFirstMatchingResult($pdo, $sql, $params) {
$stmt = $pdo->prepare($sql);
$stmt->execute($params);
return $stmt->fetch(\PDO::FETCH_ASSOC); // Fetch the first row
}
foreach ($commands as $command) {
if (strpos($command, ':') !== false) {
// Command contains ':', split and prepare query for obj_type and cmd
list($obj_type, $cmd) = explode(':', $command, 2);
$sql = "SELECT * FROM transaction_identifier WHERE registrar_id = ? AND obj_type = ? AND cmd = ? LIMIT 1";
$params = [$reg_id, $obj_type, $cmd];
} else {
// Command is a single word
$sql = "SELECT * FROM transaction_identifier WHERE registrar_id = ? AND cmd = ? LIMIT 1";
$params = [$reg_id, $command];
}
$result = fetchFirstMatchingResult($pdo, $sql, $params);
if ($result) {
$cmd = '';
if (isset($result['cmd']) && ($result['cmd'] == 'login' || $result['cmd'] == 'logout')) {
$cmd = $result['cmd'];
} elseif (isset($result['obj_type']) && isset($result['cmd'])) {
$cmd = $result['obj_type'] . ':' . $result['cmd'];
}
if (isset($result['code']) && strpos(strval($result['code']), '1') === 0) {
$db->update(
'registrar_ote',
[
'result' => 0
],
[
'registrar_id' => $reg_id,
'command' => $cmd,
]
);
} else {
$db->update(
'registrar_ote',
[
'result' => 1
],
[
'registrar_id' => $reg_id,
'command' => $cmd,
]
);
}
}
}
} catch (\PDOException $e) {
$this->container->get('flash')->addMessage('error', 'Database failure: ' . $e->getMessage());
return $response->withHeader('Location', '/registrar/view/'.$registrar['name'])->withStatus(302);
} catch (Exception $e) {
$this->container->get('flash')->addMessage('error', 'Database failure: ' . $e->getMessage());
return $response->withHeader('Location', '/registrar/view/'.$registrar['name'])->withStatus(302);
} catch (Throwable $e) {
$this->container->get('flash')->addMessage('error', 'Database failure: ' . $e->getMessage());
return $response->withHeader('Location', '/registrar/view/'.$registrar['name'])->withStatus(302);
}
$this->container->get('flash')->addMessage('success', 'Registrar test results updated successfully');
return $response->withHeader('Location', '/registrar/view/'.$registrar['name'])->withStatus(302);
} else {
return $response->withHeader('Location', '/dashboard')->withStatus(302);
}
}
} }

View file

@ -420,60 +420,43 @@
<div class="card mb-3"> <div class="card mb-3">
<div class="card-body"> <div class="card-body">
<h5 class="card-title">{{ __('Operational Test and Evaluation (OTE)') }}</h5> <h5 class="card-title">{{ __('Operational Test and Evaluation (OTE)') }}</h5>
<p class="card-text"> <div class="row mb-3">
{{ __('Operational Test and Evaluation (OTE) assesses the functionality of EPP commands in a simulated environment, ensuring effective communication between the registrar\'s system and the registry. Below are key EPP commands and their test statuses:') }} <div class="col-md-11">
</p> <p class="card-text">
{{ __('Successfully passing the Operational Test and Evaluation (OTE) is a mandatory requirement for registrars. The OTE process evaluates the interaction and compliance of the registrar\'s system with registry operations through a series of EPP command tests in a controlled environment. Below you can find the results of these essential EPP command tests for your account:') }}
</p>
</div>
<div class="col-md-1 text-end">
<a href="{% if roles == 0 %}/registrar/check?reg={{ registrar.id }}{% else %}/registrar/check{% endif %}" title="Check Results" class="btn btn-icon btn-secondary">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2" /><path d="M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z" /><path d="M9 17v-4" /><path d="M12 17v-1" /><path d="M15 17v-2" /><path d="M12 17v-1" /></svg>
</a>
</div>
</div>
<div class="row"> <div class="row">
<!-- First Column -->
<div class="col-md-6"> <div class="col-md-6">
<ul class="list-group"> <ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center"> {% for item in firstHalf %}
contact:create <li class="list-group-item d-flex justify-content-between align-items-center">
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span> {{ item.command }}
</li> <span class="badge {% if item.result == 0 %}bg-green{% elseif item.result == 9 %}bg-orange{% elseif item.result == 1 %}bg-red{% endif %} text-white">
<li class="list-group-item d-flex justify-content-between align-items-center"> {% if item.result == 0 %}{{ __('Completed') }}{% elseif item.result == 9 %}{{ __('Pending') }}{% elseif item.result == 1 %}{{ __('Failed') }}{% endif %}
domain:check </span>
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span> </li>
</li> {% endfor %}
<li class="list-group-item d-flex justify-content-between align-items-center"> </ul>
domain:info
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
domain:renew
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
domain:transfer
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span>
</li>
</ul>
</div> </div>
<!-- Second Column -->
<div class="col-md-6"> <div class="col-md-6">
<ul class="list-group"> <ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center"> {% for item in secondHalf %}
host:create <li class="list-group-item d-flex justify-content-between align-items-center">
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span> {{ item.command }}
</li> <span class="badge {% if item.result == 0 %}bg-green{% elseif item.result == 9 %}bg-orange{% elseif item.result == 1 %}bg-red{% endif %} text-white">
<li class="list-group-item d-flex justify-content-between align-items-center"> {% if item.result == 0 %}{{ __('Completed') }}{% elseif item.result == 9 %}{{ __('Pending') }}{% elseif item.result == 1 %}{{ __('Failed') }}{% endif %}
host:info </span>
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span> </li>
</li> {% endfor %}
<li class="list-group-item d-flex justify-content-between align-items-center"> </ul>
contact:update
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
domain:delete
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
poll:request
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span>
</li>
</ul>
</div> </div>
</div> </div>
</div> </div>

View file

@ -420,60 +420,43 @@
<div class="card mb-3"> <div class="card mb-3">
<div class="card-body"> <div class="card-body">
<h5 class="card-title">{{ __('Operational Test and Evaluation (OTE)') }}</h5> <h5 class="card-title">{{ __('Operational Test and Evaluation (OTE)') }}</h5>
<p class="card-text"> <div class="row mb-3">
{{ __('Operational Test and Evaluation (OTE) assesses the functionality of EPP commands in a simulated environment, ensuring effective communication between the registrar\'s system and the registry. Below are key EPP commands and their test statuses:') }} <div class="col-md-11">
</p> <p class="card-text">
{{ __('Successfully passing the Operational Test and Evaluation (OTE) is a mandatory requirement for registrars. The OTE process evaluates the interaction and compliance of the registrar\'s system with registry operations through a series of EPP command tests in a controlled environment. Below you can find the results of these essential EPP command tests for your account:') }}
</p>
</div>
<div class="col-md-1 text-end">
<a href="{% if roles == 0 %}/registrar/check?reg={{ registrar.id }}{% else %}/registrar/check{% endif %}" title="Check Results" class="btn btn-icon btn-secondary">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2" /><path d="M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z" /><path d="M9 17v-4" /><path d="M12 17v-1" /><path d="M15 17v-2" /><path d="M12 17v-1" /></svg>
</a>
</div>
</div>
<div class="row"> <div class="row">
<!-- First Column -->
<div class="col-md-6"> <div class="col-md-6">
<ul class="list-group"> <ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center"> {% for item in firstHalf %}
contact:create <li class="list-group-item d-flex justify-content-between align-items-center">
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span> {{ item.command }}
</li> <span class="badge {% if item.result == 0 %}bg-green{% elseif item.result == 9 %}bg-orange{% elseif item.result == 1 %}bg-red{% endif %} text-white">
<li class="list-group-item d-flex justify-content-between align-items-center"> {% if item.result == 0 %}{{ __('Completed') }}{% elseif item.result == 9 %}{{ __('Pending') }}{% elseif item.result == 1 %}{{ __('Failed') }}{% endif %}
domain:check </span>
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span> </li>
</li> {% endfor %}
<li class="list-group-item d-flex justify-content-between align-items-center"> </ul>
domain:info
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
domain:renew
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
domain:transfer
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span>
</li>
</ul>
</div> </div>
<!-- Second Column -->
<div class="col-md-6"> <div class="col-md-6">
<ul class="list-group"> <ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center"> {% for item in secondHalf %}
host:create <li class="list-group-item d-flex justify-content-between align-items-center">
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span> {{ item.command }}
</li> <span class="badge {% if item.result == 0 %}bg-green{% elseif item.result == 9 %}bg-orange{% elseif item.result == 1 %}bg-red{% endif %} text-white">
<li class="list-group-item d-flex justify-content-between align-items-center"> {% if item.result == 0 %}{{ __('Completed') }}{% elseif item.result == 9 %}{{ __('Pending') }}{% elseif item.result == 1 %}{{ __('Failed') }}{% endif %}
host:info </span>
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span> </li>
</li> {% endfor %}
<li class="list-group-item d-flex justify-content-between align-items-center"> </ul>
contact:update
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
domain:delete
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
poll:request
<span class="badge bg-orange text-orange-fg">{{ __('Pending') }}</span>
</li>
</ul>
</div> </div>
</div> </div>
</div> </div>

View file

@ -24,6 +24,7 @@
<div class="page-body"> <div class="page-body">
<div class="container-xl"> <div class="container-xl">
<div class="col-12"> <div class="col-12">
{% include 'partials/flash.twig' %}
<div class="card mb-3"> <div class="card mb-3">
<div class="card-header"> <div class="card-header">
<h3 class="card-title">{{ __('Registrar') }} {{ registrar.name }}&nbsp;<span class="status status-green" title="Prefix">{{ registrar.prefix }}</span>&nbsp;<span class="status status-info" title="IANA ID">{{ registrar.iana_id|default('N/A') }}</span></h3> <h3 class="card-title">{{ __('Registrar') }} {{ registrar.name }}&nbsp;<span class="status status-green" title="Prefix">{{ registrar.prefix }}</span>&nbsp;<span class="status status-info" title="IANA ID">{{ registrar.iana_id|default('N/A') }}</span></h3>
@ -140,9 +141,18 @@
<div class="card mb-3"> <div class="card mb-3">
<div class="card-body"> <div class="card-body">
<h5 class="card-title">{{ __('Operational Test and Evaluation (OTE)') }}</h5> <h5 class="card-title">{{ __('Operational Test and Evaluation (OTE)') }}</h5>
<p class="card-text"> <div class="row mb-3">
{{ __('Successfully passing the Operational Test and Evaluation (OTE) is a mandatory requirement for registrars. The OTE process evaluates the interaction and compliance of the registrar\'s system with registry operations through a series of EPP command tests in a controlled environment. Below you can find the results of these essential EPP command tests for your account:') }} <div class="col-md-11">
</p> <p class="card-text">
{{ __('Successfully passing the Operational Test and Evaluation (OTE) is a mandatory requirement for registrars. The OTE process evaluates the interaction and compliance of the registrar\'s system with registry operations through a series of EPP command tests in a controlled environment. Below you can find the results of these essential EPP command tests for your account:') }}
</p>
</div>
<div class="col-md-1 text-end">
<a href="{% if roles == 0 %}/registrar/check?reg={{ registrar.id }}{% else %}/registrar/check{% endif %}" title="Check Results" class="btn btn-icon btn-secondary">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2" /><path d="M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z" /><path d="M9 17v-4" /><path d="M12 17v-1" /><path d="M15 17v-2" /><path d="M12 17v-1" /></svg>
</a>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<ul class="list-group"> <ul class="list-group">

View file

@ -93,6 +93,7 @@ $app->group('', function ($route) {
$route->post('/registrar/update', RegistrarsController::class . ':updateRegistrarProcess')->setName('updateRegistrarProcess'); $route->post('/registrar/update', RegistrarsController::class . ':updateRegistrarProcess')->setName('updateRegistrarProcess');
$route->get('/registrar', RegistrarsController::class .':registrar')->setName('registrar'); $route->get('/registrar', RegistrarsController::class .':registrar')->setName('registrar');
$route->map(['GET', 'POST'], '/registrar/edit', RegistrarsController::class .':editRegistrar')->setName('editRegistrar'); $route->map(['GET', 'POST'], '/registrar/edit', RegistrarsController::class .':editRegistrar')->setName('editRegistrar');
$route->get('/registrar/check', RegistrarsController::class . ':oteCheck')->setName('oteCheck');
$route->get('/users', UsersController::class .':listUsers')->setName('listUsers'); $route->get('/users', UsersController::class .':listUsers')->setName('listUsers');

View file

@ -853,6 +853,32 @@ INSERT INTO `registry`.`registrar_contact` (`id`, `registrar_id`, `type`, `title
(5, 2, 'billing', NULL, 'Test', NULL, 'Name', '', '', NULL, NULL, 'Lviv', '', '', 'ua', '', NULL, 'test@namingo.org'), (5, 2, 'billing', NULL, 'Test', NULL, 'Name', '', '', NULL, NULL, 'Lviv', '', '', 'ua', '', NULL, 'test@namingo.org'),
(6, 2, 'abuse', NULL, 'Test', NULL, 'Name', '', '', NULL, NULL, 'Lviv', '', '', 'ua', '', NULL, 'test@namingo.org'); (6, 2, 'abuse', NULL, 'Test', NULL, 'Name', '', '', NULL, NULL, 'Lviv', '', '', 'ua', '', NULL, 'test@namingo.org');
INSERT INTO `registry`.`registrar_ote` (`registrar_id`, `command`, `result`) VALUES
(1, 'contact:create', 9),
(1, 'domain:check', 9),
(1, 'domain:info', 9),
(1, 'domain:renew', 9),
(1, 'domain:transfer', 9),
(1, 'login', 9),
(1, 'host:create', 9),
(1, 'host:info', 9),
(1, 'contact:update', 9),
(1, 'domain:delete', 9),
(1, 'poll:request', 9),
(1, 'logout', 9),
(2, 'contact:create', 9),
(2, 'domain:check', 9),
(2, 'domain:info', 9),
(2, 'domain:renew', 9),
(2, 'domain:transfer', 9),
(2, 'login', 9),
(2, 'host:create', 9),
(2, 'host:info', 9),
(2, 'contact:update', 9),
(2, 'domain:delete', 9),
(2, 'poll:request', 9),
(2, 'logout', 9);
INSERT INTO `registry`.`users` (`email`, `password`, `username`, `status`, `verified`, `resettable`, `roles_mask`, `registered`, `last_login`, `force_logout`, `tfa_secret`, `tfa_enabled`, `auth_method`, `backup_codes`) VALUES INSERT INTO `registry`.`users` (`email`, `password`, `username`, `status`, `verified`, `resettable`, `roles_mask`, `registered`, `last_login`, `force_logout`, `tfa_secret`, `tfa_enabled`, `auth_method`, `backup_codes`) VALUES
('info@leonet.com', '$argon2id$v=19$m=2048,t=4,p=4$STNMRDZRblBBVmRMeFhpdg$DpPnVyIHXJag11Pdi4J7xFAdtnmWfiNCgAjkIOpVtYk', 'leonet', 0, 1, 1, 4, 1, NULL, 0, NULL, 0, 'password', NULL), ('info@leonet.com', '$argon2id$v=19$m=2048,t=4,p=4$STNMRDZRblBBVmRMeFhpdg$DpPnVyIHXJag11Pdi4J7xFAdtnmWfiNCgAjkIOpVtYk', 'leonet', 0, 1, 1, 4, 1, NULL, 0, NULL, 0, 'password', NULL),
('info@nordregistrar.com', '$argon2id$v=19$m=2048,t=4,p=4$STNMRDZRblBBVmRMeFhpdg$DpPnVyIHXJag11Pdi4J7xFAdtnmWfiNCgAjkIOpVtYk', 'nordregistrar', 0, 1, 1, 4, 1, NULL, 0, NULL, 0, 'password', NULL); ('info@nordregistrar.com', '$argon2id$v=19$m=2048,t=4,p=4$STNMRDZRblBBVmRMeFhpdg$DpPnVyIHXJag11Pdi4J7xFAdtnmWfiNCgAjkIOpVtYk', 'nordregistrar', 0, 1, 1, 4, 1, NULL, 0, NULL, 0, 'password', NULL);

View file

@ -780,6 +780,32 @@ INSERT INTO registrar_contact (id, registrar_id, type, title, first_name, middle
('6', '2', 'abuse', NULL, 'Test', NULL, 'Name', '', '', NULL, NULL, 'Lviv', '', '', 'ua', '', NULL, 'test@namingo.org'); ('6', '2', 'abuse', NULL, 'Test', NULL, 'Name', '', '', NULL, NULL, 'Lviv', '', '', 'ua', '', NULL, 'test@namingo.org');
SELECT setval('registrar_contact_id_seq', COALESCE((SELECT MAX(id) FROM registrar_contact), 0) + 1); SELECT setval('registrar_contact_id_seq', COALESCE((SELECT MAX(id) FROM registrar_contact), 0) + 1);
INSERT INTO registrar_ote (registrar_id, command, result) VALUES
('1', 'contact:create', '9'),
('1', 'domain:check', '9'),
('1', 'domain:info', '9'),
('1', 'domain:renew', '9'),
('1', 'domain:transfer', '9'),
('1', 'login', '9'),
('1', 'host:create', '9'),
('1', 'host:info', '9'),
('1', 'contact:update', '9'),
('1', 'domain:delete', '9'),
('1', 'poll:request', '9'),
('1', 'logout', '9'),
('2', 'contact:create', '9'),
('2', 'domain:check', '9'),
('2', 'domain:info', '9'),
('2', 'domain:renew', '9'),
('2', 'domain:transfer', '9'),
('2', 'login', '9'),
('2', 'host:create', '9'),
('2', 'host:info', '9'),
('2', 'contact:update', '9'),
('2', 'domain:delete', '9'),
('2', 'poll:request', '9'),
('2', 'logout', '9');
INSERT INTO users (email, password, username, status, verified, resettable, roles_mask, registered, last_login, force_logout, tfa_secret, tfa_enabled, auth_method, backup_codes) VALUES INSERT INTO users (email, password, username, status, verified, resettable, roles_mask, registered, last_login, force_logout, tfa_secret, tfa_enabled, auth_method, backup_codes) VALUES
('info@leonet.com', '$argon2id$v=19$m=2048,t=4,p=4$STNMRDZRblBBVmRMeFhpdg$DpPnVyIHXJag11Pdi4J7xFAdtnmWfiNCgAjkIOpVtYk', 'leonet', 0, 1, 1, 4, 1, NULL, 0, NULL, false, 'password', NULL), ('info@leonet.com', '$argon2id$v=19$m=2048,t=4,p=4$STNMRDZRblBBVmRMeFhpdg$DpPnVyIHXJag11Pdi4J7xFAdtnmWfiNCgAjkIOpVtYk', 'leonet', 0, 1, 1, 4, 1, NULL, 0, NULL, false, 'password', NULL),
('info@nordregistrar.com', '$argon2id$v=19$m=2048,t=4,p=4$STNMRDZRblBBVmRMeFhpdg$DpPnVyIHXJag11Pdi4J7xFAdtnmWfiNCgAjkIOpVtYk', 'nordregistrar', 0, 1, 1, 4, 1, NULL, 0, NULL, false, 'password', NULL); ('info@nordregistrar.com', '$argon2id$v=19$m=2048,t=4,p=4$STNMRDZRblBBVmRMeFhpdg$DpPnVyIHXJag11Pdi4J7xFAdtnmWfiNCgAjkIOpVtYk', 'nordregistrar', 0, 1, 1, 4, 1, NULL, 0, NULL, false, 'password', NULL);