EPP domain create fixes

This commit is contained in:
Pinga 2023-08-28 12:22:54 +03:00
parent 8cae312a6a
commit a11a0ecc14

View file

@ -673,9 +673,18 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
} }
$ns = $xml->xpath('//domain:ns')[0]; $ns = $xml->xpath('//domain:ns')[0];
$hostObj_list = null;
$hostAttr_list = null;
if ($ns && count($ns) > 0) {
$hostObj_list = $ns->xpath('//domain:hostObj'); $hostObj_list = $ns->xpath('//domain:hostObj');
$hostAttr_list = $ns->xpath('//domain:hostAttr'); $hostAttr_list = $ns->xpath('//domain:hostAttr');
}
if (
($hostObj_list !== null && is_array($hostObj_list)) ||
($hostAttr_list !== null && is_array($hostAttr_list))
) {
if (count($hostObj_list) > 0 && count($hostAttr_list) > 0) { if (count($hostObj_list) > 0 && count($hostAttr_list) > 0) {
sendEppError($conn, $db, 2001, 'It cannot be hostObj and hostAttr at the same time, either one or the other', $clTRID, $trans); sendEppError($conn, $db, 2001, 'It cannot be hostObj and hostAttr at the same time, either one or the other', $clTRID, $trans);
return; return;
@ -930,6 +939,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
} }
} }
} }
}
// Registrant // Registrant
$registrant = $xml->xpath('//domain:registrant[1]'); $registrant = $xml->xpath('//domain:registrant[1]');
@ -1168,6 +1178,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
':price' => $price ':price' => $price
]); ]);
if ($hostObj_list !== null && is_array($hostObj_list)) {
foreach ($hostObj_list as $node) { foreach ($hostObj_list as $node) {
$hostObj = strtoupper((string)$node); $hostObj = strtoupper((string)$node);
@ -1222,7 +1233,9 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
} }
} }
}
if ($hostAttr_list !== null && is_array($hostAttr_list)) {
foreach ($hostAttr_list as $element) { foreach ($hostAttr_list as $element) {
foreach ($element->children() as $node) { foreach ($element->children() as $node) {
$hostName = strtoupper($node->xpath('//domain:hostName')[0]); $hostName = strtoupper($node->xpath('//domain:hostName')[0]);
@ -1266,6 +1279,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
} }
} }
} }
}
$contact_admin_list = $xml->xpath("//domain:contact[@type='admin']"); $contact_admin_list = $xml->xpath("//domain:contact[@type='admin']");
$contact_billing_list = $xml->xpath("//domain:contact[@type='billing']"); $contact_billing_list = $xml->xpath("//domain:contact[@type='billing']");