Skip to content

Commit

Permalink
Update ua.php
Browse files Browse the repository at this point in the history
  • Loading branch information
getpinga authored Mar 16, 2023
1 parent 68f212d commit 703336a
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions ua.php
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,37 @@ public function getEpp(Registrar_Domain $domain)
$r = $this->write($xml, __FUNCTION__);
$r = $r->response->resData->children('http://hostmaster.ua/epp/domain-1.1')->infData;
$eppcode = (string)$r->authInfo->pw;

if (empty($eppcode)) {
$eppcode = $this->generateObjectPW();
$from[] = '/{{ name }}/';
$to[] = htmlspecialchars($domain->getName());
$from[] = '/{{ authInfo }}/';
$to[] = $eppcode;
$from[] = '/{{ clTRID }}/';
$clTRID = str_replace('.', '', round(microtime(1), 3));
$to[] = htmlspecialchars($params['registrarprefix'] . '-domain-update-' . $clTRID);
$xml = preg_replace($from, $to, '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
<command>
<update>
<domain:update
xmlns:domain="http://hostmaster.ua/epp/domain-1.1">
<domain:name>{{ name }}</domain:name>
<domain:chg>
<domain:authInfo>
<domain:pw>{{ authInfo }}</domain:pw>
</domain:authInfo>
</domain:chg>
</domain:update>
</update>
<clTRID>{{ clTRID }}</clTRID>
</command>
</epp>');
$r = $this->write($xml, __FUNCTION__);
}

if (!empty($s)) {
$this->logout();
Expand Down

0 comments on commit 703336a

Please sign in to comment.