mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-22 10:36:03 +02:00
Web rdap update
This commit is contained in:
parent
26cf1d9983
commit
bf91688b3d
1 changed files with 34 additions and 29 deletions
|
@ -55,11 +55,7 @@ $c = require_once 'config.php';
|
||||||
|
|
||||||
document.getElementById('whoisButton').addEventListener('click', function() {
|
document.getElementById('whoisButton').addEventListener('click', function() {
|
||||||
var domain = document.getElementById('domainInput').value;
|
var domain = document.getElementById('domainInput').value;
|
||||||
<?php if ($c['ignore_captcha'] === false) { ?>
|
|
||||||
var captcha = document.getElementById('captchaInput').value;
|
|
||||||
<?php } else { ?>
|
|
||||||
var captcha = '';
|
var captcha = '';
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
fetch('check.php', {
|
fetch('check.php', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
@ -80,11 +76,7 @@ $c = require_once 'config.php';
|
||||||
|
|
||||||
document.getElementById('rdapButton').addEventListener('click', function() {
|
document.getElementById('rdapButton').addEventListener('click', function() {
|
||||||
var domain = document.getElementById('domainInput').value;
|
var domain = document.getElementById('domainInput').value;
|
||||||
<?php if ($c['ignore_captcha'] === false) { ?>
|
|
||||||
var captcha = document.getElementById('captchaInput').value;
|
|
||||||
<?php } else { ?>
|
|
||||||
var captcha = '';
|
var captcha = '';
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
fetch('check.php', {
|
fetch('check.php', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
@ -121,22 +113,7 @@ $c = require_once 'config.php';
|
||||||
// Parsing entities for specific roles like registrar and registrant
|
// Parsing entities for specific roles like registrar and registrant
|
||||||
if (data.entities && data.entities.length > 0) {
|
if (data.entities && data.entities.length > 0) {
|
||||||
data.entities.forEach(entity => {
|
data.entities.forEach(entity => {
|
||||||
if (entity.roles) {
|
output += parseEntity(entity);
|
||||||
output += entity.roles.join(', ').toUpperCase() + ' Contact:\n';
|
|
||||||
if (entity.vcardArray && entity.vcardArray.length > 1) {
|
|
||||||
output += parseVcard(entity.vcardArray[1]);
|
|
||||||
}
|
|
||||||
if (entity.roles.includes('registrar') && entity.publicIds) {
|
|
||||||
output += ' IANA ID: ' + entity.publicIds.map(id => id.identifier).join(', ') + '\n';
|
|
||||||
}
|
|
||||||
if (entity.roles.includes('abuse') && entity.vcardArray) {
|
|
||||||
const emailEntry = entity.vcardArray[1].find(entry => entry[0] === 'email');
|
|
||||||
if (emailEntry) {
|
|
||||||
output += ' Abuse Email: ' + emailEntry[3] + '\n';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
output += '\n';
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,6 +153,35 @@ $c = require_once 'config.php';
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parseEntity(entity) {
|
||||||
|
let output = '';
|
||||||
|
|
||||||
|
if (entity.roles) {
|
||||||
|
output += entity.roles.join(', ').toUpperCase() + ' Contact:\n';
|
||||||
|
if (entity.vcardArray && entity.vcardArray.length > 1) {
|
||||||
|
output += parseVcard(entity.vcardArray[1]);
|
||||||
|
}
|
||||||
|
if (entity.roles.includes('registrar') && entity.publicIds) {
|
||||||
|
output += ' IANA ID: ' + entity.publicIds.map(id => id.identifier).join(', ') + '\n';
|
||||||
|
}
|
||||||
|
if (entity.roles.includes('abuse') && entity.vcardArray) {
|
||||||
|
const emailEntry = entity.vcardArray[1].find(entry => entry[0] === 'email');
|
||||||
|
if (emailEntry) {
|
||||||
|
output += ' Abuse Email: ' + emailEntry[3] + '\n';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
output += '\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity.entities && entity.entities.length > 0) {
|
||||||
|
entity.entities.forEach(subEntity => {
|
||||||
|
output += parseEntity(subEntity);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
function parseVcard(vcard) {
|
function parseVcard(vcard) {
|
||||||
let vcardOutput = '';
|
let vcardOutput = '';
|
||||||
vcard.forEach(entry => {
|
vcard.forEach(entry => {
|
||||||
|
@ -185,7 +191,6 @@ $c = require_once 'config.php';
|
||||||
break;
|
break;
|
||||||
case 'adr':
|
case 'adr':
|
||||||
if (Array.isArray(entry[3]) && entry[3].length > 0) {
|
if (Array.isArray(entry[3]) && entry[3].length > 0) {
|
||||||
// Assuming that the address parts are in the correct order
|
|
||||||
const addressParts = entry[3];
|
const addressParts = entry[3];
|
||||||
vcardOutput += ' Address: ' + addressParts.join(', ') + '\n';
|
vcardOutput += ' Address: ' + addressParts.join(', ') + '\n';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue