-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added euridEppCreateDomainRequest for .EU domain names
- Loading branch information
1 parent
973cb71
commit d247134
Showing
6 changed files
with
82 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
Protocols/EPP/eppExtensions/domain-ext-2.1/eppRequests/euridEppCreateDomainRequest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
namespace Metaregistrar\EPP; | ||
|
||
/* | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"> | ||
<command> | ||
<create> | ||
<domain:create xmlns:domain='urn:ietf:params:xml:ns:domain-1.0'> | ||
<domain:name>domainname.eu</domain:name> | ||
<domain:ns> | ||
<domain:hostAttr> | ||
<domain:hostName>a.alpha.al</domain:hostName> | ||
</domain:hostAttr> | ||
<domain:hostAttr> | ||
<domain:hostName>b.bravo.bb</domain:hostName> | ||
</domain:hostAttr> | ||
</domain:ns> | ||
<domain:registrant>xxxxx</domain:registrant> | ||
<domain:contact type='billing'>xxxxx</domain:contact> | ||
</domain:create> | ||
</create> | ||
<extension> | ||
<domain-ext:create xmlns:domain-ext='http://www.eurid.eu/xml/epp/domain-ext-2.1'> | ||
<domain-ext:contact type='onsite'>xxxxx</domain-ext:contact> | ||
<domain-ext:contact type='reseller'>xxxxx</domain-ext:contact> | ||
</domain-ext:create> | ||
</extension> | ||
</command> | ||
</epp> | ||
*/ | ||
|
||
/** | ||
* Class euridEppCreateDomainRequest | ||
* @package Metaregistrar\EPP | ||
*/ | ||
class euridEppCreateDomainRequest extends eppCreateDomainRequest { | ||
|
||
function __construct(eppDomain $domain) { | ||
parent::__construct($domain, true); | ||
$this->addContacts($domain); | ||
parent::addSessionId(); | ||
|
||
} | ||
|
||
private function addContacts(eppDomain $domain) { | ||
$created = false; | ||
$create = $this->createElement('domain-ext:create'); | ||
$this->setNamespace('xmlns:domain','urn:ietf:params:xml:ns:domain-1.0',$create); | ||
$this->setNamespace('xmlns:domain-ext','http://www.eurid.eu/xml/epp/domain-ext-2.1',$create); | ||
|
||
foreach ($domain->getContacts() as $contact) { | ||
/* @var $contact \Metaregistrar\EPP\eppContactHandle */ | ||
if (in_array($contact->getContactType(),['onsite','reseller'])) { | ||
$c = $this->createElement('domain-ext:contact',$contact->getContactHandle()); | ||
$c->setAttribute('type',$contact->getContactType()); | ||
$create->appendChild($c); | ||
$created = true; | ||
} | ||
} | ||
if ($created) { | ||
$this->getExtension()->appendChild($create); | ||
} | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters