diff --git a/ISNICSync.php b/ISNICSync.php index 24c65b7..a784a4b 100644 --- a/ISNICSync.php +++ b/ISNICSync.php @@ -2,13 +2,13 @@ require_once "eppClient.php"; use Pinga\Tembo\eppClient; + $config = include "config.php"; $c = $config["db"]; $registrar = "ISNIC"; -try -{ +try { // Establish the PDO connection $dsn = $c["type"] . ":host=" . $c["host"] . ";port=" . $c["port"] . ";dbname=" . $c["name"]; $pdo = new PDO($dsn, $c["user"], $c["password"]); @@ -27,52 +27,42 @@ try $config = []; - foreach ($rows as $row) - { + foreach ($rows as $row) { $config = json_decode($row["config"], true); $registrar_id = $row["id"]; } - if (empty($config)) - { + if (empty($config)) { throw new Exception("Database cannot be accessed right now."); } - -} -catch(PDOException $e) -{ +} catch (PDOException $e) { echo "Database error: " . $e->getMessage(); -} -catch(Exception $e) -{ +} catch (Exception $e) { echo "General error: " . $e->getMessage(); } function connectEpp(string $registry, $config) { - try - { + try { $epp = new eppClient(); $info = [ - "host" => $config["host"], - "port" => $config["port"], "timeout" => 30, "tls" => "1.3", "bind" => false, "bindip" => "1.2.3.4:0", "verify_peer" => false, "verify_peer_name" => false, - "verify_host" => false, "cafile" => "", "local_cert" => $config["ssl_cert"], "local_pk" => $config["ssl_key"], "passphrase" => "", "allow_self_signed" => true, ]; + "host" => $config["host"], + "port" => $config["port"], "timeout" => 30, "tls" => "1.3", "bind" => false, "bindip" => "1.2.3.4:0", "verify_peer" => false, "verify_peer_name" => false, + "verify_host" => false, "cafile" => "", "local_cert" => $config["ssl_cert"], "local_pk" => $config["ssl_key"], "passphrase" => "", "allow_self_signed" => true, + ]; $epp->connect($info); - $login = $epp->login(["clID" => $config["username"], "pw" => $config["password"], - "prefix" => "tembo", ]); - if (array_key_exists("error", $login)) - { + $login = $epp->login([ + "clID" => $config["username"], "pw" => $config["password"], + "prefix" => "tembo", + ]); + if (array_key_exists("error", $login)) { echo "Login Error: " . $login["error"] . PHP_EOL; exit(); - } - else - { + } else { echo "Login Result: " . $login["code"] . ": " . $login["msg"][0] . PHP_EOL; } return $epp; - } - catch(EppException $e) - { + } catch (EppException $e) { return "Error : " . $e->getMessage(); } } @@ -83,7 +73,7 @@ try { $stmt->bindValue(':registrar', $registrar_id); $stmt->execute(); $domains = $stmt->fetchAll(PDO::FETCH_ASSOC); - + $epp = connectEpp("generic", $config); foreach ($domains as $domainRow) { @@ -97,18 +87,18 @@ try { echo "DomainInfo Error: " . $domainInfo["error"] . " (" . $domain . ")" . PHP_EOL; continue; } - + $ns = $domainInfo['ns']; $ns1 = isset($ns[1]) ? $ns[1] : null; $ns2 = isset($ns[2]) ? $ns[2] : null; $ns3 = isset($ns[3]) ? $ns[3] : null; $ns4 = isset($ns[4]) ? $ns[4] : null; - + $exDate = $domainInfo['exDate']; $datetime = new DateTime($exDate); $formattedExDate = $datetime->format('Y-m-d H:i:s'); - + $statuses = $domainInfo['status']; $clientStatuses = ['clientDeleteProhibited', 'clientTransferProhibited', 'clientUpdateProhibited']; @@ -121,9 +111,9 @@ try { $serverProhibited = count(array_intersect($serverStatuses, $statuses)) === count($serverStatuses); if ($clientProhibited || $serverProhibited) { - $locked = 1; + $locked = 1; } else { - $locked = 0; + $locked = 0; } // Prepare the UPDATE statement @@ -142,7 +132,7 @@ try { // Execute the statement $stmt->execute(); - + echo "Update successful for domain: " . $domain . PHP_EOL; } @@ -150,6 +140,6 @@ try { echo "Logout Result: " . $logout["code"] . ": " . $logout["msg"][0] . PHP_EOL; } catch (PDOException $e) { echo "Database error: " . $e->getMessage(); -} catch(EppException $e) { +} catch (EppException $e) { echo "Error: ", $e->getMessage(); } diff --git a/eppClient.php b/eppClient.php index 0de4ea9..bf4a46d 100644 --- a/eppClient.php +++ b/eppClient.php @@ -1,4 +1,5 @@ array( - 'verify_peer' => (bool)$params['verify_peer'], - 'verify_peer_name' => (bool)$params['verify_peer_name'], - 'verify_host' => (bool)$params['verify_host'], - 'cafile' => (string)$params['cafile'], - 'local_cert' => (string)$params['local_cert'], - 'local_pk' => (string)$params['local_pk'], - 'passphrase' => (string)$params['passphrase'], - 'allow_self_signed' => (bool)$params['allow_self_signed'], - 'min_tls_version' => $tls + 'verify_peer' => (bool)$params['verify_peer'], + 'verify_peer_name' => (bool)$params['verify_peer_name'], + 'verify_host' => (bool)$params['verify_host'], + 'cafile' => (string)$params['cafile'], + 'local_cert' => (string)$params['local_cert'], + 'local_pk' => (string)$params['local_pk'], + 'passphrase' => (string)$params['passphrase'], + 'allow_self_signed' => (bool)$params['allow_self_signed'], + 'min_tls_version' => $tls ) ); if ($bind) { @@ -93,18 +94,18 @@ class eppClient if (fwrite($this->resource, pack('N', (strlen($xml) + 4)) . $xml) === false) { throw new exception('Error writing to the connection.'); } - $xml_string = $this->readResponse(); - libxml_use_internal_errors(true); - - $r = simplexml_load_string($xml_string, 'SimpleXMLElement', LIBXML_DTDLOAD | LIBXML_NOENT); - if ($r instanceof SimpleXMLElement) { - $r->registerXPathNamespace('e', 'urn:ietf:params:xml:ns:epp-1.0'); - $r->registerXPathNamespace('xsi', 'http://www.w3.org/2001/XMLSchema-instance'); - $r->registerXPathNamespace('domain', 'urn:ietf:params:xml:ns:domain-1.0'); - $r->registerXPathNamespace('contact', 'urn:ietf:params:xml:ns:contact-1.0'); - $r->registerXPathNamespace('host', 'urn:ietf:params:xml:ns:host-1.0'); - $r->registerXPathNamespace('rgp', 'urn:ietf:params:xml:ns:rgp-1.0'); - } + $xml_string = $this->readResponse(); + libxml_use_internal_errors(true); + + $r = simplexml_load_string($xml_string, 'SimpleXMLElement', LIBXML_DTDLOAD | LIBXML_NOENT); + if ($r instanceof SimpleXMLElement) { + $r->registerXPathNamespace('e', 'urn:ietf:params:xml:ns:epp-1.0'); + $r->registerXPathNamespace('xsi', 'http://www.w3.org/2001/XMLSchema-instance'); + $r->registerXPathNamespace('domain', 'urn:ietf:params:xml:ns:domain-1.0'); + $r->registerXPathNamespace('contact', 'urn:ietf:params:xml:ns:contact-1.0'); + $r->registerXPathNamespace('host', 'urn:ietf:params:xml:ns:host-1.0'); + $r->registerXPathNamespace('rgp', 'urn:ietf:params:xml:ns:rgp-1.0'); + } if (isset($r->response) && $r->response->result->attributes()->code >= 2000) { throw new \exception($r->response->result->msg); } @@ -123,8 +124,8 @@ class eppClient } /** - * wrapper for functions - */ + * wrapper for functions + */ public function __call($func, $args) { if (!function_exists($func)) { @@ -168,13 +169,13 @@ class eppClient $from[] = '/{{ clID }}/'; $to[] = htmlspecialchars($params['clID']); $from[] = '/{{ pwd }}/'; - $to[] = htmlspecialchars($params['pw']); + $to[] = htmlspecialchars($params['pw']); if (isset($params['newpw']) && !empty($params['newpw'])) { - $from[] = '/{{ newpw }}/'; - $to[] = PHP_EOL . ' ' . htmlspecialchars($params['newpw']) . ''; + $from[] = '/{{ newpw }}/'; + $to[] = PHP_EOL . ' ' . htmlspecialchars($params['newpw']) . ''; } else { - $from[] = '/{{ newpw }}/'; - $to[] = ''; + $from[] = '/{{ newpw }}/'; + $to[] = ''; } $from[] = '/{{ clTRID }}/'; $microtime = str_replace('.', '', round(microtime(1), 3)); @@ -460,10 +461,10 @@ class eppClient $from = $to = array(); $from[] = '/{{ name }}/'; $to[] = htmlspecialchars($params['hostname']); - $from[] = '/{{ ip }}/'; - $to[] = htmlspecialchars($params['ipaddress']); - $from[] = '/{{ v }}/'; - $to[] = (preg_match('/:/', $params['ipaddress']) ? 'v6' : 'v4'); + $from[] = '/{{ ip }}/'; + $to[] = htmlspecialchars($params['ipaddress']); + $from[] = '/{{ v }}/'; + $to[] = (preg_match('/:/', $params['ipaddress']) ? 'v6' : 'v4'); $from[] = '/{{ clTRID }}/'; $clTRID = str_replace('.', '', round(microtime(1), 3)); $to[] = htmlspecialchars($this->prefix . '-host-create-' . $clTRID); @@ -503,7 +504,7 @@ class eppClient return $return; } - + /** * hostUpdate */ @@ -519,16 +520,16 @@ class eppClient $return = array(); try { $from = $to = array(); - $from[] = '/{{ name }}/'; - $to[] = htmlspecialchars($params['hostname']); - $from[] = '/{{ ip1 }}/'; - $to[] = htmlspecialchars($params['currentipaddress']); - $from[] = '/{{ v1 }}/'; - $to[] = (preg_match('/:/', $params['currentipaddress']) ? 'v6' : 'v4'); - $from[] = '/{{ ip2 }}/'; - $to[] = htmlspecialchars($params['newipaddress']); - $from[] = '/{{ v2 }}/'; - $to[] = (preg_match('/:/', $params['newipaddress']) ? 'v6' : 'v4'); + $from[] = '/{{ name }}/'; + $to[] = htmlspecialchars($params['hostname']); + $from[] = '/{{ ip1 }}/'; + $to[] = htmlspecialchars($params['currentipaddress']); + $from[] = '/{{ v1 }}/'; + $to[] = (preg_match('/:/', $params['currentipaddress']) ? 'v6' : 'v4'); + $from[] = '/{{ ip2 }}/'; + $to[] = htmlspecialchars($params['newipaddress']); + $from[] = '/{{ v2 }}/'; + $to[] = (preg_match('/:/', $params['newipaddress']) ? 'v6' : 'v4'); $from[] = '/{{ clTRID }}/'; $clTRID = str_replace('.', '', round(microtime(1), 3)); $to[] = htmlspecialchars($this->prefix . '-host-update-' . $clTRID); @@ -1110,7 +1111,7 @@ class eppClient return $return; } - + /** * domainCheckClaims */ @@ -1359,14 +1360,14 @@ class eppClient $from = $to = array(); $text = ''; foreach ($add as $k => $v) { - $text.= '' . $v . '' . "\n"; + $text .= '' . $v . '' . "\n"; } $from[] = '/{{ add }}/'; $to[] = (empty($text) ? '' : "\n{$text}\n"); $text = ''; foreach ($rem as $k => $v) { - $text.= '' . $v . '' . "\n"; + $text .= '' . $v . '' . "\n"; } $from[] = '/{{ rem }}/'; @@ -1428,21 +1429,21 @@ class eppClient $from = $to = array(); $from[] = '/{{ name }}/'; $to[] = htmlspecialchars($params['domainname']); - if ($params['contacttype'] === 'registrant') { - $from[] = '/{{ add }}/'; - $to[] = ""; - $from[] = '/{{ rem }}/'; - $to[] = ""; - $from[] = '/{{ chg }}/'; - $to[] = "".htmlspecialchars($params['new_contactid'])."\n"; - } else { - $from[] = '/{{ add }}/'; - $to[] = "".htmlspecialchars($params['new_contactid'])."\n"; - $from[] = '/{{ rem }}/'; - $to[] = "".htmlspecialchars($params['old_contactid'])."\n"; - $from[] = '/{{ chg }}/'; - $to[] = ""; - } + if ($params['contacttype'] === 'registrant') { + $from[] = '/{{ add }}/'; + $to[] = ""; + $from[] = '/{{ rem }}/'; + $to[] = ""; + $from[] = '/{{ chg }}/'; + $to[] = "" . htmlspecialchars($params['new_contactid']) . "\n"; + } else { + $from[] = '/{{ add }}/'; + $to[] = "" . htmlspecialchars($params['new_contactid']) . "\n"; + $from[] = '/{{ rem }}/'; + $to[] = "" . htmlspecialchars($params['old_contactid']) . "\n"; + $from[] = '/{{ chg }}/'; + $to[] = ""; + } $from[] = '/{{ clTRID }}/'; $clTRID = str_replace('.', '', round(microtime(1), 3)); $to[] = htmlspecialchars($this->prefix . '-domain-updateContact-' . $clTRID); @@ -1482,7 +1483,7 @@ class eppClient return $return; } - + /** * domainUpdateStatus */ @@ -1500,17 +1501,17 @@ class eppClient $from = $to = array(); $from[] = '/{{ name }}/'; $to[] = htmlspecialchars($params['domainname']); - if ($params['command'] === 'add') { - $from[] = '/{{ add }}/'; - $to[] = "\n"; - $from[] = '/{{ rem }}/'; - $to[] = ""; - } else if ($params['command'] === 'rem') { - $from[] = '/{{ add }}/'; - $to[] = ""; - $from[] = '/{{ rem }}/'; - $to[] = "\n"; - } + if ($params['command'] === 'add') { + $from[] = '/{{ add }}/'; + $to[] = "\n"; + $from[] = '/{{ rem }}/'; + $to[] = ""; + } else if ($params['command'] === 'rem') { + $from[] = '/{{ add }}/'; + $to[] = ""; + $from[] = '/{{ rem }}/'; + $to[] = "\n"; + } $from[] = '/{{ clTRID }}/'; $clTRID = str_replace('.', '', round(microtime(1), 3)); $to[] = htmlspecialchars($this->prefix . '-domain-updateStatus-' . $clTRID); @@ -1549,7 +1550,7 @@ class eppClient return $return; } - + /** * domainUpdateAuthinfo */ @@ -1610,7 +1611,7 @@ class eppClient return $return; } - + /** * domainUpdateDNSSEC */ @@ -1628,57 +1629,57 @@ class eppClient $from = $to = array(); $from[] = '/{{ name }}/'; $to[] = htmlspecialchars($params['domainname']); - if ($params['command'] == 'add') { - $from[] = '/{{ add }}/'; - $to[] = " + if ($params['command'] == 'add') { + $from[] = '/{{ add }}/'; + $to[] = " - ".htmlspecialchars($params['keyTag_1'])." - ".htmlspecialchars($params['alg_1'])." - ".htmlspecialchars($params['digestType_1'])." - ".htmlspecialchars($params['digest_1'])." + " . htmlspecialchars($params['keyTag_1']) . " + " . htmlspecialchars($params['alg_1']) . " + " . htmlspecialchars($params['digestType_1']) . " + " . htmlspecialchars($params['digest_1']) . " "; - $from[] = '/{{ rem }}/'; - $to[] = ""; - $from[] = '/{{ addrem }}/'; - $to[] = ""; - } else if ($params['command'] == 'rem') { - $from[] = '/{{ add }}/'; - $to[] = ""; - $from[] = '/{{ rem }}/'; - $to[] = " + $from[] = '/{{ rem }}/'; + $to[] = ""; + $from[] = '/{{ addrem }}/'; + $to[] = ""; + } else if ($params['command'] == 'rem') { + $from[] = '/{{ add }}/'; + $to[] = ""; + $from[] = '/{{ rem }}/'; + $to[] = " - ".htmlspecialchars($params['keyTag_1'])." - ".htmlspecialchars($params['alg_1'])." - ".htmlspecialchars($params['digestType_1'])." - ".htmlspecialchars($params['digest_1'])." + " . htmlspecialchars($params['keyTag_1']) . " + " . htmlspecialchars($params['alg_1']) . " + " . htmlspecialchars($params['digestType_1']) . " + " . htmlspecialchars($params['digest_1']) . " "; - $from[] = '/{{ addrem }}/'; - $to[] = ""; - } else if ($params['command'] == 'addrem') { - $from[] = '/{{ add }}/'; - $to[] = ""; - $from[] = '/{{ rem }}/'; - $to[] = ""; - $from[] = '/{{ addrem }}/'; - $to[] = " + $from[] = '/{{ addrem }}/'; + $to[] = ""; + } else if ($params['command'] == 'addrem') { + $from[] = '/{{ add }}/'; + $to[] = ""; + $from[] = '/{{ rem }}/'; + $to[] = ""; + $from[] = '/{{ addrem }}/'; + $to[] = " - ".htmlspecialchars($params['keyTag_1'])." - ".htmlspecialchars($params['alg_1'])." - ".htmlspecialchars($params['digestType_1'])." - ".htmlspecialchars($params['digest_1'])." + " . htmlspecialchars($params['keyTag_1']) . " + " . htmlspecialchars($params['alg_1']) . " + " . htmlspecialchars($params['digestType_1']) . " + " . htmlspecialchars($params['digest_1']) . " - ".htmlspecialchars($params['keyTag_2'])." - ".htmlspecialchars($params['alg_2'])." - ".htmlspecialchars($params['digestType_2'])." - ".htmlspecialchars($params['digest_2'])." + " . htmlspecialchars($params['keyTag_2']) . " + " . htmlspecialchars($params['alg_2']) . " + " . htmlspecialchars($params['digestType_2']) . " + " . htmlspecialchars($params['digest_2']) . " "; - } + } $from[] = '/{{ clTRID }}/'; $clTRID = str_replace('.', '', round(microtime(1), 3)); $to[] = htmlspecialchars($this->prefix . '-domain-updateDNSSEC-' . $clTRID); @@ -1742,43 +1743,43 @@ class eppClient $from = $to = array(); $from[] = '/{{ name }}/'; $to[] = htmlspecialchars($params['domainname']); - switch (htmlspecialchars($params['op'])) { - case 'request': - $from[] = '/{{ years }}/'; - $to[] = (int)($params['years']); - $from[] = '/{{ authInfoPw }}/'; - $to[] = htmlspecialchars($params['authInfoPw']); - $xmltype = 'req'; - break; - case 'query': - $from[] = '/{{ type }}/'; - $to[] = 'query'; - $xmltype = 'oth'; - break; - case 'cancel': - $from[] = '/{{ type }}/'; - $to[] = 'cancel'; - $xmltype = 'oth'; - break; - case 'reject': - $from[] = '/{{ type }}/'; - $to[] = 'reject'; - $xmltype = 'oth'; - break; - case 'approve': - $xmltype = 'apr'; - break; - default: - throw new EppException('Invalid value for transfer:op specified.'); - break; - } + switch (htmlspecialchars($params['op'])) { + case 'request': + $from[] = '/{{ years }}/'; + $to[] = (int)($params['years']); + $from[] = '/{{ authInfoPw }}/'; + $to[] = htmlspecialchars($params['authInfoPw']); + $xmltype = 'req'; + break; + case 'query': + $from[] = '/{{ type }}/'; + $to[] = 'query'; + $xmltype = 'oth'; + break; + case 'cancel': + $from[] = '/{{ type }}/'; + $to[] = 'cancel'; + $xmltype = 'oth'; + break; + case 'reject': + $from[] = '/{{ type }}/'; + $to[] = 'reject'; + $xmltype = 'oth'; + break; + case 'approve': + $xmltype = 'apr'; + break; + default: + throw new EppException('Invalid value for transfer:op specified.'); + break; + } $from[] = '/{{ clTRID }}/'; $clTRID = str_replace('.', '', round(microtime(1), 3)); $to[] = htmlspecialchars($this->prefix . '-domain-transfer-' . $clTRID); $from[] = "/<\w+:\w+>\s*<\/\w+:\w+>\s+/ims"; $to[] = ''; - if ($xmltype === 'req') { - $xml = preg_replace($from, $to, ' + if ($xmltype === 'req') { + $xml = preg_replace($from, $to, ' @@ -1796,33 +1797,32 @@ class eppClient {{ clTRID }} '); - - $r = $this->writeRequest($xml); - $code = (int)$r->response->result->attributes()->code; - $msg = (string)$r->response->result->msg; - $r = $r->response->resData->children('urn:ietf:params:xml:ns:domain-1.0')->trnData; - $name = (string)$r->name; - $trStatus = (string)$r->trStatus; - $reID = (string)$r->reID; - $reDate = (string)$r->reDate; - $acID = (string)$r->acID; - $acDate = (string)$r->acDate; - $exDate = (string)$r->exDate; - $return = array( - 'code' => $code, - 'msg' => $msg, - 'name' => $name, - 'trStatus' => $trStatus, - 'reID' => $reID, - 'reDate' => $reDate, - 'acID' => $acID, - 'acDate' => $acDate, - 'exDate' => $exDate - ); - - } else if ($xmltype === 'apr') { - $xml = preg_replace($from, $to, ' + $r = $this->writeRequest($xml); + $code = (int)$r->response->result->attributes()->code; + $msg = (string)$r->response->result->msg; + $r = $r->response->resData->children('urn:ietf:params:xml:ns:domain-1.0')->trnData; + $name = (string)$r->name; + $trStatus = (string)$r->trStatus; + $reID = (string)$r->reID; + $reDate = (string)$r->reDate; + $acID = (string)$r->acID; + $acDate = (string)$r->acDate; + $exDate = (string)$r->exDate; + + $return = array( + 'code' => $code, + 'msg' => $msg, + 'name' => $name, + 'trStatus' => $trStatus, + 'reID' => $reID, + 'reDate' => $reDate, + 'acID' => $acID, + 'acDate' => $acDate, + 'exDate' => $exDate + ); + } else if ($xmltype === 'apr') { + $xml = preg_replace($from, $to, ' @@ -1836,27 +1836,26 @@ class eppClient {{ clTRID }} '); - - $r = $this->writeRequest($xml); - $code = (int)$r->response->result->attributes()->code; - $msg = (string)$r->response->result->msg; - $r = $r->response->resData->children('urn:ietf:params:xml:ns:domain-1.0')->Data; - $name = (string)$r->name; - $trStatus = (string)$r->trStatus; - $reID = (string)$r->reID; - $reDate = (string)$r->reDate; - $return = array( - 'code' => $code, - 'msg' => $msg, - 'name' => $name, - 'trStatus' => $trStatus, - 'reID' => $reID, - 'reDate' => $reDate - ); - - } else if ($xmltype === 'oth') { - $xml = preg_replace($from, $to, ' + $r = $this->writeRequest($xml); + $code = (int)$r->response->result->attributes()->code; + $msg = (string)$r->response->result->msg; + $r = $r->response->resData->children('urn:ietf:params:xml:ns:domain-1.0')->Data; + $name = (string)$r->name; + $trStatus = (string)$r->trStatus; + $reID = (string)$r->reID; + $reDate = (string)$r->reDate; + + $return = array( + 'code' => $code, + 'msg' => $msg, + 'name' => $name, + 'trStatus' => $trStatus, + 'reID' => $reID, + 'reDate' => $reDate + ); + } else if ($xmltype === 'oth') { + $xml = preg_replace($from, $to, ' @@ -1870,17 +1869,16 @@ class eppClient {{ clTRID }} '); - - $r = $this->writeRequest($xml); - $code = (int)$r->response->result->attributes()->code; - $msg = (string)$r->response->result->msg; - $return = array( - 'code' => $code, - 'msg' => $msg - ); - - } + $r = $this->writeRequest($xml); + $code = (int)$r->response->result->attributes()->code; + $msg = (string)$r->response->result->msg; + + $return = array( + 'code' => $code, + 'msg' => $msg + ); + } } catch (\Exception $e) { $return = array( 'error' => $e->getMessage() @@ -1923,9 +1921,9 @@ class eppClient $from[] = '/{{ registrant }}/'; $to[] = htmlspecialchars($params['registrant']); $text = ''; - foreach ($params['contacts'] as $contactType => $contactID) { - $text .= '' . $contactID . '' . "\n"; - } + foreach ($params['contacts'] as $contactType => $contactID) { + $text .= '' . $contactID . '' . "\n"; + } $from[] = '/{{ contacts }}/'; $to[] = $text; $from[] = '/{{ authInfoPw }}/'; @@ -1981,7 +1979,7 @@ class eppClient return $return; } - + /** * domainCreateDNSSEC */ @@ -2015,36 +2013,36 @@ class eppClient $from[] = '/{{ registrant }}/'; $to[] = htmlspecialchars($params['registrant']); $text = ''; - foreach ($params['contacts'] as $contactType => $contactID) { - $text .= '' . $contactID . '' . "\n"; - } + foreach ($params['contacts'] as $contactType => $contactID) { + $text .= '' . $contactID . '' . "\n"; + } $from[] = '/{{ contacts }}/'; $to[] = $text; $from[] = '/{{ authInfoPw }}/'; $to[] = htmlspecialchars($params['authInfoPw']); - if ($params['dnssec_records'] == 1) { - $from[] = '/{{ dnssec_data }}/'; - $to[] = " - ".htmlspecialchars($params['keyTag_1'])." - ".htmlspecialchars($params['alg_1'])." - ".htmlspecialchars($params['digestType_1'])." - ".htmlspecialchars($params['digest_1'])." + if ($params['dnssec_records'] == 1) { + $from[] = '/{{ dnssec_data }}/'; + $to[] = " + " . htmlspecialchars($params['keyTag_1']) . " + " . htmlspecialchars($params['alg_1']) . " + " . htmlspecialchars($params['digestType_1']) . " + " . htmlspecialchars($params['digest_1']) . " "; - } else if ($params['dnssec_records'] == 2) { - $from[] = '/{{ dnssec_data }}/'; - $to[] = " - ".htmlspecialchars($params['keyTag_1'])." - ".htmlspecialchars($params['alg_1'])." - ".htmlspecialchars($params['digestType_1'])." - ".htmlspecialchars($params['digest_1'])." + } else if ($params['dnssec_records'] == 2) { + $from[] = '/{{ dnssec_data }}/'; + $to[] = " + " . htmlspecialchars($params['keyTag_1']) . " + " . htmlspecialchars($params['alg_1']) . " + " . htmlspecialchars($params['digestType_1']) . " + " . htmlspecialchars($params['digest_1']) . " - ".htmlspecialchars($params['keyTag_2'])." - ".htmlspecialchars($params['alg_2'])." - ".htmlspecialchars($params['digestType_2'])." - ".htmlspecialchars($params['digest_2'])." + " . htmlspecialchars($params['keyTag_2']) . " + " . htmlspecialchars($params['alg_2']) . " + " . htmlspecialchars($params['digestType_2']) . " + " . htmlspecialchars($params['digest_2']) . " "; - } + } $from[] = '/{{ clTRID }}/'; $clTRID = str_replace('.', '', round(microtime(1), 3)); $to[] = htmlspecialchars($this->prefix . '-domain-createDNSSEC-' . $clTRID); @@ -2103,7 +2101,7 @@ class eppClient return $return; } - + /** * domainCreateClaims */ @@ -2137,9 +2135,9 @@ class eppClient $from[] = '/{{ registrant }}/'; $to[] = htmlspecialchars($params['registrant']); $text = ''; - foreach ($params['contacts'] as $contactType => $contactID) { - $text .= '' . $contactID . '' . "\n"; - } + foreach ($params['contacts'] as $contactType => $contactID) { + $text .= '' . $contactID . '' . "\n"; + } $from[] = '/{{ contacts }}/'; $to[] = $text; $from[] = '/{{ authInfoPw }}/'; @@ -2529,10 +2527,10 @@ class eppClient $r = $this->writeRequest($xml); $code = (int)$r->response->result->attributes()->code; $msg = (string)$r->response->result->msg; - $messages = (int)($r->response->msgQ->attributes()->count ?? 0); - $last_id = (int)($r->response->msgQ->attributes()->id ?? 0); - $qDate = (string)($r->response->msgQ->qDate ?? ''); - $last_msg = (string)($r->response->msgQ->msg ?? ''); + $messages = (int)($r->response->msgQ->attributes()->count ?? 0); + $last_id = (int)($r->response->msgQ->attributes()->id ?? 0); + $qDate = (string)($r->response->msgQ->qDate ?? ''); + $last_msg = (string)($r->response->msgQ->msg ?? ''); $return = array( 'code' => $code,