mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-15 00:56:59 +02:00
Fixed #43
This commit is contained in:
parent
bd5ada89b9
commit
d5be4841f5
2 changed files with 23 additions and 1 deletions
|
@ -902,7 +902,7 @@ class EppWriter {
|
||||||
$writer->endElement(); // End of 'resData'
|
$writer->endElement(); // End of 'resData'
|
||||||
|
|
||||||
// Begin the extension part if any of the extensions are present
|
// Begin the extension part if any of the extensions are present
|
||||||
if (isset($resp['rgpstatus']) || isset($resp['secDNS']) || isset($resp['launch_phase'])) {
|
if (isset($resp['rgpstatus']) || isset($resp['secDNS']) || isset($resp['launch_phase'] || isset($resp['allocation'])) {
|
||||||
$writer->startElement('extension');
|
$writer->startElement('extension');
|
||||||
|
|
||||||
// Handle RGP status
|
// Handle RGP status
|
||||||
|
@ -979,6 +979,14 @@ class EppWriter {
|
||||||
$writer->endElement(); // End of 'launch:infData'
|
$writer->endElement(); // End of 'launch:infData'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle Allocation Token
|
||||||
|
if (isset($resp['allocation'])) {
|
||||||
|
$writer->startElement('allocationToken:allocationToken');
|
||||||
|
$writer->writeAttribute('xmlns:allocationToken', 'urn:ietf:params:xml:ns:allocationToken-1.0');
|
||||||
|
$writer->text($resp['allocation']);
|
||||||
|
$writer->endElement(); // End of 'allocationToken:allocationToken'
|
||||||
|
}
|
||||||
|
|
||||||
$writer->endElement(); // End of 'extension'
|
$writer->endElement(); // End of 'extension'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,6 +175,7 @@ function processDomainInfo($conn, $db, $xml, $trans) {
|
||||||
$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;
|
||||||
|
$allocation_token = $xml->xpath('//allocationToken:info')[0] ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $xml->xpath('//domain:authInfo/domain:pw[1]');
|
$result = $xml->xpath('//domain:authInfo/domain:pw[1]');
|
||||||
|
@ -476,6 +477,19 @@ function processDomainInfo($conn, $db, $xml, $trans) {
|
||||||
$response['rgpstatus'] = $rgpstatus;
|
$response['rgpstatus'] = $rgpstatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($allocation_token !== null) {
|
||||||
|
$stmt = $db->prepare("SELECT token FROM allocation_tokens WHERE domain_name = :domainName LIMIT 1");
|
||||||
|
$stmt->bindParam(':domainName', $domainName, PDO::PARAM_STR);
|
||||||
|
$stmt->execute();
|
||||||
|
$token = $stmt->fetchColumn();
|
||||||
|
|
||||||
|
if ($token) {
|
||||||
|
$response['allocation'] = $token;
|
||||||
|
} else {
|
||||||
|
$response['allocation'] = 'ERROR';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue