diff --git a/epp/src/epp-create.php b/epp/src/epp-create.php index aaa3b3d..3e074cb 100644 --- a/epp/src/epp-create.php +++ b/epp/src/epp-create.php @@ -1,6 +1,6 @@ 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); } \ No newline at end of file diff --git a/epp/src/epp-delete.php b/epp/src/epp-delete.php index 73f402c..d3d27d8 100644 --- a/epp/src/epp-delete.php +++ b/epp/src/epp-delete.php @@ -1,6 +1,6 @@ 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); } \ No newline at end of file diff --git a/epp/src/epp-poll.php b/epp/src/epp-poll.php index a97c953..7abc6b5 100644 --- a/epp/src/epp-poll.php +++ b/epp/src/epp-poll.php @@ -1,6 +1,6 @@ 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); } \ No newline at end of file diff --git a/epp/src/epp-renew.php b/epp/src/epp-renew.php index 4148db0..7372eb2 100644 --- a/epp/src/epp-renew.php +++ b/epp/src/epp-renew.php @@ -1,6 +1,6 @@ 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); } \ No newline at end of file diff --git a/epp/src/epp-transfer.php b/epp/src/epp-transfer.php index ce50539..7f7c81c 100644 --- a/epp/src/epp-transfer.php +++ b/epp/src/epp-transfer.php @@ -1,6 +1,6 @@ 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); } } diff --git a/epp/src/epp-update.php b/epp/src/epp-update.php index 7797f3a..99c0f27 100644 --- a/epp/src/epp-update.php +++ b/epp/src/epp-update.php @@ -1,6 +1,6 @@ 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); } \ No newline at end of file diff --git a/epp/start.php b/epp/start.php index f0beb41..d334c7a 100644 --- a/epp/start.php +++ b/epp/start.php @@ -158,7 +158,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) { sendEppError($conn, 2202, 'Authorization error', $clTRID); $conn->close(); } - processPoll($conn, $db, $xml, $data['clid']); + processPoll($conn, $db, $xml, $data['clid'], $trans); break; } @@ -188,7 +188,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) { sendEppError($conn, 2202, 'Authorization error', $clTRID); $conn->close(); } - processContactCreate($conn, $db, $xml, $data['clid'], $c['db_type']); + processContactCreate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans); break; } @@ -218,7 +218,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) { sendEppError($conn, 2202, 'Authorization error', $clTRID); $conn->close(); } - processContactUpdate($conn, $db, $xml, $data['clid'], $c['db_type']); + processContactUpdate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans); break; } @@ -233,7 +233,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) { sendEppError($conn, 2202, 'Authorization error', $clTRID); $conn->close(); } - processContactDelete($conn, $db, $xml, $data['clid'], $c['db_type']); + processContactDelete($conn, $db, $xml, $data['clid'], $c['db_type'], $trans); break; } @@ -248,7 +248,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) { sendEppError($conn, 2202, 'Authorization error', $clTRID); $conn->close(); } - processContactTransfer($conn, $db, $xml, $data['clid'], $c['db_type']); + processContactTransfer($conn, $db, $xml, $data['clid'], $c['db_type'], $trans); break; } @@ -293,7 +293,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) { sendEppError($conn, 2202, 'Authorization error', $clTRID); $conn->close(); } - processDomainUpdate($conn, $db, $xml, $data['clid'], $c['db_type']); + processDomainUpdate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans); break; } @@ -308,7 +308,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) { sendEppError($conn, 2202, 'Authorization error', $clTRID); $conn->close(); } - processDomainCreate($conn, $db, $xml, $data['clid'], $c['db_type']); + processDomainCreate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans); break; } @@ -323,7 +323,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) { sendEppError($conn, 2202, 'Authorization error', $clTRID); $conn->close(); } - processDomainDelete($conn, $db, $xml, $data['clid'], $c['db_type']); + processDomainDelete($conn, $db, $xml, $data['clid'], $c['db_type'], $trans); break; } @@ -338,7 +338,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) { sendEppError($conn, 2202, 'Authorization error', $clTRID); $conn->close(); } - processDomainTransfer($conn, $db, $xml, $data['clid'], $c['db_type']); + processDomainTransfer($conn, $db, $xml, $data['clid'], $c['db_type'], $trans); break; } @@ -368,7 +368,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) { sendEppError($conn, 2202, 'Authorization error', $clTRID); $conn->close(); } - processHostCreate($conn, $db, $xml, $data['clid'], $c['db_type']); + processHostCreate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans); break; } @@ -398,7 +398,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) { sendEppError($conn, 2202, 'Authorization error', $clTRID); $conn->close(); } - processHostUpdate($conn, $db, $xml, $data['clid'], $c['db_type']); + processHostUpdate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans); break; } @@ -413,7 +413,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) { sendEppError($conn, 2202, 'Authorization error', $clTRID); $conn->close(); } - processHostDelete($conn, $db, $xml, $data['clid'], $c['db_type']); + processHostDelete($conn, $db, $xml, $data['clid'], $c['db_type'], $trans); break; } @@ -443,7 +443,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) { sendEppError($conn, 2202, 'Authorization error', $clTRID); $conn->close(); } - processDomainRenew($conn, $db, $xml, $data['clid'], $c['db_type']); + processDomainRenew($conn, $db, $xml, $data['clid'], $c['db_type'], $trans); break; }