mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-29 17:00:06 +02:00
Further transfer fixes
This commit is contained in:
parent
e086f001ef
commit
d03e85b3cb
3 changed files with 20 additions and 46 deletions
|
@ -2175,21 +2175,9 @@ class DomainsController extends Controller
|
|||
$clid = $db->selectValue('SELECT clid FROM domain WHERE name = ?', [$domainName]);
|
||||
}
|
||||
|
||||
$domain_authinfo_id = $db->selectValue(
|
||||
'SELECT id FROM domain_authInfo WHERE domain_id = ? AND authtype = \'pw\' AND authinfo = ? LIMIT 1',
|
||||
[
|
||||
$domain_id, $authInfo
|
||||
]
|
||||
);
|
||||
|
||||
if ($clid !== $registrar_id_domain) {
|
||||
$this->container->get('flash')->addMessage('error', 'Only LOSING REGISTRAR can approve');
|
||||
return $response->withHeader('Location', '/transfer/request')->withStatus(302);
|
||||
}
|
||||
|
||||
if (!$domain_authinfo_id) {
|
||||
$this->container->get('flash')->addMessage('error', 'auth Info pw is not correct');
|
||||
return $response->withHeader('Location', '/transfer/request')->withStatus(302);
|
||||
return $response->withHeader('Location', '/transfers')->withStatus(302);
|
||||
}
|
||||
|
||||
$domain = $db->selectRow('SELECT id, registrant, crdate, exdate, clid, crid, upid, trdate, trstatus, reid, redate, acid, acdate, rgpstatus, addPeriod, autoRenewPeriod, renewPeriod, renewedDate, transferPeriod, transfer_exdate FROM domain WHERE name = ?',
|
||||
|
@ -2225,7 +2213,7 @@ class DomainsController extends Controller
|
|||
$creditLimit = $result['creditLimit'];
|
||||
|
||||
if ($transfer_exdate) {
|
||||
$date_add = $db->selectRow(
|
||||
$date_add = $db->selectValue(
|
||||
"SELECT PERIOD_DIFF(DATE_FORMAT(transfer_exdate, '%Y%m'), DATE_FORMAT(exdate, '%Y%m')) AS intval FROM domain WHERE name = ? LIMIT 1",
|
||||
[
|
||||
$domainName
|
||||
|
@ -2247,8 +2235,14 @@ class DomainsController extends Controller
|
|||
try {
|
||||
$db->beginTransaction();
|
||||
|
||||
$row = $db->selectRow(
|
||||
'SELECT exdate FROM domain WHERE name = ? LIMIT 1',
|
||||
[$domainName]
|
||||
);
|
||||
$from = $row['exdate'];
|
||||
|
||||
$db->exec(
|
||||
'UPDATE domain SET exdate = DATE_ADD(exdate, INTERVAL ? MONTH), update = CURRENT_TIMESTAMP(3), clid = ?, upid = ?, trdate = CURRENT_TIMESTAMP(3), trstatus = ?, acdate = CURRENT_TIMESTAMP(3), transfer_exdate = NULL, rgpstatus = ?, transferPeriod = ? WHERE id = ?',
|
||||
'UPDATE domain SET exdate = DATE_ADD(exdate, INTERVAL ? MONTH), `update` = CURRENT_TIMESTAMP(3), clid = ?, upid = ?, trdate = CURRENT_TIMESTAMP(3), trstatus = ?, acdate = CURRENT_TIMESTAMP(3), transfer_exdate = NULL, rgpstatus = ?, transferPeriod = ? WHERE id = ?',
|
||||
[$date_add, $reid, $clid, 'clientApproved', 'transferPeriod', $date_add, $domain_id]
|
||||
);
|
||||
|
||||
|
@ -2346,23 +2340,11 @@ class DomainsController extends Controller
|
|||
$clid = $db->selectValue('SELECT clid FROM domain WHERE name = ?', [$domainName]);
|
||||
}
|
||||
|
||||
$domain_authinfo_id = $db->selectValue(
|
||||
'SELECT id FROM domain_authInfo WHERE domain_id = ? AND authtype = \'pw\' AND authinfo = ? LIMIT 1',
|
||||
[
|
||||
$domain_id, $authInfo
|
||||
]
|
||||
);
|
||||
|
||||
if ($clid !== $registrar_id_domain) {
|
||||
$this->container->get('flash')->addMessage('error', 'Only LOSING REGISTRAR can reject');
|
||||
return $response->withHeader('Location', '/transfers')->withStatus(302);
|
||||
}
|
||||
|
||||
if (!$domain_authinfo_id) {
|
||||
$this->container->get('flash')->addMessage('error', 'auth Info pw is not correct');
|
||||
return $response->withHeader('Location', '/transfers')->withStatus(302);
|
||||
}
|
||||
|
||||
$domain = $db->selectRow('SELECT id, trstatus FROM domain WHERE name = ? LIMIT 1',
|
||||
[ $domainName ]);
|
||||
|
||||
|
@ -2413,23 +2395,11 @@ class DomainsController extends Controller
|
|||
$clid = $db->selectValue('SELECT clid FROM domain WHERE name = ?', [$domainName]);
|
||||
}
|
||||
|
||||
$domain_authinfo_id = $db->selectValue(
|
||||
'SELECT id FROM domain_authInfo WHERE domain_id = ? AND authtype = \'pw\' AND authinfo = ? LIMIT 1',
|
||||
[
|
||||
$domain_id, $authInfo
|
||||
]
|
||||
);
|
||||
|
||||
if ($clid === $registrar_id_domain) {
|
||||
$this->container->get('flash')->addMessage('error', 'Only the APPLICANT can cancel');
|
||||
return $response->withHeader('Location', '/transfers')->withStatus(302);
|
||||
}
|
||||
|
||||
if (!$domain_authinfo_id) {
|
||||
$this->container->get('flash')->addMessage('error', 'auth Info pw is not correct');
|
||||
return $response->withHeader('Location', '/transfers')->withStatus(302);
|
||||
}
|
||||
|
||||
$domain = $db->selectRow('SELECT id, trstatus FROM domain WHERE name = ? LIMIT 1',
|
||||
[ $domainName ]);
|
||||
|
||||
|
|
|
@ -49,9 +49,9 @@ $app->group('', function ($route) {
|
|||
|
||||
$route->get('/transfers', DomainsController::class . ':listTransfers')->setName('listTransfers');
|
||||
$route->map(['GET', 'POST'], '/transfer/request', DomainsController::class . ':requestTransfer')->setName('requestTransfer');
|
||||
$route->post('/transfer/approve', DomainsController::class . ':approveTransfer')->setName('approveTransfer');
|
||||
$route->post('/transfer/reject', DomainsController::class . ':rejectTransfer')->setName('rejectTransfer');
|
||||
$route->post('/transfer/cancel', DomainsController::class . ':cancelTransfer')->setName('cancelTransfer');
|
||||
$route->map(['GET', 'POST'], '/transfer/approve/{domain}', DomainsController::class . ':approveTransfer')->setName('approveTransfer');
|
||||
$route->map(['GET', 'POST'], '/transfer/reject/{domain}', DomainsController::class . ':rejectTransfer')->setName('rejectTransfer');
|
||||
$route->map(['GET', 'POST'], '/transfer/cancel/{domain}', DomainsController::class . ':cancelTransfer')->setName('cancelTransfer');
|
||||
|
||||
$route->get('/contacts', ContactsController::class .':listContacts')->setName('listContacts');
|
||||
$route->map(['GET', 'POST'], '/contact/create', ContactsController::class . ':createContact')->setName('createContact');
|
||||
|
|
|
@ -476,6 +476,10 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
|||
}
|
||||
}
|
||||
|
||||
$stmt = $db->prepare("SELECT `exdate` FROM `domain` WHERE `id` = :domain_id LIMIT 1");
|
||||
$stmt->execute(['domain_id' => $domain_id]);
|
||||
$from = $stmt->fetchColumn();
|
||||
|
||||
$stmt = $db->prepare("UPDATE `domain` SET `exdate` = DATE_ADD(`exdate`, INTERVAL ? MONTH), `update` = CURRENT_TIMESTAMP(3), `clid` = ?, `upid` = ?, `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, $date_add, $domain_id]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue