private function addSidnExtension(eppContact $contact)
 {
     $postal = $contact->getPostalInfo(0);
     if (strlen($postal->getOrganisationName())) {
         $legalform = 'ANDERS';
     } else {
         $legalform = 'PERSOON';
     }
     $sidnext = $this->createElement('sidn-ext-epp:ext');
     $create = $this->createElement('sidn-ext-epp:create');
     $contact = $this->createElement('sidn-ext-epp:contact');
     $contact->appendChild($this->createElement('sidn-ext-epp:legalForm', $legalform));
     #$contact->appendChild($this->createElement('sidn-ext-epp:legalFormRegNo','8764654.0'));
     $create->appendChild($contact);
     $sidnext->appendChild($create);
     $this->getExtension()->appendChild($sidnext);
 }
Пример #2
0
 /**
  * @param null $postalInfo
  * @param string $personType |$personType=self::PERS_TYPE_PRIVATPERSON
  * @param null $email
  * @param null $voice
  * @param null $fax
  * @param bool|false $whoisHideEmail
  * @param bool|false $whoisHidePhone
  * @param bool|false $whoisHideFax
  * @param null $password
  * @param null $status
  * @throws eppException
  */
 public function __construct($postalInfo = null, $personType = self::PERS_TYPE_UNSPECIFIED, $email = null, $voice = null, $fax = null, $whoisHideEmail = false, $whoisHidePhone = false, $whoisHideFax = false, $password = null, $status = null)
 {
     parent::__construct($postalInfo, $email, $voice, $fax, $password, $status);
     $this->setPersonType($personType);
     $this->setWhoisHideEmail($whoisHideEmail);
     $this->setWhoisHideFax($whoisHideFax);
     $this->setWhoisHidePhone($whoisHidePhone);
 }
 /**
  *
  * @param eppContact $contact
  * @return \domElement
  * @throws eppException
  */
 public function setContact(eppContact $contact)
 {
     #
     # Object create structure
     #
     $this->setContactId($contact->generateContactId());
     $this->setPostalInfo($contact->getPostalInfo(0));
     $this->setVoice($contact->getVoice());
     $this->setFax($contact->getFax());
     $this->setEmail($contact->getEmail());
     $this->setPassword($contact->getPassword());
     $this->setDisclose($contact->getDisclose());
 }
