EPP housekeeping

This commit is contained in:
Pinga 2025-02-17 15:31:33 +02:00
parent 52f4eab87d
commit f2326a92e0

View file

@ -649,20 +649,13 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans, $m
$parts = extractDomainAndTLD($domainName); $parts = extractDomainAndTLD($domainName);
$label = $parts['domain']; $label = $parts['domain'];
$domain_extension = $parts['tld']; $domain_extension = '.' . strtoupper($parts['tld']);
$valid_tld = false; $stmt = $db->prepare("SELECT id FROM domain_tld WHERE UPPER(tld) = ?");
$stmt = $db->prepare("SELECT id, tld FROM domain_tld"); $stmt->execute([$domain_extension]);
$stmt->execute(); $tld_id = $stmt->fetchColumn();
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
if ('.' . strtoupper($domain_extension) === strtoupper($row['tld'])) {
$valid_tld = true;
$tld_id = $row['id'];
break;
}
}
if (!$valid_tld) { if (!$tld_id) {
sendEppError($conn, $db, 2306, 'Invalid domain extension', $clTRID, $trans); sendEppError($conn, $db, 2306, 'Invalid domain extension', $clTRID, $trans);
return; return;
} }
@ -683,19 +676,24 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans, $m
$currentDateTime = new \DateTime(); $currentDateTime = new \DateTime();
$currentDate = $currentDateTime->format('Y-m-d H:i:s.v'); // Current timestamp $currentDate = $currentDateTime->format('Y-m-d H:i:s.v'); // Current timestamp
$stmt = $db->prepare(" $stmt = $db->prepare("
SELECT phase_category SELECT phase_category
FROM launch_phases FROM launch_phases
WHERE tld_id = ? WHERE tld_id = ?
AND phase_type = ?
AND start_date <= ? AND start_date <= ?
AND (end_date >= ? OR end_date IS NULL OR end_date = '') AND (end_date >= ? OR end_date IS NULL OR end_date = '')
LIMIT 1 LIMIT 1
"); ");
$stmt->execute([$tld_id, $launch_phase, $currentDate, $currentDate]); $stmt->execute([$tld_id, $currentDate, $currentDate]);
$phase_details = $stmt->fetchColumn(); $phase_details = $stmt->fetchColumn();
// Check if the phase requires application submission
if ($phase_details && $phase_details === 'Application') {
sendEppError($conn, $db, 2304, 'Domain registration is not allowed for this TLD. You must submit a new application instead.', $clTRID, $trans);
return;
}
if ($phase_details !== 'First-Come-First-Serve') { if ($phase_details !== 'First-Come-First-Serve') {
if ($launch_phase !== 'none') { if ($launch_phase !== 'none') {
if ($launch_phase == null && $launch_phase == '') { if ($launch_phase == null && $launch_phase == '') {