Fixed whois and rdap status display

This commit is contained in:
Pinga 2023-12-13 06:17:56 +02:00
parent 8dcbaed649
commit c5cb152f6e
2 changed files with 34 additions and 0 deletions

View file

@ -350,6 +350,16 @@ function handleDomainQuery($request, $response, $pdo, $domainName, $c, $log) {
$stmt2->execute();
$statuses = $stmt2->fetchAll(PDO::FETCH_COLUMN, 0);
// Add rgpstatus to statuses if it's not empty
if (!empty($domainDetails['rgpstatus'])) {
$statuses[] = $domainDetails['rgpstatus'];
}
// If statuses array is empty, add 'ok' to it
if (empty($statuses)) {
$statuses[] = 'ok';
}
// Query: Get DNSSEC details
$stmt2a = $pdo->prepare("SELECT interface FROM secdns WHERE domain_id = :domain_id");
$stmt2a->bindParam(':domain_id', $domainDetails['id'], PDO::PARAM_INT);
@ -1570,6 +1580,16 @@ function handleDomainSearchQuery($request, $response, $pdo, $searchPattern, $c,
$stmt2->execute();
$statuses = $stmt2->fetchAll(PDO::FETCH_COLUMN, 0);
// Add rgpstatus to statuses if it's not empty
if (!empty($domainDetails['rgpstatus'])) {
$statuses[] = $domainDetails['rgpstatus'];
}
// If statuses array is empty, add 'ok' to it
if (empty($statuses)) {
$statuses[] = 'ok';
}
// Query: Get DNSSEC details
$stmt2a = $pdo->prepare("SELECT interface FROM secdns WHERE domain_id = :domain_id");
$stmt2a->bindParam(':domain_id', $domainDetails['id'], PDO::PARAM_INT);

View file

@ -171,8 +171,22 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) use ($c, $pool
$stmt4->bindParam(':domain_id', $f['id'], PDO::PARAM_INT);
$stmt4->execute();
$statusFound = false;
while ($f2 = $stmt4->fetch(PDO::FETCH_ASSOC)) {
$res .= "\nDomain Status: " . $f2['status'] . " https://icann.org/epp#" . $f2['status'];
$statusFound = true;
}
// Check for additional statuses
if (!empty($f['rgpstatus'])) {
$res .= "\nDomain Status: " . $f['rgpstatus'] . " https://icann.org/epp#" . $f['rgpstatus'];
$statusFound = true;
}
// If no status is found, default to 'ok'
if (!$statusFound) {
$res .= "\nDomain Status: ok https://icann.org/epp#ok";
}
$query5 = "SELECT contact.identifier,contact_postalInfo.name,contact_postalInfo.org,contact_postalInfo.street1,contact_postalInfo.street2,contact_postalInfo.street3,contact_postalInfo.city,contact_postalInfo.sp,contact_postalInfo.pc,contact_postalInfo.cc,contact.voice,contact.fax,contact.email