mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-14 16:46:59 +02:00
pendingTransfer status fixes
This commit is contained in:
parent
160d61bab6
commit
6e3a04cda4
3 changed files with 193 additions and 17 deletions
|
@ -2503,6 +2503,29 @@ class DomainsController extends Controller
|
||||||
['pending', $clid, $registrar_id_domain, $waiting_period, $date_add, $domain_id]
|
['pending', $clid, $registrar_id_domain, $waiting_period, $date_add, $domain_id]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$existingStatus = $db->selectValue(
|
||||||
|
'SELECT status FROM domain_status WHERE domain_id = ? AND status = ? LIMIT 1',
|
||||||
|
[$domain_id, 'ok']
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($existingStatus === 'ok') {
|
||||||
|
$db->delete(
|
||||||
|
'domain_status',
|
||||||
|
[
|
||||||
|
'domain_id' => $domain_id,
|
||||||
|
'status' => 'ok'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->insert(
|
||||||
|
'domain_status',
|
||||||
|
[
|
||||||
|
'domain_id' => $domain_id,
|
||||||
|
'status' => 'pendingTransfer'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
$result = $db->selectRow('SELECT id, registrant, crdate, exdate, clid, crid, upid, trdate, trstatus, reid, redate, acid, acdate, transfer_exdate FROM domain WHERE name = ? LIMIT 1',
|
$result = $db->selectRow('SELECT id, registrant, crdate, exdate, clid, crid, upid, trdate, trstatus, reid, redate, acid, acdate, transfer_exdate FROM domain WHERE name = ? LIMIT 1',
|
||||||
[ $domainName ]);
|
[ $domainName ]);
|
||||||
|
|
||||||
|
@ -2555,6 +2578,29 @@ class DomainsController extends Controller
|
||||||
['pending', $clid, $registrar_id_domain, $waiting_period, $domain_id]
|
['pending', $clid, $registrar_id_domain, $waiting_period, $domain_id]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$existingStatus = $db->selectValue(
|
||||||
|
'SELECT status FROM domain_status WHERE domain_id = ? AND status = ? LIMIT 1',
|
||||||
|
[$domain_id, 'ok']
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($existingStatus === 'ok') {
|
||||||
|
$db->delete(
|
||||||
|
'domain_status',
|
||||||
|
[
|
||||||
|
'domain_id' => $domain_id,
|
||||||
|
'status' => 'ok'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->insert(
|
||||||
|
'domain_status',
|
||||||
|
[
|
||||||
|
'domain_id' => $domain_id,
|
||||||
|
'status' => 'pendingTransfer'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
$result = $db->selectRow('SELECT id, registrant, crdate, exdate, clid, crid, upid, trdate, trstatus, reid, redate, acid, acdate, transfer_exdate FROM domain WHERE name = ? LIMIT 1',
|
$result = $db->selectRow('SELECT id, registrant, crdate, exdate, clid, crid, upid, trdate, trstatus, reid, redate, acid, acdate, transfer_exdate FROM domain WHERE name = ? LIMIT 1',
|
||||||
[ $domainName ]);
|
[ $domainName ]);
|
||||||
|
|
||||||
|
@ -2826,7 +2872,30 @@ class DomainsController extends Controller
|
||||||
'UPDATE domain_authInfo SET authinfo = ? WHERE domain_id = ?',
|
'UPDATE domain_authInfo SET authinfo = ? WHERE domain_id = ?',
|
||||||
[$new_authinfo, $domain_id]
|
[$new_authinfo, $domain_id]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$existingStatus = $db->selectValue(
|
||||||
|
'SELECT status FROM domain_status WHERE domain_id = ? AND status = ? LIMIT 1',
|
||||||
|
[$domain_id, 'pendingTransfer']
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($existingStatus === 'pendingTransfer') {
|
||||||
|
$db->delete(
|
||||||
|
'domain_status',
|
||||||
|
[
|
||||||
|
'domain_id' => $domain_id,
|
||||||
|
'status' => 'pendingTransfer'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->insert(
|
||||||
|
'domain_status',
|
||||||
|
[
|
||||||
|
'domain_id' => $domain_id,
|
||||||
|
'status' => 'ok'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
foreach ($contactMap as $contact) {
|
foreach ($contactMap as $contact) {
|
||||||
$db->update('domain_contact_map', [
|
$db->update('domain_contact_map', [
|
||||||
'contact_id' => $newContactIds[$contact['contact_id']],
|
'contact_id' => $newContactIds[$contact['contact_id']],
|
||||||
|
@ -2960,6 +3029,29 @@ class DomainsController extends Controller
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$existingStatus = $db->selectValue(
|
||||||
|
'SELECT status FROM domain_status WHERE domain_id = ? AND status = ? LIMIT 1',
|
||||||
|
[$domain_id, 'pendingTransfer']
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($existingStatus === 'pendingTransfer') {
|
||||||
|
$db->delete(
|
||||||
|
'domain_status',
|
||||||
|
[
|
||||||
|
'domain_id' => $domain_id,
|
||||||
|
'status' => 'pendingTransfer'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->insert(
|
||||||
|
'domain_status',
|
||||||
|
[
|
||||||
|
'domain_id' => $domain_id,
|
||||||
|
'status' => 'ok'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
$this->container->get('flash')->addMessage('success', 'Transfer for ' . $domainName . ' has been rejected successfully');
|
$this->container->get('flash')->addMessage('success', 'Transfer for ' . $domainName . ' has been rejected successfully');
|
||||||
return $response->withHeader('Location', '/transfers')->withStatus(302);
|
return $response->withHeader('Location', '/transfers')->withStatus(302);
|
||||||
} else {
|
} else {
|
||||||
|
@ -3024,7 +3116,30 @@ class DomainsController extends Controller
|
||||||
'name' => $domainName
|
'name' => $domainName
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$existingStatus = $db->selectValue(
|
||||||
|
'SELECT status FROM domain_status WHERE domain_id = ? AND status = ? LIMIT 1',
|
||||||
|
[$domain_id, 'pendingTransfer']
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($existingStatus === 'pendingTransfer') {
|
||||||
|
$db->delete(
|
||||||
|
'domain_status',
|
||||||
|
[
|
||||||
|
'domain_id' => $domain_id,
|
||||||
|
'status' => 'pendingTransfer'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->insert(
|
||||||
|
'domain_status',
|
||||||
|
[
|
||||||
|
'domain_id' => $domain_id,
|
||||||
|
'status' => 'ok'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
$this->container->get('flash')->addMessage('success', 'Transfer for ' . $domainName . ' has been cancelled successfully');
|
$this->container->get('flash')->addMessage('success', 'Transfer for ' . $domainName . ' has been cancelled successfully');
|
||||||
return $response->withHeader('Location', '/transfers')->withStatus(302);
|
return $response->withHeader('Location', '/transfers')->withStatus(302);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -47,20 +47,21 @@
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3 class="card-title">
|
<h3 class="card-title">
|
||||||
{{ __('Domain') }} {{ domain.name }}
|
{{ __('Domain') }} {{ domain.name }}
|
||||||
{% if domainStatus.status or domain.rgpstatus %}
|
|
||||||
{% if domainStatus is iterable %}
|
{% if domainStatus is defined and domainStatus | length > 0 %}
|
||||||
{% for status in domainStatus %}
|
{# Iterate over the domainStatus array #}
|
||||||
<span class="status status-green" title="Status">{{ status.status }}</span>
|
{% for statusItem in domainStatus %}
|
||||||
{% endfor %}
|
<span class="status status-green" title="Status">{{ statusItem.status }}</span>
|
||||||
{% else %}
|
{% endfor %}
|
||||||
{% if domainStatus.status %}
|
{% endif %}
|
||||||
<span class="status status-green" title="Status">{{ domainStatus.status }}</span>
|
|
||||||
{% endif %}
|
{# Display RGP status if present #}
|
||||||
{% endif %}
|
{% if domain.rgpstatus %}
|
||||||
{% if domain.rgpstatus %}
|
<span class="status status-info" title="Status">{{ domain.rgpstatus }}</span>
|
||||||
<span class="status status-info" title="Status">{{ domain.rgpstatus }}</span>
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
{% else %}
|
{# Fallback to 'ok' if no status or rgpstatus exists #}
|
||||||
|
{% if (domainStatus is not defined or domainStatus | length == 0) and domain.rgpstatus is not defined %}
|
||||||
<span class="status status-info" title="Status">ok</span>
|
<span class="status status-info" title="Status">ok</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</h3>
|
</h3>
|
||||||
|
|
|
@ -570,6 +570,18 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
|
|
||||||
$stmt = $db->prepare("UPDATE domain SET exdate = DATE_ADD(exdate, INTERVAL ? MONTH), lastupdate = CURRENT_TIMESTAMP(3), clid = ?, upid = ?, registrant = ?, trdate = CURRENT_TIMESTAMP(3), trstatus = 'clientApproved', acdate = CURRENT_TIMESTAMP(3), transfer_exdate = NULL, rgpstatus = 'transferPeriod', transferPeriod = ? WHERE id = ?");
|
$stmt = $db->prepare("UPDATE domain SET exdate = DATE_ADD(exdate, INTERVAL ? MONTH), lastupdate = CURRENT_TIMESTAMP(3), clid = ?, upid = ?, registrant = ?, trdate = CURRENT_TIMESTAMP(3), trstatus = 'clientApproved', acdate = CURRENT_TIMESTAMP(3), transfer_exdate = NULL, rgpstatus = 'transferPeriod', transferPeriod = ? WHERE id = ?");
|
||||||
$stmt->execute([$date_add, $row["reid"], $clid, $newRegistrantId, $date_add, $domain_id]);
|
$stmt->execute([$date_add, $row["reid"], $clid, $newRegistrantId, $date_add, $domain_id]);
|
||||||
|
|
||||||
|
$stmt = $db->prepare('SELECT status FROM domain_status WHERE domain_id = ? AND status = ? LIMIT 1');
|
||||||
|
$stmt->execute([$domain_id, 'pendingTransfer']);
|
||||||
|
$existingStatus = $stmt->fetchColumn();
|
||||||
|
|
||||||
|
if ($existingStatus === 'pendingTransfer') {
|
||||||
|
$deleteStmt = $db->prepare('DELETE FROM domain_status WHERE domain_id = ? AND status = ?');
|
||||||
|
$deleteStmt->execute([$domain_id, 'pendingTransfer']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$insertStmt = $db->prepare('INSERT INTO domain_status (domain_id, status) VALUES (?, ?)');
|
||||||
|
$insertStmt->execute([$domain_id, 'ok']);
|
||||||
|
|
||||||
$new_authinfo = generateAuthInfo();
|
$new_authinfo = generateAuthInfo();
|
||||||
$stmt = $db->prepare("UPDATE domain_authInfo SET authinfo = ? WHERE domain_id = ?");
|
$stmt = $db->prepare("UPDATE domain_authInfo SET authinfo = ? WHERE domain_id = ?");
|
||||||
|
@ -695,6 +707,18 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$stmt = $db->prepare("UPDATE domain SET trstatus = 'clientCancelled' WHERE id = :domain_id");
|
$stmt = $db->prepare("UPDATE domain SET trstatus = 'clientCancelled' WHERE id = :domain_id");
|
||||||
$stmt->execute(['domain_id' => $domain_id]);
|
$stmt->execute(['domain_id' => $domain_id]);
|
||||||
|
|
||||||
|
$stmt = $db->prepare('SELECT status FROM domain_status WHERE domain_id = ? AND status = ? LIMIT 1');
|
||||||
|
$stmt->execute([$domain_id, 'pendingTransfer']);
|
||||||
|
$existingStatus = $stmt->fetchColumn();
|
||||||
|
|
||||||
|
if ($existingStatus === 'pendingTransfer') {
|
||||||
|
$deleteStmt = $db->prepare('DELETE FROM domain_status WHERE domain_id = ? AND status = ?');
|
||||||
|
$deleteStmt->execute([$domain_id, 'pendingTransfer']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$insertStmt = $db->prepare('INSERT INTO domain_status (domain_id, status) VALUES (?, ?)');
|
||||||
|
$insertStmt->execute([$domain_id, 'ok']);
|
||||||
|
|
||||||
if ($stmt->errorCode() !== '00000') {
|
if ($stmt->errorCode() !== '00000') {
|
||||||
sendEppError($conn, $db, 2400, 'The transfer was not canceled successfully, something is wrong', $clTRID, $trans);
|
sendEppError($conn, $db, 2400, 'The transfer was not canceled successfully, something is wrong', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
|
@ -816,6 +840,18 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$stmtUpdate = $db->prepare("UPDATE domain SET trstatus = 'clientRejected' WHERE id = :domain_id");
|
$stmtUpdate = $db->prepare("UPDATE domain SET trstatus = 'clientRejected' WHERE id = :domain_id");
|
||||||
$success = $stmtUpdate->execute(['domain_id' => $domain_id]);
|
$success = $stmtUpdate->execute(['domain_id' => $domain_id]);
|
||||||
|
|
||||||
|
$stmt = $db->prepare('SELECT status FROM domain_status WHERE domain_id = ? AND status = ? LIMIT 1');
|
||||||
|
$stmt->execute([$domain_id, 'pendingTransfer']);
|
||||||
|
$existingStatus = $stmt->fetchColumn();
|
||||||
|
|
||||||
|
if ($existingStatus === 'pendingTransfer') {
|
||||||
|
$deleteStmt = $db->prepare('DELETE FROM domain_status WHERE domain_id = ? AND status = ?');
|
||||||
|
$deleteStmt->execute([$domain_id, 'pendingTransfer']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$insertStmt = $db->prepare('INSERT INTO domain_status (domain_id, status) VALUES (?, ?)');
|
||||||
|
$insertStmt->execute([$domain_id, 'ok']);
|
||||||
|
|
||||||
if (!$success || $stmtUpdate->errorCode() !== '00000') {
|
if (!$success || $stmtUpdate->errorCode() !== '00000') {
|
||||||
sendEppError($conn, $db, 2400, 'The transfer was not successfully rejected, something is wrong', $clTRID, $trans);
|
sendEppError($conn, $db, 2400, 'The transfer was not successfully rejected, something is wrong', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
|
@ -1003,7 +1039,19 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$waiting_period = 5;
|
$waiting_period = 5;
|
||||||
$stmt = $db->prepare("UPDATE domain SET trstatus = 'pending', reid = :registrar_id, redate = CURRENT_TIMESTAMP(3), acid = :registrar_id_domain, acdate = DATE_ADD(CURRENT_TIMESTAMP(3), INTERVAL $waiting_period DAY), transfer_exdate = DATE_ADD(exdate, INTERVAL $date_add MONTH) WHERE id = :domain_id");
|
$stmt = $db->prepare("UPDATE domain SET trstatus = 'pending', reid = :registrar_id, redate = CURRENT_TIMESTAMP(3), acid = :registrar_id_domain, acdate = DATE_ADD(CURRENT_TIMESTAMP(3), INTERVAL $waiting_period DAY), transfer_exdate = DATE_ADD(exdate, INTERVAL $date_add MONTH) WHERE id = :domain_id");
|
||||||
$stmt->execute([':registrar_id' => $clid, ':registrar_id_domain' => $registrar_id_domain, ':domain_id' => $domain_id]);
|
$stmt->execute([':registrar_id' => $clid, ':registrar_id_domain' => $registrar_id_domain, ':domain_id' => $domain_id]);
|
||||||
|
|
||||||
|
$stmt = $db->prepare('SELECT status FROM domain_status WHERE domain_id = ? AND status = ? LIMIT 1');
|
||||||
|
$stmt->execute([$domain_id, 'ok']);
|
||||||
|
$existingStatus = $stmt->fetchColumn();
|
||||||
|
|
||||||
|
if ($existingStatus === 'ok') {
|
||||||
|
$deleteStmt = $db->prepare('DELETE FROM domain_status WHERE domain_id = ? AND status = ?');
|
||||||
|
$deleteStmt->execute([$domain_id, 'ok']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$insertStmt = $db->prepare('INSERT INTO domain_status (domain_id, status) VALUES (?, ?)');
|
||||||
|
$insertStmt->execute([$domain_id, 'pendingTransfer']);
|
||||||
|
|
||||||
if ($stmt->errorCode() !== '00000') {
|
if ($stmt->errorCode() !== '00000') {
|
||||||
sendEppError($conn, $db, 2400, 'The transfer was not initiated successfully, something is wrong', $clTRID, $trans);
|
sendEppError($conn, $db, 2400, 'The transfer was not initiated successfully, something is wrong', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
|
@ -1072,6 +1120,18 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
':domain_id' => $domain_id
|
':domain_id' => $domain_id
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$stmt = $db->prepare('SELECT status FROM domain_status WHERE domain_id = ? AND status = ? LIMIT 1');
|
||||||
|
$stmt->execute([$domain_id, 'ok']);
|
||||||
|
$existingStatus = $stmt->fetchColumn();
|
||||||
|
|
||||||
|
if ($existingStatus === 'ok') {
|
||||||
|
$deleteStmt = $db->prepare('DELETE FROM domain_status WHERE domain_id = ? AND status = ?');
|
||||||
|
$deleteStmt->execute([$domain_id, 'ok']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$insertStmt = $db->prepare('INSERT INTO domain_status (domain_id, status) VALUES (?, ?)');
|
||||||
|
$insertStmt->execute([$domain_id, 'pendingTransfer']);
|
||||||
|
|
||||||
if ($stmt->errorCode() !== '00000') {
|
if ($stmt->errorCode() !== '00000') {
|
||||||
sendEppError($conn, $db, 2400, 'The transfer was not initiated successfully, something is wrong', $clTRID, $trans);
|
sendEppError($conn, $db, 2400, 'The transfer was not initiated successfully, something is wrong', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue