function __construct(eppDomain $domain, $clientdelete) { $upd = new eppDomain($domain->getDomainName()); parent::__construct($domain, null, null, $upd); $this->setClientDelete($clientdelete); parent::addSessionId(); }
function __construct(eppDomain $domain, $addinfo = null, $removeinfo = null, $updateinfo = null, $forcehostattr = false) { $upd = new eppDomain($domain->getDomainname()); parent::__construct($domain, null, null, $upd); $this->addTrustee(); parent::addSessionId(); }
public function setDomain(eppDomain $domain, $hosts = null) { if (!strlen($domain->getDomainName())) { throw new eppException('Domain object does not contain a valid domain name'); } # # Create command structure # $this->command = $this->createElement('command'); # # Domain check structure # $info = $this->createElement('info'); $this->domainobject = $this->createElement('domain:info'); $info->appendChild($this->domainobject); $dname = $this->createElement('domain:name', $domain->getDomainName()); if ($hosts) { if ($hosts == self::HOSTS_ALL || $hosts == self::HOSTS_DELEGATED || $hosts == self::HOSTS_NONE || $hosts == self::HOSTS_SUBORDINATE) { $dname->setAttribute('hosts', $hosts); } else { throw new eppException('Hosts parameter of inforequest can only be to be all, none, del or sub'); } } else { $dname->setAttribute('hosts', self::HOSTS_ALL); } $this->domainobject->appendChild($dname); if (!$this->command) { $this->command = $this->getCommand(); } $this->command->appendChild($info); if (!$this->epp) { $this->epp = $this->getEpp(); } $this->epp->appendChild($this->command); }
/** * * @param eppDomain $domain * @return \DOMElement * @throws eppException */ public function setDomain(eppDomain $domain) { if (!strlen($domain->getDomainname())) { throw new eppException('No valid domain name in create domain request'); } if (!strlen($domain->getRegistrant())) { throw new eppException('No valid registrant in create domain request'); } # # Object create structure # $this->domainobject->appendChild($this->createElement('domain:name', $domain->getDomainname())); if ($domain->getPeriod() > 0) { $domainperiod = $this->createElement('domain:period', $domain->getPeriod()); $domainperiod->setAttribute('unit', $domain->getPeriodUnit()); $this->domainobject->appendChild($domainperiod); } $nsobjects = $domain->getHosts(); if ($domain->getHostLength() > 0) { $nameservers = $this->createElement('domain:ns'); foreach ($nsobjects as $nsobject) { /* @var $nsobject eppHost */ if ($this->getForcehostattr() || $nsobject->getIpAddressCount() > 0) { $nameservers->appendChild($this->addDomainHostAttr($nsobject)); } else { $nameservers->appendChild($this->addDomainHostObj($nsobject)); } } $this->domainobject->appendChild($nameservers); } $this->domainobject->appendChild($this->createElement('domain:registrant', $domain->getRegistrant())); $contacts = $domain->getContacts(); if ($domain->getContactLength() > 0) { foreach ($contacts as $contact) { /* @var $contact eppContactHandle */ $this->addDomainContact($this->domainobject, $contact->getContactHandle(), $contact->getContactType()); } } if (strlen($domain->getAuthorisationCode())) { $authinfo = $this->createElement('domain:authInfo'); $authinfo->appendChild($this->createElement('domain:pw', $domain->getAuthorisationCode())); $this->domainobject->appendChild($authinfo); } // Check for DNSSEC keys and add them if ($domain->getSecdnsLength() > 0) { for ($i = 0; $i < $domain->getSecdnsLength(); $i++) { $sd = $domain->getSecdns($i); /* @var $sd eppSecdns */ if ($sd) { $ext = new eppSecdns(); $ext->copy($sd); $this->addSecdns($ext); } } } return; }
public function setDomain(eppDomain $domain) { if (!strlen($domain->getDomainname())) { throw new eppException('eppDeleteRequest domain object does not contain a valid domain name'); } # # Object delete structure # $this->domainobject->appendChild($this->createElement('domain:name', $domain->getDomainname())); }
public function setDomain(eppDomain $domain) { if (!strlen($domain->getDomainname())) { throw new eppException('eppUndeleteRequest domain object does not contain a valid domain name'); } # # Object delete structure # $commandext = $this->createElement('ext:command'); $undelete = $this->createElement('ext:undelete'); $undelete->appendChild($this->createElement('domain:name', $domain->getDomainname())); $commandext->appendChild($undelete); $this->getExtension()->appendChild($commandext); }
public function setDomain(eppDomain $domain, $expdate = null) { # # Object create structure # $this->domainobject->appendChild($this->createElement('domain:name', $domain->getDomainname())); if ($expdate) { $this->domainobject->appendChild($this->createElement('domain:curExpDate', $expdate)); } if ($domain->getPeriod() > 0) { $domainperiod = $this->createElement('domain:period', $domain->getPeriod()); $domainperiod->setAttribute('unit', $domain->getPeriodUnit()); $this->domainobject->appendChild($domainperiod); } }
/** * * @param string $registrant */ public function setRegistrant($registrant) { if ($registrant instanceof eppContactHandle) { parent::setRegistrant($registrant); } else { parent::setRegistrant($this->parseContactHandle($registrant)); } }
/** * eppRgpRestoreRequest constructor. * @param eppDomain $objectname * @param eppDomain|null $addinfo * @param eppDomain|null $removeinfo * @param eppDomain|null $updateinfo */ public function __construct(eppDomain $objectname, $addinfo = null, $removeinfo = null, $updateinfo = null) { if ($objectname instanceof eppDomain) { $domainname = $objectname->getDomainname(); } else { $domainname = $objectname; } if ($updateinfo == null) { $updateinfo = new eppDomain($domainname); } parent::__construct($domainname, null, null, $updateinfo); $rgp = $this->createElement('rgp:update'); //$this->addExtension('xmlns:rgp', 'urn:ietf:params:xml:ns:rgp-1.0'); $restore = $this->createElement('rgp:restore'); $restore->setAttribute('op', 'request'); $rgp->appendChild($restore); $this->getExtension()->appendChild($rgp); $this->addSessionId(); }
/** * * @param \domElement $element * @param eppDomain $domain */ private function addDomainChanges($element, eppDomain $domain) { if ($domain->getRegistrant()) { $element->appendChild($this->createElement('domain:registrant', $domain->getRegistrant())); } $hosts = $domain->getHosts(); if (is_array($hosts) && count($hosts)) { $nameservers = $this->createElement('domain:ns'); foreach ($hosts as $host) { /* @var eppHost $host */ if ($this->forcehostattr || is_array($host->getIpAddresses())) { $nameservers->appendChild($this->addDomainHostAttr($host)); } else { $nameservers->appendChild($this->addDomainHostObj($host)); } } $element->appendChild($nameservers); } $contacts = $domain->getContacts(); if (is_array($contacts)) { foreach ($contacts as $contact) { /* @var eppContactHandle $contact */ $this->addDomainContact($element, $contact->getContactHandle(), $contact->getContactType()); } } $statuses = $domain->getStatuses(); if (is_array($statuses)) { foreach ($statuses as $status) { $this->addDomainStatus($element, $status); } } if (strlen($domain->getAuthorisationCode())) { $authinfo = $this->createElement('domain:authInfo'); $pw = $this->createElement('domain:pw'); $pw->appendChild($this->createCDATASection($domain->getAuthorisationCode())); $authinfo->appendChild($pw); $element->appendChild($authinfo); } }
public function setDomain(eppDomain $domain, $hosts = null) { if (!strlen($domain->getDomainname())) { throw new eppException('Domain object does not contain a valid domain name'); } # # Domain structure # $dname = $this->createElement('domain:name', $domain->getDomainname()); if ($hosts) { if ($hosts == self::HOSTS_ALL || $hosts == self::HOSTS_DELEGATED || $hosts == self::HOSTS_NONE || $hosts == self::HOSTS_SUBORDINATE) { $dname->setAttribute('hosts', $hosts); } else { throw new eppException('Hosts parameter of inforequest can only be to be all, none, del or sub'); } } $this->domainobject->appendChild($dname); if (!is_null($domain->getAuthorisationCode())) { $authinfo = $this->createElement('domain:authInfo'); $authinfo->appendChild($this->createElement('domain:pw', $domain->getAuthorisationCode())); $this->domainobject->appendChild($authinfo); } }
public function setDomainRequest(eppDomain $domain) { # # Object create structure # $transfer = $this->createElement('transfer'); $transfer->setAttribute('op', self::OPERATION_REQUEST); $this->domainobject = $this->createElement('domain:transfer'); $this->domainobject->appendChild($this->createElement('domain:name', $domain->getDomainname())); if ($domain->getPeriod()) { $domainperiod = $this->createElement('domain:period', $domain->getPeriod()); $domainperiod->setAttribute('unit', eppDomain::DOMAIN_PERIOD_UNIT_Y); $this->domainobject->appendChild($domainperiod); } if (strlen($domain->getAuthorisationCode())) { $authinfo = $this->createElement('domain:authInfo'); $authinfo->appendChild($this->createElement('domain:pw', $domain->getAuthorisationCode())); $this->domainobject->appendChild($authinfo); } $transfer->appendChild($this->domainobject); $this->getCommand()->appendChild($transfer); }
/** * * @param \domElement $element * @param eppDomain $domain ficoraEppDomain element containing changes */ protected function addDomainChanges($element, eppDomain $domain) { // can't change function argument class due to strict standards warning if (!$domain instanceof ficoraEppDomain) { throw new eppException('Domains passed to ficoraEppUpdateDomainRequest must be instances of ficoraEppDomain'); } if ($domain->getRegistrant()) { $element->appendChild($this->createElement('domain:registrant', $domain->getRegistrant())); } $hosts = $domain->getHosts(); if (is_array($hosts) && count($hosts)) { $nameservers = $this->createElement('domain:ns'); foreach ($hosts as $host) { /* @var eppHost $host */ if ($this->getForcehostattr() || is_array($host->getIpAddresses())) { $nameservers->appendChild($this->addDomainHostAttr($host)); } else { $nameservers->appendChild($this->addDomainHostObj($host)); } } $element->appendChild($nameservers); } $contacts = $domain->getContacts(); if (is_array($contacts)) { foreach ($contacts as $contact) { /* @var eppContactHandle $contact */ $this->addDomainContact($element, $contact->getContactHandle(), $contact->getContactType()); } } // Changing status is not supported for *.fi domains, verified from registry $statuses = $domain->getStatuses(); if (is_array($statuses) && count($statuses)) { throw new eppException('Changing statuses is not supported for *.fi domains.'); } // authinfo might contain domain:pw (provider transfer key) and/or domain:pwregistranttransfer (registrant transfer key) // registrant transfer key must be present on registrant change, empty one is valid if registry number doesn't change if (strlen($domain->getAuthorisationCode()) || $domain->getRegistrant() || $domain->getRegistrantTransferCode()) { $authinfo = $this->createElement('domain:authInfo'); if (strlen($domain->getAuthorisationCode())) { $pw = $this->createElement('domain:pw'); $pw->appendChild($this->createCDATASection($domain->getAuthorisationCode())); $authinfo->appendChild($pw); } if ($domain->getRegistrant() || $domain->getRegistrantTransferCode()) { $registrantPassword = $this->createElement('domain:pwregistranttransfer', $domain->getRegistrantTransferCode()); $authinfo->appendChild($registrantPassword); } $element->appendChild($authinfo); } }