function __construct()
 {
     parent::__construct();
     $check = $this->createElement('check');
     $balanceobject = $this->createElement('balance');
     $check->appendChild($balanceobject);
     $this->getCommand()->appendChild($check);
 }
Example #2
0
 function __construct()
 {
     parent::__construct();
     #
     # Create logout command
     #
     $logout = $this->createElement('logout');
     $this->getCommand()->appendChild($logout);
 }
 function __construct($createinfo)
 {
     parent::__construct($createinfo);
     if ($createinfo instanceof eppHost) {
         $this->addExtension('xmlns:nsgroup', 'http://www.dns.be/xml/epp/nsgroup-1.0');
         $this->addNsgroup($createinfo);
     }
     $this->addSessionId();
 }
 function __construct($type)
 {
     parent::__construct();
     $check = $this->createElement($type);
     $this->domainobject = $this->createElement('domain:' . $type);
     if (!$this->rootNamespaces()) {
         $this->domainobject->setAttribute('xmlns:domain', 'urn:ietf:params:xml:ns:domain-1.0');
     }
     $check->appendChild($this->domainobject);
     $this->getCommand()->appendChild($check);
 }
 function __construct(eppRequest $request, $sudoUser)
 {
     $this->originalRequest = $request;
     parent::__construct();
     $ext = $this->createElement('extension');
     $extSudo = $this->createElement('ext:sudo');
     $ext->appendChild($extSudo);
     parent::getEpp()->appendChild($ext);
     $clID = $this->createElement('ext:clID');
     $clID->nodeValue = $sudoUser;
     $extSudo->appendChild($clID);
     $command = $request->getElementsByTagName('command');
     if ($command->length > 0) {
         $extCommand = $this->createElement('ext:command');
         $extSudo->appendChild($extCommand);
         foreach ($command as $child) {
             $node = $this->importNode($child, true);
             $extCommand->appendChild($node->firstChild);
             break;
         }
         $extension = $this->createElement('extension');
         $extensions = $request->getElementsByTagName('extension');
         if ($extensions->length > 0) {
             foreach ($extensions as $child) {
                 $node = $this->importNode($child, true);
                 $extension->appendChild($node->firstChild);
                 break;
             }
             $extCommand->appendChild($extension);
         }
     } else {
         $extCommand = $this->createElement('ext:extCommand');
         $extSudo->appendChild($extCommand);
         $command = $request->getElementsByTagName('ext:command');
         foreach ($command as $child) {
             $node = $this->importNode($child, true);
             $extCommand->appendChild($node->firstChild);
             break;
         }
     }
 }
 function __construct($domainname)
 {
     parent::__construct();
     if (is_string($domainname)) {
         if (strlen($domainname) > 0) {
             $this->addDnsbeExtension($domainname);
         } else {
             throw new eppException("Domain name length may not be 0 on eppAuthcodeRequest");
         }
     } else {
         throw new eppException("Domain name must be string on eppAuthcodeRequest");
     }
 }
 function __construct($newpassword = null)
 {
     parent::__construct();
     #
     # Login parameters
     #
     $this->login = $this->createElement('login');
     $this->getCommand()->appendChild($this->login);
     #
     # This is only the basic command structure.
     # Userid, password, version and language info will be added later by the connection object
     #
     $this->addSessionId();
 }
 public function setEppRequestExtension(eppRequest $request, \DOMElement $extension)
 {
     $request->addExtension('xmlns:xsi', atEppConstants::w3SchemaLocation);
     $contactExt_ = $request->createElement('at-ext-contact:update');
     $contactExt_->setAttribute('xmlns:at-ext-contact', atEppConstants::namespaceAtExtContact);
     $contactExt_->setAttribute('xsi:schemaLocation', atEppConstants::schemaLocationAtExtContact);
     $extChange_ = $request->createElement('at-ext-contact:chg');
     $facet_ = $request->createElement('at-ext-contact:type');
     $facet_->appendChild(new \DOMText($this->atEppContact->getPersonType()));
     $extChange_->appendChild($facet_);
     $contactExt_->appendChild($extChange_);
     $extension->appendchild($contactExt_);
     if (!is_null($this->additionaEppExtension)) {
         $this->additionaEppExtension->setEppRequestExtension($request, $extension);
     }
 }
Example #9
0
 function __destruct()
 {
     parent::__destruct();
 }
 /**
  * Write the content domDocument to the stream
  * Read the answer
  * Load the answer in a response domDocument
  * return the reponse
  *
  * @param eppRequest $content
  * @return eppResponse
  * @throws eppException
  */
 public function writeandread($content)
 {
     $requestsessionid = $content->getSessionId();
     $namespaces = $this->getDefaultNamespaces();
     if (is_array($namespaces)) {
         foreach ($namespaces as $id => $namespace) {
             $content->addExtension($id, $namespace);
         }
     }
     /*
      * $content->login is only set if this is an instance or a sub-instance of an eppLoginRequest
      */
     if ($content->login) {
         /* @var $content eppLoginRequest */
         // Set username for login request
         $content->addUsername($this->getUsername());
         // Set password for login request
         $content->addPassword($this->getPassword());
         // Set 'new password' for login request
         if ($this->getNewPassword()) {
             $content->addNewPassword($this->getNewPassword());
         }
         // Add version to this object
         $content->addVersion($this->getVersion());
         // Add language to this object
         $content->addLanguage($this->getLanguage());
         // Add services and extensions to this content
         $content->addServices($this->getServices(), $this->getExtensions());
     }
     /*
      * $content->hello is only set if this is an instance or a sub-instance of an eppHelloRequest
      */
     if (!$content->hello) {
         /**
          * Add used namespaces to the correct places in the XML
          */
         $content->addNamespaces($this->getServices());
         $content->addNamespaces($this->getExtensions());
     }
     $response = $this->createResponse($content);
     /* @var $response eppResponse */
     if (!$response) {
         throw new eppException("No valid response from server", 0, null, null, $content);
     }
     $content->formatOutput = true;
     $this->writeLog($content->saveXML(null, LIBXML_NOEMPTYTAG), "WRITE");
     $content->formatOutput = false;
     if ($this->write($content->saveXML(null, LIBXML_NOEMPTYTAG))) {
         $readcounter = 0;
         $xml = $this->read();
         // When no data is present on the stream, retry reading several times
         while (strlen($xml) == 0 && $readcounter < $this->retry) {
             $xml = $this->read();
             $readcounter++;
         }
         if (strlen($xml)) {
             set_error_handler(array($this, 'HandleXmlError'));
             if ($response->loadXML($xml)) {
                 restore_error_handler();
                 $this->writeLog($response->saveXML(null, LIBXML_NOEMPTYTAG), "READ");
                 /*
                 ob_flush();
                 */
                 $clienttransid = $response->getClientTransactionId();
                 if ($this->checktransactionids && $clienttransid && $clienttransid != $requestsessionid) {
                     throw new eppException("Client transaction id {$requestsessionid} does not match returned {$clienttransid}", 0, null, null, $xml);
                 }
                 $response->setXpath($this->getServices());
                 $response->setXpath($this->getExtensions());
                 $response->setXpath($this->getXpathExtensions());
                 if ($response instanceof eppHelloResponse) {
                     /* @var $response eppHelloResponse */
                     $response->validateServices($this->getLanguage(), $this->getVersion());
                 }
                 return $response;
             } else {
                 restore_error_handler();
             }
         } else {
             throw new eppException('Empty XML document when receiving data!');
         }
     } else {
         throw new eppException('Error writing content', 0, null, null, $content);
     }
     return null;
 }