Пример #4
0
 /**
  *
  * @param eppContact $registrant
  * @param string $authorisationCode
  */
 public function __construct($domainname, $registrant = null, $contacts = null, $hosts = null, $period = 0, $authorisationCode = null)
 {
     if (strlen($domainname)) {
         $this->setDomainname($domainname);
     } else {
         throw new eppException('Domain name not set');
     }
     $this->setPeriod($period);
     if ($registrant instanceof eppContact) {
         throw new eppException('Registrant must be Metaregistrar\\EPP\\eppContactHandle or string on eppDomain creation');
     }
     if ($registrant instanceof eppContactHandle) {
         $this->setRegistrant($registrant->getContactHandle());
     } else {
         if ($registrant) {
             if (strlen($registrant)) {
                 $this->setRegistrant($registrant);
             } else {
                 throw new eppException('Registrant must be Metaregistrar\\EPP\\eppContactHandle or string on eppDomain creation');
             }
         }
     }
     if ($authorisationCode) {
         $this->setAuthorisationCode($authorisationCode);
     }
     if ($hosts) {
         if (is_array($hosts)) {
             foreach ($hosts as $host) {
                 $this->addHost($host);
             }
         } else {
             $this->addHost($hosts);
         }
     }
     if ($contacts) {
         if (is_array($contacts)) {
             foreach ($contacts as $contact) {
                 $this->addContact($contact);
             }
         } else {
             if (strlen($contacts)) {
                 $this->addContact($contacts);
             }
         }
     }
 }
 /**
  *
  * @param \DOMElement $element
  * @param eppContact $contact
  */
 private function addContactChanges($element, eppContact $contact)
 {
     if ($contact->getPostalInfoLength() > 0) {
         $postal = $contact->getPostalInfo(0);
         $postalinfo = $this->createElement('contact:postalInfo');
         if ($postal->getType() == eppContact::TYPE_AUTO) {
             // If all fields are ascii, type = int (international) else type = loc (localization)
             if (self::isAscii($postal->getName()) && self::isAscii($postal->getOrganisationName()) && self::isAscii($postal->getStreet(0))) {
                 $postal->setType(eppContact::TYPE_INT);
             } else {
                 $postal->setType(eppContact::TYPE_LOC);
             }
         }
         $postalinfo->setAttribute('type', $postal->getType());
         if (!$postal->getName() == '') {
             $postalinfo->appendChild($this->createElement('contact:name', $postal->getName()));
         }
         if (!$postal->getOrganisationName() == '') {
             $postalinfo->appendChild($this->createElement('contact:org', $postal->getOrganisationName()));
         }
         if ($postal->getStreetCount() > 0 || strlen($postal->getCity()) || strlen($postal->getProvince()) || strlen($postal->getZipcode()) || strlen($postal->getCountrycode())) {
             $postaladdr = $this->createElement('contact:addr');
             if (($count = $postal->getStreetCount()) > 0) {
                 for ($i = 0; $i < $count; $i++) {
                     $postaladdr->appendChild($this->createElement('contact:street', $postal->getStreet($i)));
                 }
             }
             if (strlen($postal->getCity())) {
                 $postaladdr->appendChild($this->createElement('contact:city', $postal->getCity()));
             }
             if (strlen($postal->getProvince())) {
                 $postaladdr->appendChild($this->createElement('contact:sp', $postal->getProvince()));
             }
             if (strlen($postal->getZipcode())) {
                 $postaladdr->appendChild($this->createElement('contact:pc', $postal->getZipcode()));
             }
             if (strlen($postal->getCountrycode())) {
                 $postaladdr->appendChild($this->createElement('contact:cc', $postal->getCountrycode()));
             }
             $postalinfo->appendChild($postaladdr);
         }
         $element->appendChild($postalinfo);
     }
     if (strlen($contact->getVoice())) {
         $element->appendChild($this->createElement('contact:voice', $contact->getVoice()));
     }
     if (strlen($contact->getFax())) {
         $element->appendChild($this->createElement('contact:fax', $contact->getFax()));
     }
     if (strlen($contact->getEmail())) {
         $element->appendChild($this->createElement('contact:email', $contact->getEmail()));
     }
     if ($contact->getPassword()) {
         $authinfo = $this->createElement('contact:authInfo');
         $authinfo->appendChild($this->createElement('contact:pw', $contact->getPassword()));
         $element->appendChild($authinfo);
     }
     if (!is_null($contact->getDisclose())) {
         $type = $contact->getType();
         if ($type == $contact::TYPE_AUTO) {
             $type = $contact::TYPE_LOC;
         }
         $disclose = $this->createElement('contact:disclose');
         $disclose->setAttribute('flag', $contact->getDisclose());
         $name = $this->createElement('contact:name');
         if ($contact->getDisclose() == 1) {
             $name->setAttribute('type', $type);
         }
         $disclose->appendChild($name);
         $org = $this->createElement('contact:org');
         if ($contact->getDisclose() == 1) {
             $org->setAttribute('type', $type);
         }
         $disclose->appendChild($org);
         $addr = $this->createElement('contact:addr');
         if ($contact->getDisclose() == 1) {
             $addr->setAttribute('type', $type);
         }
         $disclose->appendChild($addr);
         $disclose->appendChild($this->createElement('contact:voice'));
         $disclose->appendChild($this->createElement('contact:email'));
         $element->appendChild($disclose);
     }
 }
 /**
  *
  * @param eppContact $contact
  * @return \domElement
  */
 public function setContact(eppContact $contact)
 {
     #
     # Object create structure
     #
     $create = $this->createElement('create');
     $this->contactobject = $this->createElement('contact:create');
     $this->contactobject->appendChild($this->createElement('contact:id', $contact->generateContactId()));
     $postalinfo = $this->createElement('contact:postalInfo');
     $postal = $contact->getPostalInfo(0);
     if (!$postal instanceof eppContactPostalInfo) {
         throw new eppException('PostalInfo must be filled on eppCreateContact request');
     }
     if ($postal->getType() == eppContact::TYPE_AUTO) {
         // If all fields are ascii, type = int (international) else type = loc (localization)
         if ($this->isAscii($postal->getName()) && $this->isAscii($postal->getOrganisationName()) && $this->isAscii($postal->getStreet(0))) {
             $postal->setType(eppContact::TYPE_INT);
         } else {
             $postal->setType(eppContact::TYPE_LOC);
         }
     }
     $postalinfo->setAttribute('type', $postal->getType());
     $postalinfo->appendChild($this->createElement('contact:name', $postal->getName()));
     if ($postal->getOrganisationName()) {
         $postalinfo->appendChild($this->createElement('contact:org', $postal->getOrganisationName()));
     }
     $postaladdr = $this->createElement('contact:addr');
     $count = $postal->getStreetCount();
     for ($i = 0; $i < $count; $i++) {
         $postaladdr->appendChild($this->createElement('contact:street', $postal->getStreet($i)));
     }
     $postaladdr->appendChild($this->createElement('contact:city', $postal->getCity()));
     if ($postal->getProvince()) {
         $postaladdr->appendChild($this->createElement('contact:sp', $postal->getProvince()));
     }
     $postaladdr->appendChild($this->createElement('contact:pc', $postal->getZipcode()));
     $postaladdr->appendChild($this->createElement('contact:cc', $postal->getCountrycode()));
     $postalinfo->appendChild($postaladdr);
     $this->contactobject->appendChild($postalinfo);
     $this->contactobject->appendChild($this->createElement('contact:voice', $contact->getVoice()));
     if ($contact->getFax()) {
         $this->contactobject->appendChild($this->createElement('contact:fax', $contact->getFax()));
     }
     $this->contactobject->appendChild($this->createElement('contact:email', $contact->getEmail()));
     if (!is_null($contact->getPassword())) {
         $authinfo = $this->createElement('contact:authInfo');
         $authinfo->appendChild($this->createElement('contact:pw', $contact->getPassword()));
         $this->contactobject->appendChild($authinfo);
     }
     if (!is_null($contact->getDisclose())) {
         $disclose = $this->createElement('contact:disclose');
         $disclose->setAttribute('flag', $contact->getDisclose());
         $name = $this->createElement('contact:name');
         if ($contact->getDisclose() == 1) {
             $name->setAttribute('type', eppContact::TYPE_LOC);
         }
         $disclose->appendChild($name);
         $org = $this->createElement('contact:org');
         if ($contact->getDisclose() == 1) {
             $org->setAttribute('type', eppContact::TYPE_LOC);
         }
         $disclose->appendChild($org);
         $addr = $this->createElement('contact:addr');
         if ($contact->getDisclose() == 1) {
             $addr->setAttribute('type', eppContact::TYPE_LOC);
         }
         $disclose->appendChild($addr);
         $disclose->appendChild($this->createElement('contact:voice'));
         $disclose->appendChild($this->createElement('contact:email'));
         $this->contactobject->appendChild($disclose);
     }
     $create->appendChild($this->contactobject);
     $this->getCommand()->appendChild($create);
 }