mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-22 18:45:59 +02:00
EPP domain transfer fixes
This commit is contained in:
parent
24d0fbb543
commit
4b77b53555
1 changed files with 13 additions and 34 deletions
|
@ -3,6 +3,7 @@
|
|||
function processContactTranfer($conn, $db, $xml, $clid, $database_type) {
|
||||
$contactID = (string) $xml->command->transfer->children('urn:ietf:params:xml:ns:contact-1.0')->transfer->{'id'};
|
||||
$clTRID = (string) $xml->command->clTRID;
|
||||
$op = (string) $xml->xpath('//@op')[0] ?? null;
|
||||
|
||||
$op = (string)$xml['op'][0];
|
||||
$obj = $xml->xpath('//contact:transfer')[0] ?? null;
|
||||
|
@ -388,13 +389,13 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type) {
|
|||
}
|
||||
}
|
||||
|
||||
function processDomainTranfer($conn, $db, $xml, $clid, $database_type) {
|
||||
function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
|
||||
$domainName = (string) $xml->command->transfer->children('urn:ietf:params:xml:ns:domain-1.0')->transfer->name;
|
||||
$clTRID = (string) $xml->command->clTRID;
|
||||
$op = (string) $xml->xpath('//@op')[0] ?? null;
|
||||
|
||||
// - An OPTIONAL <domain:authInfo> for op="query" and mandatory for other op values "approve|cancel|reject|request"
|
||||
$authInfo_pw = (string)$xml->xpath('//domain:authInfo/domain:pw[1]')[0];
|
||||
$authInfo_pw_roid = (string)$xml->xpath('//domain:authInfo/domain:pw/@roid[1]')[0];
|
||||
|
||||
if (!$domainName) {
|
||||
sendEppError($conn, 2003, 'Please provide the domain name', $clTRID);
|
||||
|
@ -765,28 +766,7 @@ function processDomainTranfer($conn, $db, $xml, $clid, $database_type) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Auth info with ROID
|
||||
if ($authInfo_pw_roid) {
|
||||
// Retain only numbers from roid
|
||||
$authInfo_pw_roid = preg_replace("/\D/", "", $authInfo_pw_roid);
|
||||
$stmt = $db->prepare("SELECT `contact_id` FROM `domain_contact_map` WHERE `domain_id` = :domain_id AND `contact_id` = :authInfo_pw_roid LIMIT 1");
|
||||
$stmt->execute(['domain_id' => $domain_id, 'authInfo_pw_roid' => $authInfo_pw_roid]);
|
||||
$contact_id_roid = $stmt->fetchColumn();
|
||||
|
||||
if (!$contact_id_roid) {
|
||||
sendEppError($conn, 2202, 'authInfo pw with roid is invalid', $clTRID);
|
||||
return;
|
||||
}
|
||||
|
||||
$stmt = $db->prepare("SELECT `id` FROM `contact_authInfo` WHERE `contact_id` = :authInfo_pw_roid AND `authtype` = 'pw' AND `authinfo` = :authInfo_pw LIMIT 1");
|
||||
$stmt->execute(['authInfo_pw_roid' => $authInfo_pw_roid, 'authInfo_pw' => $authInfo_pw]);
|
||||
$contact_authInfo_id = $stmt->fetchColumn();
|
||||
|
||||
if (!$contact_authInfo_id) {
|
||||
sendEppError($conn, 2202, 'authInfo pw with roid is invalid', $clTRID);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// Auth info
|
||||
$stmt = $db->prepare("SELECT `id` FROM `domain_authInfo` WHERE `domain_id` = :domain_id AND `authtype` = 'pw' AND `authinfo` = :authInfo_pw LIMIT 1");
|
||||
$stmt->execute(['domain_id' => $domain_id, 'authInfo_pw' => $authInfo_pw]);
|
||||
$domain_authinfo_id = $stmt->fetchColumn();
|
||||
|
@ -795,7 +775,6 @@ function processDomainTranfer($conn, $db, $xml, $clid, $database_type) {
|
|||
sendEppError($conn, 2202, 'authInfo pw is invalid', $clTRID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check domain status
|
||||
$stmt = $db->prepare("SELECT `status` FROM `domain_status` WHERE `domain_id` = :domain_id");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue