mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-14 16:46:59 +02:00
Small rgp update fixes
This commit is contained in:
parent
fc1d1b844f
commit
296db82d2a
2 changed files with 14 additions and 10 deletions
|
@ -940,7 +940,10 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
|||
$domainRem = $xml->xpath('//domain:rem')[0] ?? null;
|
||||
$domainAdd = $xml->xpath('//domain:add')[0] ?? null;
|
||||
$domainChg = $xml->xpath('//domain:chg')[0] ?? null;
|
||||
$extensionNode = $xml->xpath('//extension')[0] ?? null;
|
||||
$extensionNode = $xml->command->extension;
|
||||
if (isset($extensionNode)) {
|
||||
$rgp_update = $xml->xpath('//rgp:update')[0] ?? null;
|
||||
}
|
||||
|
||||
if ($domainRem === null && $domainAdd === null && $domainChg === null && $extensionNode === null) {
|
||||
sendEppError($conn, 2003, 'At least one domain:rem || domain:add || domain:chg', $clTRID);
|
||||
|
@ -1268,8 +1271,8 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
|||
}
|
||||
}
|
||||
|
||||
if (isset($rgp_update) && $rgp_update) {
|
||||
$op_attribute = $xml->xpath('rgp:restore/@op[1]')[0]->__toString();
|
||||
if (isset($rgp_update)) {
|
||||
$op_attribute = (string) $xml->xpath('//rgp:restore/@op[1]')[0];
|
||||
|
||||
if ($op_attribute === 'request') {
|
||||
$stmt = $db->prepare("SELECT COUNT(`id`) AS `ids` FROM `domain` WHERE `rgpstatus` = 'redemptionPeriod' AND `id` = :domain_id LIMIT 1");
|
||||
|
@ -1376,7 +1379,7 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
|||
}
|
||||
|
||||
foreach ($status_list as $node) {
|
||||
$status = $node->__toString();
|
||||
$status = (string) $node;
|
||||
|
||||
$stmt = $db->prepare("DELETE FROM `domain_status` WHERE `domain_id` = :domain_id AND `status` = :status");
|
||||
$stmt->bindParam(':domain_id', $domain_id, PDO::PARAM_INT);
|
||||
|
@ -1556,7 +1559,7 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
|||
}
|
||||
|
||||
foreach ($status_list as $node) {
|
||||
$status = $node->__toString();
|
||||
$status = (string) $node;
|
||||
|
||||
try {
|
||||
$stmt = $db->prepare("INSERT INTO `domain_status` (`domain_id`,`status`) VALUES(:domain_id, :status)");
|
||||
|
@ -1636,7 +1639,7 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
|||
}
|
||||
}
|
||||
|
||||
if (isset($rgp_update) && $rgp_update) {
|
||||
if (isset($rgp_update)) {
|
||||
$op_attribute = (string) $xml->xpath('//rgp:restore/@op[1]')[0];
|
||||
|
||||
if ($op_attribute == 'request') {
|
||||
|
@ -1665,11 +1668,11 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
|||
list($registrar_balance, $creditLimit) = $sth->fetch();
|
||||
|
||||
$sth = $db->prepare("SELECT `m12` FROM `domain_price` WHERE `tldid` = ? AND `command` = 'renew' LIMIT 1");
|
||||
$sth->execute([$tldid]);
|
||||
$sth->execute([$row['tldid']]);
|
||||
$renew_price = $sth->fetchColumn();
|
||||
|
||||
$sth = $db->prepare("SELECT `price` FROM `domain_restore_price` WHERE `tldid` = ? LIMIT 1");
|
||||
$sth->execute([$tldid]);
|
||||
$sth->execute([$row['tldid']]);
|
||||
$restore_price = $sth->fetchColumn();
|
||||
|
||||
if (($registrar_balance + $creditLimit) < ($renew_price + $restore_price)) {
|
||||
|
|
|
@ -75,6 +75,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
|||
$xml->registerXPathNamespace('domain', 'urn:ietf:params:xml:ns:domain-1.0');
|
||||
$xml->registerXPathNamespace('contact', 'urn:ietf:params:xml:ns:contact-1.0');
|
||||
$xml->registerXPathNamespace('host', 'urn:ietf:params:xml:ns:host-1.0');
|
||||
$xml->registerXPathNamespace('rgp', 'urn:ietf:params:xml:ns:rgp-1.0');
|
||||
$xml->registerXPathNamespace('secDNS', 'urn:ietf:params:xml:ns:secDNS-1.1');
|
||||
|
||||
if ($xml === false) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue