Preparation for launch:info

This commit is contained in:
Pinga 2023-12-21 09:11:51 +02:00
parent 7e34dd7501
commit e7e1b61c8a

View file

@ -171,7 +171,7 @@ function processHostInfo($conn, $db, $xml, $trans) {
function processDomainInfo($conn, $db, $xml, $trans) { function processDomainInfo($conn, $db, $xml, $trans) {
$domainName = $xml->command->info->children('urn:ietf:params:xml:ns:domain-1.0')->info->name; $domainName = $xml->command->info->children('urn:ietf:params:xml:ns:domain-1.0')->info->name;
$clTRID = (string) $xml->command->clTRID; $clTRID = (string) $xml->command->clTRID;
$extensionNode = $xml->command->extension; $extensionNode = $xml->command->extension;
if (isset($extensionNode)) { if (isset($extensionNode)) {
$launch_info = $xml->xpath('//launch:info')[0] ?? null; $launch_info = $xml->xpath('//launch:info')[0] ?? null;
@ -196,6 +196,23 @@ function processDomainInfo($conn, $db, $xml, $trans) {
return; return;
} }
if (isset($launch_info)) {
$phaseType = (string) $launch_info->children('urn:ietf:params:xml:ns:launch-1.0')->phase;
// Get the <launch:applicationID> element if it exists
$applicationIDElement = $launch_info->children('urn:ietf:params:xml:ns:launch-1.0')->applicationID;
// Check if the <launch:applicationID> element is present and set the variable accordingly
$applicationID = isset($applicationIDElement) ? (string) $applicationIDElement : null;
// Get the attributes of the <launch:info> node
$attributes = $launch_info->attributes('launch', true);
$includeMark = (string) ($attributes->includeMark ?? 'false');
// Check if includeMark is 'true'
$includeMarkBool = strtolower($includeMark) === 'true';
}
try { try {
$stmt = $db->prepare("SELECT * FROM domain WHERE name = :name"); $stmt = $db->prepare("SELECT * FROM domain WHERE name = :name");
$stmt->execute(['name' => $domainName]); $stmt->execute(['name' => $domainName]);
@ -302,7 +319,7 @@ function processDomainInfo($conn, $db, $xml, $trans) {
// Fetch RGP status // Fetch RGP status
$rgpstatus = isset($domain['rgpstatus']) && $domain['rgpstatus'] ? $domain['rgpstatus'] : null; $rgpstatus = isset($domain['rgpstatus']) && $domain['rgpstatus'] ? $domain['rgpstatus'] : null;
$svTRID = generateSvTRID(); $svTRID = generateSvTRID();
$response = [ $response = [
'command' => 'info_domain', 'command' => 'info_domain',
@ -357,7 +374,7 @@ function processDomainInfo($conn, $db, $xml, $trans) {
if ($rgpstatus) { if ($rgpstatus) {
$response['rgpstatus'] = $rgpstatus; $response['rgpstatus'] = $rgpstatus;
} }
$epp = new EPP\EppWriter(); $epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response); $xml = $epp->epp_writer($response);
updateTransaction($db, 'info', 'domain', 'D_'.$domain['id'], 1000, 'Command completed successfully', $svTRID, $xml, $trans); updateTransaction($db, 'info', 'domain', 'D_'.$domain['id'], 1000, 'Command completed successfully', $svTRID, $xml, $trans);