metaregistrar / php-epp-client

Object-oriented PHP EPP Client
https://www.metaregistrar.com/docs/
MIT License
213 stars 156 forks source link

modifydomain - Error 2102: Unimplemented option #82

Closed pc-partner closed 7 years ago

pc-partner commented 7 years ago

Hi,

When changing on dnsbe a nameserver for a domain we get the following error: Error 2102: Unimplemented option

modifydomain($conn, $domainname, null, null, null, null, array('ns1.metaregistrar.nl', 'ns2.metaregistrar.nl'));

metaregistrar commented 7 years ago

Hello pc-partner,

The modifydomain command is an internal command that only works with standard epp configurations, it makes use of the standard eppUpdateDomainRequest. This standaard eppUpdateDomainRequest makes use of eppHost objects, and DNS Belgium does not use Host Objects but uses Host Attributes.

In the case of DNS Belgium, you cannot use this modifydomain command, but you have to write your own, using the $forcehostattr parameter.

Like this: $update = new eppUpdateDomainRequest($domain, $add, $del, $mod, true);

The last "true" is to force host attributes instead of host objects.

pc-partner commented 7 years ago

I see. So modify or create a new function modifydomainDNSBE But then, when checking if you have values for your nameservers, you need to add that $forcehostattr. I don't have a clue how. if (is_array($nameservers)) { foreach ($nameservers as $nameserver) { $hostAttr = $this->createElement('domain:hostAttr'); $hostName = $hostAttr->createElement('domain:hostName'); $hostName->setValue($nameserver); $mod->appendChild($this->addDomainHostAttr($hostAttr )); } } } $update = new eppUpdateDomainRequest($domain, $add, $del, $mod, true);