mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-23 11:05:57 +02:00
More RST updates
This commit is contained in:
parent
73db314105
commit
c701ce329b
2 changed files with 3 additions and 33 deletions
|
@ -537,36 +537,6 @@ function processHostCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
|||
sendEppResponse($conn, $xml);
|
||||
|
||||
} else {
|
||||
$parts = explode('.', $hostName, 2);
|
||||
$superordinate = $parts[1] ?? null;
|
||||
|
||||
if (!$superordinate) {
|
||||
sendEppError($conn, $db, 2005, 'Invalid host:name format', $clTRID, $trans);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if domain exists
|
||||
$stmt = $db->prepare("SELECT id FROM domain WHERE name = :name LIMIT 1");
|
||||
$stmt->execute([':name' => $superordinate]);
|
||||
$domain_id = $stmt->fetchColumn();
|
||||
$stmt->closeCursor();
|
||||
|
||||
if (!$domain_id) {
|
||||
sendEppError($conn, $db, 2303, 'Superordinate domain does not exist for host:name', $clTRID, $trans);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the domain belongs to same registrar
|
||||
$stmt = $db->prepare("SELECT clid FROM domain WHERE name = :name LIMIT 1");
|
||||
$stmt->execute([':name' => $superordinate]);
|
||||
$domain_clid = $stmt->fetchColumn();
|
||||
$stmt->closeCursor();
|
||||
|
||||
if ($clid != $domain_clid) {
|
||||
sendEppError($conn, $db, 2201, 'The superordinate domain belongs to another registrar', $clTRID, $trans);
|
||||
return;
|
||||
}
|
||||
|
||||
$stmt = $db->prepare("INSERT INTO host (name,clid,crid,crdate) VALUES(?,?,?,CURRENT_TIMESTAMP(3))");
|
||||
$stmt->execute([$hostName, $clid, $clid]);
|
||||
|
||||
|
|
|
@ -443,7 +443,7 @@ function processContactUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
|||
$status_list = $xml->xpath("contact:status/@s");
|
||||
|
||||
foreach ($status_list as $node) {
|
||||
$status = (string)$node;
|
||||
$status = (string)$node[0];
|
||||
$sth = $db->prepare("DELETE FROM contact_status WHERE contact_id = ? AND status = ?");
|
||||
$sth->execute([$contact_id, $status]);
|
||||
}
|
||||
|
@ -453,7 +453,7 @@ function processContactUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
|||
$status_list = $xml->xpath("contact:status/@s");
|
||||
|
||||
foreach ($status_list as $node) {
|
||||
$status = (string)$node;
|
||||
$status = (string)$node[0];
|
||||
$sth = $db->prepare("INSERT INTO contact_status (contact_id,status) VALUES(?,?)");
|
||||
$sth->execute([$contact_id, $status]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue