Skip to content

Commit 51914a1

Browse files
committed
2 parents 72dfbee + 80a4fe4 commit 51914a1

File tree

6 files changed

+46
-15
lines changed

6 files changed

+46
-15
lines changed

Protocols/EPP/eppException.php

+14-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ class eppException extends \Exception {
1414
* @var string
1515
*/
1616
private $lastcommand = null;
17+
/**
18+
* @var $response
19+
*/
20+
private $response = null;
1721

1822
/**
1923
* eppException constructor.
@@ -23,8 +27,9 @@ class eppException extends \Exception {
2327
* @param string $reason
2428
* @param int $id
2529
* @param string $command
30+
* @param \Metaregistrar\EPP\eppResponse|null $response
2631
*/
27-
public function __construct($message = "", $code = 0, \Exception $previous = null, $reason = null, $command = null) {
32+
public function __construct($message = "", $code = 0, \Exception $previous = null, $reason = null, $command = null, $response = null) {
2833
$this->reason = $reason;
2934
$trace = $this->getTrace();
3035
$this->class = null;
@@ -35,6 +40,7 @@ public function __construct($message = "", $code = 0, \Exception $previous = nul
3540
/* @var $class \Metaregistrar\EPP\eppRequest */
3641
$this->lastcommand = $command;
3742
}
43+
$this->response = $response;
3844
parent::__construct($message, $code, $previous);
3945
}
4046

@@ -58,5 +64,12 @@ public function getClass() {
5864
public function getReason() {
5965
return $this->reason;
6066
}
67+
68+
/**
69+
* @return \Metaregistrar\EPP\eppResponse|null
70+
*/
71+
public function getResponse() {
72+
return $this->response;
73+
}
6174
}
6275

Protocols/EPP/eppExtensions/no-ext-domain-1.1/eppData/noridEppDomain.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class noridEppDomain extends eppDomain {
88
private $extNotifyEmail = null;
99
private $extDeleteFromDNS = null;
1010
private $extDeleteFromRegistry = null;
11-
private $extApplicantDatasetVersionNumber = '2.0';
11+
private $extApplicantDatasetVersionNumber = '3.0';
1212
private $extApplicantDatasetAcceptName = null;
1313
private $extApplicantDatasetAcceptDate = null;
1414

Protocols/EPP/eppExtensions/no-ext-domain-1.1/eppRequests/noridEppTransferRequest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ class noridEppTransferRequest extends eppTransferRequest {
1313

1414
function __construct($operation, $object) {
1515
parent::__construct($operation, $object);
16-
$remove = $this->getElementsByTagName('command');
17-
foreach ($remove as $node) {
18-
$node->parentNode->removeChild($node);
19-
}
2016
if ($operation == self::OPERATION_EXECUTE) {
17+
$remove = $this->getElementsByTagName('command');
18+
foreach ($remove as $node) {
19+
$node->parentNode->removeChild($node);
20+
}
2121
if ($object instanceof noridEppDomain) {
2222
$this->setExtDomainExecute($object);
2323
} else {

Protocols/EPP/eppExtensions/no-ext-domain-1.1/eppRequests/noridEppUpdateDomainRequest.php

+23-5
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,23 @@ class noridEppUpdateDomainRequest extends eppDnssecUpdateDomainRequest {
77

88
use noridEppDomainRequestTrait;
99

10-
function __construct(noridEppDomain $domain, $addinfo = null, $removeinfo = null, $updateinfo = null, $forcehostattr = false, $namespacesinroot = true) {
11-
parent::__construct($domain, $addinfo, $removeinfo, $updateinfo, $forcehostattr, $namespacesinroot);
12-
$this->setExtDomain($domain);
10+
function __construct($objectname, $addinfo = null, $removeinfo = null, $updateinfo = null, $forcehostattr = false, $namespacesinroot = true) {
11+
if ($objectname instanceof eppDomain) {
12+
$domainname = $objectname->getDomainName();
13+
} else {
14+
$domainname = $objectname;
15+
}
16+
if ($updateinfo === null) {
17+
$updateinfo = new noridEppDomain($domainname);
18+
}
19+
if ($objectname instanceof noridEppDomain) {
20+
$dataset = $objectname->getExtApplicantDataset();
21+
if ($dataset['versionNumber'] !== null && $dataset['acceptName'] !== null && $dataset['acceptDate'] !== null) {
22+
$updateinfo->setExtApplicantDataset($dataset['versionNumber'], $dataset['acceptName'], $dataset['acceptDate']);
23+
}
24+
}
25+
parent::__construct($domainname, $addinfo, $removeinfo, $updateinfo, $forcehostattr, $namespacesinroot);
26+
$this->setExtDomain($updateinfo);
1327
$this->addSessionId();
1428
}
1529

@@ -20,8 +34,12 @@ public function setExtDomain(noridEppDomain $domain) {
2034

2135
private function addDomainExtApplicantDataset(noridEppDomain $domain) {
2236
$dataset = $domain->getExtApplicantDataset();
23-
if ($domain->getRegistrant() && (is_null($dataset['versionNumber']) || is_null($dataset['acceptName']) || is_null($dataset['acceptDate']))) {
24-
throw new eppException('A valid applicant dataset is required to perform an owner change on a domain in the Norid registry');
37+
if ($dataset['versionNumber'] === null || $dataset['acceptName'] === null || $dataset['acceptDate'] === null) {
38+
if ($domain->getRegistrant()) {
39+
throw new eppException('A valid applicant dataset is required to perform an owner change on a domain in the Norid registry');
40+
} else {
41+
return;
42+
}
2543
}
2644
$datasetElement = $this->createElement('no-ext-domain:applicantDataset');
2745
$datasetElement->appendChild($this->createElement('no-ext-domain:versionNumber', $dataset['versionNumber']));

Protocols/EPP/eppExtensions/nsgroup-1.0/eppResponses/dnsbeEppInfoNsgroupResponse.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ public function getNsgroupHosts() {
4848
$xpath = $this->xPath();
4949
$result = $xpath->query('/epp:epp/epp:response/epp:resData/nsgroup:infData/nsgroup:ns');
5050
if ($result->length > 0) {
51-
foreach ($result->item as $item) {
51+
foreach ($result as $item) {
5252
$return[] = $item->nodeValue;
5353
}
5454
}
5555
return $return;
5656
}
57-
}
57+
}

Protocols/EPP/eppResponses/eppResponse.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ public function Success() {
182182
}
183183
if ((is_array($this->exceptions)) && (count($this->exceptions)>0)) {
184184
foreach ($this->exceptions as $exceptionhandler) {
185-
throw new $exceptionhandler($errorstring, $resultcode, null, $resultreason, $this->saveXML());
185+
throw new $exceptionhandler($errorstring, $resultcode, null, $resultreason, $this->saveXML(), $this);
186186
}
187187
} else {
188-
throw new eppException($errorstring, $resultcode, null, $resultreason, $this->saveXML());
188+
throw new eppException($errorstring, $resultcode, null, $resultreason, $this->saveXML(), $this);
189189
}
190190

191191
} else {

0 commit comments

Comments
 (0)