diff --git a/epp/src/epp-delete.php b/epp/src/epp-delete.php index 0eff945..73f402c 100644 --- a/epp/src/epp-delete.php +++ b/epp/src/epp-delete.php @@ -5,7 +5,7 @@ function processContactDelete($conn, $db, $xml, $clid, $database_type) { $clTRID = (string) $xml->command->clTRID; if (!$contactID) { - sendEppError($conn, 2003, 'Required parameter missing', $clTRID); + sendEppError($conn, 2003, 'Missing contact:id', $clTRID); return; } @@ -17,7 +17,7 @@ function processContactDelete($conn, $db, $xml, $clid, $database_type) { $registrar_id_contact = $row['clid'] ?? null; if (!$contact_id) { - sendEppError($conn, 2303, 'Object does not exist', $clTRID); + sendEppError($conn, 2303, 'contact:id does not exist', $clTRID); return; } @@ -28,7 +28,7 @@ function processContactDelete($conn, $db, $xml, $clid, $database_type) { $clid = $clid['id']; if ($clid !== $registrar_id_contact) { - sendEppError($conn, 2201, 'Authorization error', $clTRID); + sendEppError($conn, 2201, 'Contact belongs to another registrar', $clTRID); return; } @@ -37,7 +37,7 @@ function processContactDelete($conn, $db, $xml, $clid, $database_type) { $registrantExists = $stmt->fetchColumn(); if ($registrantExists) { - sendEppError($conn, 2305, 'Object association prohibits operation', $clTRID); + sendEppError($conn, 2305, 'This contact is associated with a domain as a registrant', $clTRID); return; } @@ -46,7 +46,7 @@ function processContactDelete($conn, $db, $xml, $clid, $database_type) { $contactInUse = $stmt->fetchColumn(); if ($contactInUse) { - sendEppError($conn, 2305, 'Object association prohibits operation', $clTRID); + sendEppError($conn, 2305, 'This contact is associated with a domain', $clTRID); return; } @@ -55,7 +55,7 @@ function processContactDelete($conn, $db, $xml, $clid, $database_type) { while ($status = $stmt->fetchColumn()) { if (preg_match('/.*(UpdateProhibited|DeleteProhibited)$/', $status) || preg_match('/^pending/', $status)) { - sendEppError($conn, 2304, 'Object status prohibits operation', $clTRID); + sendEppError($conn, 2304, 'It has a status that does not allow deletion', $clTRID); return; } } @@ -69,7 +69,7 @@ function processContactDelete($conn, $db, $xml, $clid, $database_type) { $stmt->execute([$contact_id]); if ($stmt->errorCode() != '00000') { - sendEppError($conn, 2400, 'Command failed', $clTRID); + sendEppError($conn, 2400, 'Contact was not deleted, it probably has links to other objects', $clTRID); return; } @@ -92,7 +92,7 @@ function processHostDelete($conn, $db, $xml, $clid, $database_type) { $clTRID = (string) $xml->command->clTRID; if (!$hostName) { - sendEppError($conn, 2003, 'Required parameter missing', $clTRID); + sendEppError($conn, 2003, 'Specify your host name', $clTRID); return; } @@ -105,7 +105,7 @@ function processHostDelete($conn, $db, $xml, $clid, $database_type) { $registrar_id_host = $result['clid'] ?? null; if (!$host_id) { - sendEppError($conn, 2303, 'Object does not exist', $clTRID); + sendEppError($conn, 2303, 'host:name does not exist', $clTRID); return; } @@ -116,7 +116,7 @@ function processHostDelete($conn, $db, $xml, $clid, $database_type) { $clid = $clid['id']; if ($clid !== $registrar_id_host) { - sendEppError($conn, 2201, 'Authorization error', $clTRID); + sendEppError($conn, 2201, 'Host belongs to another registrar', $clTRID); return; } @@ -126,7 +126,7 @@ function processHostDelete($conn, $db, $xml, $clid, $database_type) { $nameserver_inuse = $stmt->fetchColumn(); if ($nameserver_inuse) { - sendEppError($conn, 2305, 'Object association prohibits operation', $clTRID); + sendEppError($conn, 2305, 'It is not possible to delete because it is a dependency, it is used by some domain', $clTRID); return; } @@ -143,7 +143,7 @@ function processHostDelete($conn, $db, $xml, $clid, $database_type) { $stmt->execute([':host_id' => $host_id]); if ($stmt->errorCode() != '00000') { - sendEppError($conn, 2400, 'Command failed', $clTRID); + sendEppError($conn, 2400, 'The host was not deleted, it depends on other objects', $clTRID); return; } @@ -166,7 +166,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type) { $clTRID = (string) $xml->command->clTRID; if (!$domainName) { - sendEppError($conn, 2003, 'Required parameter missing', $clTRID); + sendEppError($conn, 2003, 'Please specify the domain name that will be deleted', $clTRID); return; } @@ -180,7 +180,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type) { $result = $stmt->fetch(PDO::FETCH_ASSOC); if (!$result) { - sendEppError($conn, 2303, 'Object does not exist', $clTRID); + sendEppError($conn, 2303, 'domain:name does not exist', $clTRID); return; } @@ -213,7 +213,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type) { $clid = $clid['id']; if ($clid != $registrar_id_domain) { - sendEppError($conn, 2201, 'Authorization error', $clTRID); + sendEppError($conn, 2201, 'Domain belongs to another registrar', $clTRID); return; } @@ -222,7 +222,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type) { while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $status = $row['status']; if (preg_match('/.*(UpdateProhibited|DeleteProhibited)$/', $status) || preg_match('/^pending/', $status)) { - sendEppError($conn, 2304, 'Object status prohibits operation', $clTRID); + sendEppError($conn, 2304, 'The domain name has a status that does not allow deletion', $clTRID); return; } } @@ -253,7 +253,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type) { $price = $stmt->fetchColumn(); if (!isset($price)) { - sendEppError($conn, 2400, 'Command failed', $clTRID); + sendEppError($conn, 2400, 'The price, period and currency for such TLD are not declared', $clTRID); return; } @@ -287,7 +287,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type) { $stmt->execute([$domain_id]); if ($stmt->errorCode() != "00000") { - sendEppError($conn, 2400, 'Command failed', $clTRID); + sendEppError($conn, 2400, 'The domain name has not been deleted, it has something to do with other objects', $clTRID); return; } @@ -311,7 +311,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type) { $price = $stmt->fetchColumn(); if (!isset($price)) { - sendEppError($conn, 2400, 'Command failed', $clTRID); + sendEppError($conn, 2400, 'The price, period and currency for such TLD are not declared', $clTRID); return; } @@ -335,7 +335,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type) { $price = $stmt->fetchColumn(); if (!isset($price)) { - sendEppError($conn, 2400, 'Command failed', $clTRID); + sendEppError($conn, 2400, 'The price, period and currency for such TLD are not declared', $clTRID); return; } @@ -361,7 +361,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type) { $price = $stmt->fetchColumn(); if (!isset($price)) { - sendEppError($conn, 2400, 'Command failed', $clTRID); + sendEppError($conn, 2400, 'The price, period and currency for such TLD are not declared', $clTRID); return; }