mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-03 17:43:22 +02:00
Fixed #7
This commit is contained in:
parent
1a181e0bfc
commit
1f7bdb8c64
1 changed files with 295 additions and 297 deletions
|
@ -1,14 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans) {
|
function processContactTransfer($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$contactID = (string) $xml->command->transfer->children('urn:ietf:params:xml:ns:contact-1.0')->transfer->{'id'};
|
$contactID = (string) $xml->command->transfer->children('urn:ietf:params:xml:ns:contact-1.0')->transfer->{'id'};
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
$op = (string) $xml->xpath('//@op')[0] ?? null;
|
$op = (string) $xml->xpath('//@op')[0] ?? null;
|
||||||
|
|
||||||
$op = (string)$xml['op'][0];
|
|
||||||
$obj = $xml->xpath('//contact:transfer')[0] ?? null;
|
$obj = $xml->xpath('//contact:transfer')[0] ?? null;
|
||||||
|
|
||||||
if ($obj) {
|
|
||||||
$authInfo_pw = (string)$obj->xpath('//contact:authInfo/contact:pw[1]')[0];
|
$authInfo_pw = (string)$obj->xpath('//contact:authInfo/contact:pw[1]')[0];
|
||||||
|
|
||||||
if (!$contactID) {
|
if (!$contactID) {
|
||||||
|
@ -71,6 +68,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
sendEppError($conn, $db, 2400, 'The transfer was not approved successfully, something is wrong', $clTRID, $trans);
|
sendEppError($conn, $db, 2400, 'The transfer was not approved successfully, something is wrong', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
$stmt = $db->prepare("SELECT crid, crdate, upid, lastupdate, trdate, trstatus, reid, redate, acid, acdate FROM contact WHERE id = :contact_id LIMIT 1");
|
||||||
$stmt->execute([':contact_id' => $contact_id]);
|
$stmt->execute([':contact_id' => $contact_id]);
|
||||||
$updatedContactInfo = $stmt->fetch(PDO::FETCH_ASSOC);
|
$updatedContactInfo = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
@ -138,6 +136,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
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;
|
||||||
} else {
|
} else {
|
||||||
|
$stmt = $db->prepare("SELECT crid, crdate, upid, lastupdate, trdate, trstatus, reid, redate, acid, acdate FROM contact WHERE id = :contact_id LIMIT 1");
|
||||||
$stmt->execute([':contact_id' => $contact_id]);
|
$stmt->execute([':contact_id' => $contact_id]);
|
||||||
$updatedContactInfo = $stmt->fetch(PDO::FETCH_ASSOC);
|
$updatedContactInfo = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
@ -362,9 +361,9 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
':registrar_id_contact' => $registrar_id_contact,
|
':registrar_id_contact' => $registrar_id_contact,
|
||||||
':identifier' => $identifier,
|
':identifier' => $identifier,
|
||||||
':reid_identifier' => $reid_identifier,
|
':reid_identifier' => $reid_identifier,
|
||||||
':redate' => str_replace(" ", "T", $result['redate']) . '.0Z',
|
':redate' => $result['redate'],
|
||||||
':acid_identifier' => $acid_identifier,
|
':acid_identifier' => $acid_identifier,
|
||||||
':acdate' => str_replace(" ", "T", $result['acdate']) . '.0Z'
|
':acdate' => $result['acdate']
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$svTRID = generateSvTRID();
|
$svTRID = generateSvTRID();
|
||||||
|
@ -388,7 +387,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
updateTransaction($db, 'transfer', 'contact', $identifier, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
|
updateTransaction($db, 'transfer', 'contact', $identifier, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
}
|
}
|
||||||
} elseif ($op == 'pending') {
|
} else {
|
||||||
sendEppError($conn, $db, 2300, 'Command failed because the contact is pending transfer', $clTRID, $trans);
|
sendEppError($conn, $db, 2300, 'Command failed because the contact is pending transfer', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -397,7 +396,6 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans) {
|
function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$domainName = (string) $xml->command->transfer->children('urn:ietf:params:xml:ns:domain-1.0')->transfer->name;
|
$domainName = (string) $xml->command->transfer->children('urn:ietf:params:xml:ns:domain-1.0')->transfer->name;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue