More RST fixes

This commit is contained in:
Pinga 2025-04-28 16:59:04 +03:00
parent 193cac6d0e
commit 454b754f7f
5 changed files with 29 additions and 11 deletions

View file

@ -191,7 +191,10 @@ try {
$stmt->bindParam(':domain_id', $domain['id']);
$stmt->execute();
$status = $stmt->fetch();
$xml->writeElement('rdeDomain:status', $status['status'] ?? 'okk');
$xml->startElement('rdeDomain:status');
$xml->writeAttribute('s', $status['status'] ?? 'ok');
$xml->text($status['status'] ?? 'ok');
$xml->endElement(); // Close rdeDomain:status
$xml->writeElement('rdeDomain:registrant', $domain['registrant']);
@ -218,8 +221,8 @@ try {
}
$xml->endElement(); // Closing rdeDomain:ns
$xml->writeElement('rdeDomain:clID', $domain['clid']);
$xml->writeElement('rdeDomain:crRr', $domain['crid']);
$xml->writeElement('rdeDomain:clID', getClid($dbh, $domain['clid']));
$xml->writeElement('rdeDomain:crRr', getClid($dbh, $domain['crid']));
$crDate = DateTime::createFromFormat('Y-m-d H:i:s.v', $domain['crdate']);
$xml->writeElement('rdeDomain:crDate', $crDate->format("Y-m-d\\TH:i:s.v\\Z"));
$exDate = DateTime::createFromFormat('Y-m-d H:i:s.v', $domain['exdate']);
@ -244,8 +247,8 @@ try {
$xml->text('ok');
$xml->endElement(); // Closing rdeHost:status
$xml->writeElement('rdeHost:clID', $host['clid']);
$xml->writeElement('rdeHost:crRr', $host['crid']);
$xml->writeElement('rdeHost:clID', getClid($dbh, $host['clid']));
$xml->writeElement('rdeHost:crRr', getClid($dbh, $host['crid']));
$crDate = DateTime::createFromFormat('Y-m-d H:i:s.v', $host['crdate']);
$xml->writeElement('rdeHost:crDate', $crDate->format("Y-m-d\\TH:i:s.v\\Z"));
$xml->endElement(); // Closing rdeHost:host
@ -289,8 +292,8 @@ try {
$xml->writeElement('rdeContact:voice', $contact['voice']);
$xml->writeElement('rdeContact:fax', $contact['fax']);
$xml->writeElement('rdeContact:email', $contact['email']);
$xml->writeElement('rdeContact:clID', $contact['clid']);
$xml->writeElement('rdeContact:crRr', $contact['crid']);
$xml->writeElement('rdeContact:clID', getClid($dbh, $contact['clid']));
$xml->writeElement('rdeContact:crRr', getClid($dbh, $contact['crid']));
$crDate = DateTime::createFromFormat('Y-m-d H:i:s.v', $contact['crdate']);
$xml->writeElement('rdeContact:crDate', $crDate->format("Y-m-d\\TH:i:s.v\\Z"));
if (!empty($contact['upid'])) {
@ -736,7 +739,10 @@ try {
$stmt->bindParam(':domain_id', $domain['id']);
$stmt->execute();
$status = $stmt->fetch();
$xml->writeElement('rdeDomain:status', $status['status'] ?? 'okk');
$xml->startElement('rdeDomain:status');
$xml->writeAttribute('s', $status['status'] ?? 'ok');
$xml->text($status['status'] ?? 'ok');
$xml->endElement(); // Close rdeDomain:status
$xml->writeElement('rdeDomain:registrant', $domain['registrant']);
@ -763,8 +769,8 @@ try {
}
$xml->endElement(); // Closing rdeDomain:ns
$xml->writeElement('rdeDomain:clID', $domain['clid']);
$xml->writeElement('rdeDomain:crRr', $domain['crid']);
$xml->writeElement('rdeDomain:clID', getClid($dbh, $domain['clid']));
$xml->writeElement('rdeDomain:crRr', getClid($dbh, $domain['crid']));
$crDate = DateTime::createFromFormat('Y-m-d H:i:s.v', $domain['crdate']);
$xml->writeElement('rdeDomain:crDate', $crDate->format("Y-m-d\\TH:i:s.v\\Z"));
$exDate = DateTime::createFromFormat('Y-m-d H:i:s.v', $domain['exdate']);

View file

@ -524,4 +524,14 @@ function generateSerial($soa_type = null) {
default:
return time();
}
}
function getClid(PDO $db, int $registrar_id): ?string {
$stmt = $db->prepare("SELECT clid FROM registrar WHERE id = :id LIMIT 1");
$stmt->bindParam(':id', $registrar_id, PDO::PARAM_INT);
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
return $result ? (string)$result['clid'] : null;
}

View file

@ -75,7 +75,7 @@ $server->set([
'ssl_verify_peer' => false,
'ssl_allow_self_signed' => false,
'ssl_protocols' => SWOOLE_SSL_TLSv1_2 | SWOOLE_SSL_TLSv1_3,
'ssl_ciphers' => 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES256-GCM-SHA384',
'ssl_ciphers' => 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE+AESGCM:ECDHE+AES256:ECDHE+AES128:DHE+AES256:DHE+AES128:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK',
]);
$rateLimiter = new Rately();

View file

@ -197,6 +197,7 @@ function handleDomainQuery($request, $response, $pdo, $domainName, $c, $log) {
// Extract and validate the domain name from the request
$domain = urldecode($domainName);
$domain = trim($domain);
$domain = strtolower($domain);
// Empty domain check
if (!$domain) {

View file

@ -197,6 +197,7 @@ function handleDomainQuery($request, $response, $pdo, $domainName, $c, $log) {
// Extract and validate the domain name from the request
$domain = urldecode($domainName);
$domain = trim($domain);
$domain = strtolower($domain);
// Empty domain check
if (!$domain) {