Small fixes around roids

This commit is contained in:
Pinga 2024-03-06 01:01:52 +02:00
parent e0f77397d8
commit 93f1cd7674
6 changed files with 24 additions and 23 deletions

View file

@ -29,6 +29,7 @@ return [
'escrow_report_url' => 'https://ry-api.icann.org/report/', 'escrow_report_url' => 'https://ry-api.icann.org/report/',
'escrow_report_username' => 'your_username', 'escrow_report_username' => 'your_username',
'escrow_report_password' => 'your_password', 'escrow_report_password' => 'your_password',
'roid' => 'XX',
// Reporting Configuration // Reporting Configuration
'reporting_path' => '/opt/reporting', 'reporting_path' => '/opt/reporting',

View file

@ -172,7 +172,7 @@ try {
foreach ($domains as $domain) { foreach ($domains as $domain) {
$xml->startElement('rdeDom:domain'); $xml->startElement('rdeDom:domain');
$xml->writeElement('rdeDom:name', $domain['name']); $xml->writeElement('rdeDom:name', $domain['name']);
$xml->writeElement('rdeDom:roid', 'D' . $domain['id']); $xml->writeElement('rdeDom:roid', 'D' . $domain['id'] . '-' . $c['roid']);
$xml->writeElement('rdeDom:uName', $domain['name']); $xml->writeElement('rdeDom:uName', $domain['name']);
$xml->writeElement('rdeDom:idnTableId', 'Latn'); $xml->writeElement('rdeDom:idnTableId', 'Latn');
@ -227,7 +227,7 @@ try {
foreach ($hosts as $host) { foreach ($hosts as $host) {
$xml->startElement('rdeHost:host'); $xml->startElement('rdeHost:host');
$xml->writeElement('rdeHost:name', $host['name']); $xml->writeElement('rdeHost:name', $host['name']);
$xml->writeElement('rdeHost:roid', 'H' . $host['id']); $xml->writeElement('rdeHost:roid', 'H' . $host['id'] . '-' . $c['roid']);
$xml->startElement('rdeHost:status'); $xml->startElement('rdeHost:status');
$xml->writeAttribute('s', 'ok'); $xml->writeAttribute('s', 'ok');
@ -249,8 +249,8 @@ try {
foreach ($contacts as $contact) { foreach ($contacts as $contact) {
$xml->startElement('rdeContact:contact'); $xml->startElement('rdeContact:contact');
$xml->writeElement('rdeContact:id', $contact['identifier']); $xml->writeElement('rdeContact:id', $contact['id']);
$xml->writeElement('rdeContact:roid', 'C' . $contact['id']); $xml->writeElement('rdeContact:roid', 'C' . $contact['id'] . '-' . $c['roid']);
$xml->startElement('rdeContact:status'); $xml->startElement('rdeContact:status');
$xml->writeAttribute('s', 'ok'); $xml->writeAttribute('s', 'ok');
$xml->text('ok'); $xml->text('ok');
@ -299,7 +299,7 @@ try {
$xml->startElement('rdeRegistrar:registrar'); $xml->startElement('rdeRegistrar:registrar');
foreach ($registrars as $registrar) { foreach ($registrars as $registrar) {
$xml->writeElement('rdeRegistrar:id', $registrar['clid']); $xml->writeElement('rdeRegistrar:id', $registrar['id']);
$xml->writeElement('rdeRegistrar:name', $registrar['name']); $xml->writeElement('rdeRegistrar:name', $registrar['name']);
$xml->writeElement('rdeRegistrar:gurid', $registrar['iana_id']); $xml->writeElement('rdeRegistrar:gurid', $registrar['iana_id']);
$xml->writeElement('rdeRegistrar:status', 'ok'); $xml->writeElement('rdeRegistrar:status', 'ok');
@ -702,7 +702,7 @@ try {
foreach ($domains as $domain) { foreach ($domains as $domain) {
$xml->startElement('rdeDom:domain'); $xml->startElement('rdeDom:domain');
$xml->writeElement('rdeDom:name', $domain['name']); $xml->writeElement('rdeDom:name', $domain['name']);
$xml->writeElement('rdeDom:roid', 'D' . $domain['id']); $xml->writeElement('rdeDom:roid', 'D' . $domain['id'] . '-' . $c['roid']);
$xml->writeElement('rdeDom:uName', $domain['name']); $xml->writeElement('rdeDom:uName', $domain['name']);
$xml->writeElement('rdeDom:idnTableId', 'Latn'); $xml->writeElement('rdeDom:idnTableId', 'Latn');
@ -756,7 +756,7 @@ try {
$xml->startElement('rdeRegistrar:registrar'); $xml->startElement('rdeRegistrar:registrar');
foreach ($registrars as $registrar) { foreach ($registrars as $registrar) {
$xml->writeElement('rdeRegistrar:id', $registrar['clid']); $xml->writeElement('rdeRegistrar:id', $registrar['id']);
$xml->writeElement('rdeRegistrar:name', $registrar['name']); $xml->writeElement('rdeRegistrar:name', $registrar['name']);
$xml->writeElement('rdeRegistrar:gurid', $registrar['iana_id']); $xml->writeElement('rdeRegistrar:gurid', $registrar['iana_id']);
$xml->writeElement('rdeRegistrar:status', 'ok'); $xml->writeElement('rdeRegistrar:status', 'ok');

View file

@ -64,7 +64,7 @@ function processContactInfo($conn, $db, $xml, $trans) {
'resultCode' => 1000, 'resultCode' => 1000,
'msg' => 'Command completed successfully', 'msg' => 'Command completed successfully',
'id' => $contact['id'], 'id' => $contact['id'],
'roid' => 'C' . $contact['identifier'], 'roid' => 'C' . $contact['id'],
'status' => $statusArray, 'status' => $statusArray,
'postal' => $postalArray, 'postal' => $postalArray,
'voice' => $contact['voice'], 'voice' => $contact['voice'],
@ -82,7 +82,7 @@ function processContactInfo($conn, $db, $xml, $trans) {
$epp = new EPP\EppWriter(); $epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response); $xml = $epp->epp_writer($response);
updateTransaction($db, 'info', 'contact', 'C_'.$contact['identifier'], 1000, 'Command completed successfully', $svTRID, $xml, $trans); updateTransaction($db, 'info', 'contact', 'C_'.$contact['id'], 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml); sendEppResponse($conn, $xml);
} catch (PDOException $e) { } catch (PDOException $e) {

View file

@ -44,7 +44,7 @@ function setupLogger($logFilePath, $channelName = 'app') {
function mapContactToVCard($contactDetails, $role, $c) { function mapContactToVCard($contactDetails, $role, $c) {
return [ return [
'objectClassName' => 'entity', 'objectClassName' => 'entity',
'handle' => ['C' . $contactDetails['identifier'] . '-' . $c['roid']], 'handle' => ['C' . $contactDetails['id'] . '-' . $c['roid']],
'roles' => [$role], 'roles' => [$role],
'remarks' => [ 'remarks' => [
[ [

View file

@ -416,7 +416,7 @@ function handleDomainQuery($request, $response, $pdo, $domainName, $c, $log) {
$registrarAbuseDetails = $stmt3a->fetch(PDO::FETCH_ASSOC); $registrarAbuseDetails = $stmt3a->fetch(PDO::FETCH_ASSOC);
// Query 4: Get registrant details // Query 4: Get registrant details
$stmt4 = $pdo->prepare("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.voice_x,contact.fax,contact.fax_x,contact.email FROM contact,contact_postalInfo WHERE contact.id=:registrant AND contact_postalInfo.contact_id=contact.id"); $stmt4 = $pdo->prepare("SELECT contact.id,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.voice_x,contact.fax,contact.fax_x,contact.email FROM contact,contact_postalInfo WHERE contact.id=:registrant AND contact_postalInfo.contact_id=contact.id");
$stmt4->bindParam(':registrant', $domainDetails['registrant'], PDO::PARAM_INT); $stmt4->bindParam(':registrant', $domainDetails['registrant'], PDO::PARAM_INT);
$stmt4->execute(); $stmt4->execute();
$registrantDetails = $stmt4->fetch(PDO::FETCH_ASSOC); $registrantDetails = $stmt4->fetch(PDO::FETCH_ASSOC);
@ -432,7 +432,7 @@ function handleDomainQuery($request, $response, $pdo, $domainName, $c, $log) {
$billingDetails = []; $billingDetails = [];
foreach ($contactMap as $map) { foreach ($contactMap as $map) {
$stmtDetails = $pdo->prepare("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.voice_x, contact.fax, contact.fax_x, contact.email FROM contact, contact_postalInfo WHERE contact.id = :contact_id AND contact_postalInfo.contact_id = contact.id"); $stmtDetails = $pdo->prepare("SELECT contact.id, 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.voice_x, contact.fax, contact.fax_x, contact.email FROM contact, contact_postalInfo WHERE contact.id = :contact_id AND contact_postalInfo.contact_id = contact.id");
$stmtDetails->bindParam(':contact_id', $map['contact_id'], PDO::PARAM_INT); $stmtDetails->bindParam(':contact_id', $map['contact_id'], PDO::PARAM_INT);
$stmtDetails->execute(); $stmtDetails->execute();

View file

@ -235,7 +235,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) use ($c, $pool
$res .= "\nDomain Status: ok https://icann.org/epp#ok"; $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 $query5 = "SELECT contact.id,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
FROM contact,contact_postalInfo WHERE contact.id=:registrant AND contact_postalInfo.contact_id=contact.id"; FROM contact,contact_postalInfo WHERE contact.id=:registrant AND contact_postalInfo.contact_id=contact.id";
$stmt5 = $pdo->prepare($query5); $stmt5 = $pdo->prepare($query5);
$stmt5->bindParam(':registrant', $f['registrant'], PDO::PARAM_INT); $stmt5->bindParam(':registrant', $f['registrant'], PDO::PARAM_INT);
@ -257,7 +257,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) use ($c, $pool
."\nRegistrant Fax: REDACTED FOR PRIVACY" ."\nRegistrant Fax: REDACTED FOR PRIVACY"
."\nRegistrant Email: Kindly refer to the RDDS server associated with the identified registrar in this output to obtain contact details for the Registrant, Admin, or Tech associated with the queried domain name."; ."\nRegistrant Email: Kindly refer to the RDDS server associated with the identified registrar in this output to obtain contact details for the Registrant, Admin, or Tech associated with the queried domain name.";
} else { } else {
$res .= "\nRegistry Registrant ID: C".$f2['identifier']."-".$c['roid'] $res .= "\nRegistry Registrant ID: C".$f2['id']."-".$c['roid']
."\nRegistrant Name: ".$f2['name'] ."\nRegistrant Name: ".$f2['name']
."\nRegistrant Organization: ".$f2['org'] ."\nRegistrant Organization: ".$f2['org']
."\nRegistrant Street: ".$f2['street1'] ."\nRegistrant Street: ".$f2['street1']
@ -272,7 +272,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) use ($c, $pool
."\nRegistrant Email: ".$f2['email']; ."\nRegistrant Email: ".$f2['email'];
} }
$query6 = "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 $query6 = "SELECT contact.id,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
FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='admin' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id"; FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='admin' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id";
$stmt6 = $pdo->prepare($query6); $stmt6 = $pdo->prepare($query6);
$stmt6->bindParam(':domain_id', $f['id'], PDO::PARAM_INT); $stmt6->bindParam(':domain_id', $f['id'], PDO::PARAM_INT);
@ -294,8 +294,8 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) use ($c, $pool
."\nAdmin Fax: REDACTED FOR PRIVACY" ."\nAdmin Fax: REDACTED FOR PRIVACY"
."\nAdmin Email: Kindly refer to the RDDS server associated with the identified registrar in this output to obtain contact details for the Registrant, Admin, or Tech associated with the queried domain name."; ."\nAdmin Email: Kindly refer to the RDDS server associated with the identified registrar in this output to obtain contact details for the Registrant, Admin, or Tech associated with the queried domain name.";
} else { } else {
if (!empty($f2['identifier'])) { if (!empty($f2['id'])) {
$res .= "\nRegistry Admin ID: C" . $f2['identifier'] . "-" . $c['roid']; $res .= "\nRegistry Admin ID: C" . $f2['id'] . "-" . $c['roid'];
} else { } else {
$res .= "\nRegistry Admin ID:"; $res .= "\nRegistry Admin ID:";
} }
@ -313,7 +313,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) use ($c, $pool
."\nAdmin Email: ".$f2['email']; ."\nAdmin Email: ".$f2['email'];
} }
$query7 = "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 $query7 = "SELECT contact.id,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
FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='billing' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id"; FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='billing' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id";
$stmt7 = $pdo->prepare($query7); $stmt7 = $pdo->prepare($query7);
$stmt7->bindParam(':domain_id', $f['id'], PDO::PARAM_INT); $stmt7->bindParam(':domain_id', $f['id'], PDO::PARAM_INT);
@ -335,8 +335,8 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) use ($c, $pool
."\nBilling Fax: REDACTED FOR PRIVACY" ."\nBilling Fax: REDACTED FOR PRIVACY"
."\nBilling Email: Kindly refer to the RDDS server associated with the identified registrar in this output to obtain contact details for the Registrant, Admin, or Tech associated with the queried domain name."; ."\nBilling Email: Kindly refer to the RDDS server associated with the identified registrar in this output to obtain contact details for the Registrant, Admin, or Tech associated with the queried domain name.";
} else { } else {
if (!empty($f2['identifier'])) { if (!empty($f2['id'])) {
$res .= "\nRegistry Billing ID: C" . $f2['identifier'] . "-" . $c['roid']; $res .= "\nRegistry Billing ID: C" . $f2['id'] . "-" . $c['roid'];
} else { } else {
$res .= "\nRegistry Billing ID:"; $res .= "\nRegistry Billing ID:";
} }
@ -354,7 +354,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) use ($c, $pool
."\nBilling Email: ".$f2['email']; ."\nBilling Email: ".$f2['email'];
} }
$query8 = "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 $query8 = "SELECT contact.id,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
FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='tech' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id"; FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='tech' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id";
$stmt8 = $pdo->prepare($query8); $stmt8 = $pdo->prepare($query8);
$stmt8->bindParam(':domain_id', $f['id'], PDO::PARAM_INT); $stmt8->bindParam(':domain_id', $f['id'], PDO::PARAM_INT);
@ -376,8 +376,8 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) use ($c, $pool
."\nTech Fax: REDACTED FOR PRIVACY" ."\nTech Fax: REDACTED FOR PRIVACY"
."\nTech Email: Kindly refer to the RDDS server associated with the identified registrar in this output to obtain contact details for the Registrant, Admin, or Tech associated with the queried domain name."; ."\nTech Email: Kindly refer to the RDDS server associated with the identified registrar in this output to obtain contact details for the Registrant, Admin, or Tech associated with the queried domain name.";
} else { } else {
if (!empty($f2['identifier'])) { if (!empty($f2['id'])) {
$res .= "\nRegistry Tech ID: C" . $f2['identifier'] . "-" . $c['roid']; $res .= "\nRegistry Tech ID: C" . $f2['id'] . "-" . $c['roid'];
} else { } else {
$res .= "\nRegistry Tech ID:"; $res .= "\nRegistry Tech ID:";
} }