Added EPP transaction log for all successful commands

Fixed #13
This commit is contained in:
Pinga 2023-08-25 17:28:03 +03:00
parent c6ab5572ca
commit 5c0ffbe60f
7 changed files with 95 additions and 55 deletions

View file

@ -1,6 +1,6 @@
<?php
function processContactCreate($conn, $db, $xml, $clid, $database_type) {
function processContactCreate($conn, $db, $xml, $clid, $database_type, $trans) {
$contactID = (string) $xml->command->create->children('urn:ietf:params:xml:ns:contact-1.0')->create->{'id'};
$clTRID = (string) $xml->command->clTRID;
@ -374,6 +374,7 @@ function processContactCreate($conn, $db, $xml, $clid, $database_type) {
return;
}
$svTRID = generateSvTRID();
$response = [
'command' => 'create_contact',
'resultCode' => 1000,
@ -382,15 +383,16 @@ function processContactCreate($conn, $db, $xml, $clid, $database_type) {
'id' => $identifier,
'crDate' => $crdate,
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'create', 'contact', $identifier, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}
function processHostCreate($conn, $db, $xml, $clid, $database_type) {
function processHostCreate($conn, $db, $xml, $clid, $database_type, $trans) {
$hostName = $xml->command->create->children('urn:ietf:params:xml:ns:host-1.0')->create->name;
$clTRID = (string) $xml->command->clTRID;
@ -515,6 +517,7 @@ function processHostCreate($conn, $db, $xml, $clid, $database_type) {
$stmt->execute([$hostName]);
$crdate = $stmt->fetchColumn();
$svTRID = generateSvTRID();
$response = [
'command' => 'create_host',
'resultCode' => 1000,
@ -523,15 +526,15 @@ function processHostCreate($conn, $db, $xml, $clid, $database_type) {
'name' => $hostName,
'crDate' => $crdate,
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'create', 'host', $hostName, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
} else {
$stmt = $db->prepare("INSERT INTO host (name,clid,crid,crdate) VALUES(?,?,?,CURRENT_TIMESTAMP)");
$stmt->execute([$hostName, $clid, $clid]);
@ -541,6 +544,7 @@ function processHostCreate($conn, $db, $xml, $clid, $database_type) {
$stmt->execute([$hostName]);
$crdate = $stmt->fetchColumn();
$svTRID = generateSvTRID();
$response = [
'command' => 'create_host',
'resultCode' => 1000,
@ -549,17 +553,18 @@ function processHostCreate($conn, $db, $xml, $clid, $database_type) {
'name' => $hostName,
'crDate' => $crdate,
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'create', 'host', $hostName, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}
}
function processDomainCreate($conn, $db, $xml, $clid, $database_type) {
function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
$domainName = $xml->command->create->children('urn:ietf:params:xml:ns:domain-1.0')->create->name;
$clTRID = (string) $xml->command->clTRID;
@ -1190,6 +1195,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type) {
}
$db->exec("UPDATE `statistics` SET `created_domains` = `created_domains` + 1 WHERE `date` = CURDATE()");
$svTRID = generateSvTRID();
$response = [
'command' => 'create_domain',
'resultCode' => 1000,
@ -1199,10 +1205,11 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type) {
'crDate' => $crdate,
'exDate' => $exdate,
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'create', 'domain', $domainName, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}

View file

@ -1,6 +1,6 @@
<?php
function processContactDelete($conn, $db, $xml, $clid, $database_type) {
function processContactDelete($conn, $db, $xml, $clid, $database_type, $trans) {
$contactID = (string) $xml->command->delete->children('urn:ietf:params:xml:ns:contact-1.0')->delete->{'id'};
$clTRID = (string) $xml->command->clTRID;
@ -73,21 +73,23 @@ function processContactDelete($conn, $db, $xml, $clid, $database_type) {
return;
}
$svTRID = generateSvTRID();
$response = [
'command' => 'delete_contact',
'resultCode' => 1000,
'lang' => 'en-US',
'message' => 'Command completed successfully',
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'delete', 'contact', $contact_id, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}
function processHostDelete($conn, $db, $xml, $clid, $database_type) {
function processHostDelete($conn, $db, $xml, $clid, $database_type, $trans) {
$hostName = $xml->command->delete->children('urn:ietf:params:xml:ns:host-1.0')->delete->name;
$clTRID = (string) $xml->command->clTRID;
@ -147,21 +149,23 @@ function processHostDelete($conn, $db, $xml, $clid, $database_type) {
return;
}
$svTRID = generateSvTRID();
$response = [
'command' => 'delete_host',
'resultCode' => 1000,
'lang' => 'en-US',
'message' => 'Command completed successfully',
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'delete', 'host', $host_id, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}
function processDomainDelete($conn, $db, $xml, $clid, $database_type) {
function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) {
$domainName = $xml->command->delete->children('urn:ietf:params:xml:ns:domain-1.0')->delete->name;
$clTRID = (string) $xml->command->clTRID;
@ -378,16 +382,18 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type) {
}
}
$svTRID = generateSvTRID();
$response = [
'command' => 'delete_domain',
'resultCode' => 1001,
'lang' => 'en-US',
'message' => 'Command completed successfully; action pending',
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'delete', 'domain', $domainName, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}

View file

@ -1,6 +1,6 @@
<?php
function processPoll($conn, $db, $xml, $clid) {
function processPoll($conn, $db, $xml, $clid, $trans) {
$clTRID = (string) $xml->command->clTRID;
$node = $xml->command->poll;
$op = (string) $node['op'];
@ -28,16 +28,18 @@ function processPoll($conn, $db, $xml, $clid) {
}
if ((int) $response['resultCode'] === 1300) {
$svTRID = generateSvTRID();
$response = [
'command' => 'poll',
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
'resultCode' => $response['resultCode'],
'msg' => 'Command completed successfully; no messages',
];
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'poll', null, null, $response['resultCode'], 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
return;
}
@ -90,5 +92,6 @@ function processPoll($conn, $db, $xml, $clid) {
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'poll', null, $response['id'], $response['resultCode'], 'Command completed successfully', $response['svTRID'], $xml, $trans);
sendEppResponse($conn, $xml);
}

View file

@ -1,6 +1,6 @@
<?php
function processDomainRenew($conn, $db, $xml, $clid, $database_type) {
function processDomainRenew($conn, $db, $xml, $clid, $database_type, $trans) {
$domainName = (string) $xml->command->renew->children('urn:ietf:params:xml:ns:domain-1.0')->renew->name;
$curExpDate = (string) $xml->command->renew->children('urn:ietf:params:xml:ns:domain-1.0')->renew->curExpDate;
$periodElements = $xml->xpath("//domain:renew/domain:period");
@ -187,6 +187,7 @@ function processDomainRenew($conn, $db, $xml, $clid, $database_type) {
$stmt = $db->prepare("UPDATE statistics SET renewed_domains = renewed_domains + 1 WHERE date = CURDATE()");
$stmt->execute();
$svTRID = generateSvTRID();
$response = [
'command' => 'renew_domain',
'resultCode' => 1000,
@ -195,10 +196,11 @@ function processDomainRenew($conn, $db, $xml, $clid, $database_type) {
'name' => $domainName,
'exDate' => $exdateUpdated,
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'renew', 'domain', $domainName, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}

View file

@ -1,6 +1,6 @@
<?php
function processContactTranfer($conn, $db, $xml, $clid, $database_type) {
function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans) {
$contactID = (string) $xml->command->transfer->children('urn:ietf:params:xml:ns:contact-1.0')->transfer->{'id'};
$clTRID = (string) $xml->command->clTRID;
$op = (string) $xml->xpath('//@op')[0] ?? null;
@ -82,6 +82,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type) {
$acid_identifier_stmt->execute([':acid' => $updatedContactInfo['acid']]);
$acid_identifier = $acid_identifier_stmt->fetchColumn();
$svTRID = generateSvTRID();
$response = [
'command' => 'transfer_contact',
'resultCode' => 1000,
@ -94,11 +95,12 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type) {
'acID' => $acid_identifier,
'acDate' => $updatedContactInfo['acdate'],
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'transfer', 'contact', $identifier, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}
} else {
@ -147,6 +149,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type) {
$acid_identifier_stmt->execute([':acid' => $updatedContactInfo['acid']]);
$acid_identifier = $acid_identifier_stmt->fetchColumn();
$svTRID = generateSvTRID();
$response = [
'command' => 'transfer_contact',
'resultCode' => 1000,
@ -159,11 +162,12 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type) {
'acID' => $acid_identifier,
'acDate' => $updatedContactInfo['acdate'],
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'transfer', 'contact', $identifier, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}
} else {
@ -185,6 +189,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type) {
$acid_identifier_stmt->execute([':acid' => $contactInfo['acid']]);
$acid_identifier = $acid_identifier_stmt->fetchColumn();
$svTRID = generateSvTRID();
$response = [
'command' => 'transfer_contact',
'resultCode' => 1000,
@ -197,11 +202,12 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type) {
'acID' => $acid_identifier,
'acDate' => $contactInfo['acdate'],
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'transfer', 'contact', $identifier, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
} else {
sendEppError($conn, 2301, 'Command failed because the contact is NOT pending transfer', $clTRID);
@ -252,6 +258,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type) {
$acidStmt->execute([':acid' => $contactInfo['acid']]);
$acid_identifier = $acidStmt->fetchColumn();
$svTRID = generateSvTRID();
$response = [
'command' => 'transfer_contact',
'resultCode' => 1000,
@ -264,11 +271,12 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type) {
'acID' => $acid_identifier,
'acDate' => $contactInfo['acdate'],
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'transfer', 'contact', $identifier, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}
} else {
@ -359,6 +367,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type) {
':acdate' => str_replace(" ", "T", $result['acdate']) . '.0Z'
]);
$svTRID = generateSvTRID();
$response = [
'command' => 'transfer_contact',
'resultCode' => 1000,
@ -371,11 +380,12 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type) {
'acID' => $acid_identifier,
'acDate' => $result['acdate'],
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'transfer', 'contact', $identifier, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}
} elseif ($op == 'pending') {
@ -389,7 +399,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type) {
}
}
function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans) {
$domainName = (string) $xml->command->transfer->children('urn:ietf:params:xml:ns:domain-1.0')->transfer->name;
$clTRID = (string) $xml->command->clTRID;
$op = (string) $xml->xpath('//@op')[0] ?? null;
@ -488,7 +498,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
$to = $stmt->fetchColumn();
$stmt = $db->prepare("INSERT INTO `statement` (`registrar_id`,`date`,`command`,`domain_name`,`length_in_months`,`from`,`to`,`amount`) VALUES(:registrar_id, CURRENT_TIMESTAMP, :command, :domain_name, :length_in_months, :from, :to, :amount)");
$stmt->execute(['registrar_id' => $reid, 'command' => $blob["cmd"], 'domain_name' => $domainName, 'length_in_months' => $date_add, 'from' => $from, 'to' => $to, 'amount' => $price]);
$stmt->execute(['registrar_id' => $reid, 'command' => 'transfer', 'domain_name' => $domainName, 'length_in_months' => $date_add, 'from' => $from, 'to' => $to, 'amount' => $price]);
$stmt = $db->prepare("SELECT `id`,`registrant`,`crdate`,`exdate`,`update`,`clid`,`crid`,`upid`,`trdate`,`trstatus`,`reid`,`redate`,`acid`,`acdate`,`transfer_exdate` FROM `domain` WHERE `name` = :name LIMIT 1");
$stmt->execute(['name' => $domainName]);
@ -515,6 +525,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
$stmt = $db->prepare("UPDATE `statistics` SET `transfered_domains` = `transfered_domains` + 1 WHERE `date` = CURDATE()");
$stmt->execute();
$svTRID = generateSvTRID();
$response = [
'command' => 'transfer_domain',
'resultCode' => 1000,
@ -527,7 +538,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
'acID' => $acid_identifier,
'acDate' => $acdate,
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
if ($transfer_exdate) {
@ -536,6 +547,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'transfer', 'domain', $domainName, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}
} else {
@ -587,6 +599,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
$stmt->execute(['acid' => $acid]);
$acid_identifier = $stmt->fetchColumn();
$svTRID = generateSvTRID();
$response = [
'command' => 'transfer_domain',
'resultCode' => 1000,
@ -599,7 +612,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
'acID' => $acid_identifier,
'acDate' => $acdate,
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
if ($transfer_exdate) {
@ -608,6 +621,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'transfer', 'domain', $domainName, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}
} else {
@ -633,6 +647,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
$stmtAcID->execute(['acid' => $acid]);
$acid_identifier = $stmtAcID->fetchColumn();
$svTRID = generateSvTRID();
$response = [
'command' => 'transfer_domain',
'resultCode' => 1000,
@ -645,7 +660,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
'acID' => $acid_identifier,
'acDate' => $acdate,
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
if ($transfer_exdate) {
@ -654,16 +669,12 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'transfer', 'domain', $domainName, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
} else {
sendEppError($conn, 2301, 'The domain is NOT pending transfer', $clTRID);
return;
}
$msg = epp_writer($blob);
echo $msg;
$uptr = update_transaction($msg);
exit;
}
elseif ($op === 'reject') {
@ -704,6 +715,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
$stmtAcID->execute(['acid' => $acid]);
$acid_identifier = $stmtAcID->fetchColumn();
$svTRID = generateSvTRID();
$response = [
'command' => 'transfer_domain',
'resultCode' => 1000,
@ -716,7 +728,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
'acID' => $acid_identifier,
'acDate' => $acdate,
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
if ($transfer_exdate) {
@ -725,6 +737,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'transfer', 'domain', $domainName, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}
} else {
@ -893,6 +906,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
':transfer_exdate' => $transfer_exdate
]);
$svTRID = generateSvTRID();
$response = [
'command' => 'transfer_domain',
'resultCode' => 1001,
@ -905,7 +919,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
'acID' => $acid_identifier,
'acDate' => $acdate,
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
if ($transfer_exdate) {
@ -914,6 +928,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'transfer', 'domain', $domainName, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}
} else {
@ -979,6 +994,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type) {
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'transfer', 'domain', $domainName, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}
}

View file

@ -1,6 +1,6 @@
<?php
function processContactUpdate($conn, $db, $xml, $clid, $database_type) {
function processContactUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
$contactID = (string) $xml->command->update->children('urn:ietf:params:xml:ns:contact-1.0')->update->{'id'};
$clTRID = (string) $xml->command->clTRID;
@ -604,21 +604,23 @@ function processContactUpdate($conn, $db, $xml, $clid, $database_type) {
}
}
$svTRID = generateSvTRID();
$response = [
'command' => 'update_contact',
'resultCode' => 1000,
'lang' => 'en-US',
'message' => 'Command completed successfully',
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'update', 'contact', $contact_id, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}
function processHostUpdate($conn, $db, $xml, $clid, $database_type) {
function processHostUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
$name = (string) $xml->command->update->children('urn:ietf:params:xml:ns:host-1.0')->update->name;
$clTRID = (string) $xml->command->clTRID;
@ -915,21 +917,23 @@ function processHostUpdate($conn, $db, $xml, $clid, $database_type) {
$stmt->execute([$chg_name, $name]);
}
$svTRID = generateSvTRID();
$response = [
'command' => 'update_host',
'resultCode' => 1000,
'lang' => 'en-US',
'message' => 'Command completed successfully',
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'update', 'host', $hostId, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}
function processDomainUpdate($conn, $db, $xml, $clid, $database_type) {
function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
$domainName = (string) $xml->command->update->children('urn:ietf:params:xml:ns:domain-1.0')->update->name;
$clTRID = (string) $xml->command->clTRID;
@ -1726,17 +1730,19 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type) {
}
}
$svTRID = generateSvTRID();
$response = [
'command' => 'update_domain',
'resultCode' => 1000,
'lang' => 'en-US',
'message' => 'Command completed successfully',
'clTRID' => $clTRID,
'svTRID' => generateSvTRID(),
'svTRID' => $svTRID,
];
$epp = new EPP\EppWriter();
$xml = $epp->epp_writer($response);
updateTransaction($db, 'update', 'domain', $domainName, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
sendEppResponse($conn, $xml);
}