Skip to content

Commit b6eac54

Browse files
author
Cameron Hall
authored
Merge pull request #46 from SynergyWholesale/bugfix/contact-updates
Fixed #45: Admin and billing contacts may now be updated
2 parents 6df6a19 + 76ecd3e commit b6eac54

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ Synergy Wholesale WHMCS Domains Module
1515
### Removed
1616
-
1717

18+
## 2.1.11 [Updated 29/10/2020]
19+
### Fixed
20+
- Fixed admin and billing contacts not being updatable. Fixes [#45](https://github.com/SynergyWholesale/WHMCS-Domains-Module/issues/45)
21+
22+
## 2.1.10 [Updated 09/10/2020]
23+
### Fixed
24+
- Fixed transfer domain conditions incorrectly testing against the SLD and not the TLD.
25+
1826
## 2.1.9 [Updated 25/08/2020]
1927
### Fixed
2028
- Fixed internal transfers not being renewed upon transfer-in. Fixes [#33](https://github.com/SynergyWholesale/WHMCS-Domains-Module/issues/33)

modules/registrars/synergywholesaledomains/synergywholesaledomains.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ function synergywholesaledomains_RegisterDomain(array $params)
632632
*/
633633
function synergywholesaledomains_TransferDomain(array $params)
634634
{
635-
if (preg_match('/\.uk$/', $params['sld'])) {
635+
if (preg_match('/\.uk$/', $params['tld'])) {
636636
return synergywholesaledomains_apiRequest('transferDomain', $params);
637637
}
638638

@@ -641,7 +641,7 @@ function synergywholesaledomains_TransferDomain(array $params)
641641
'doRenewal' => 1,
642642
];
643643

644-
if (preg_match('/\.au$/', $params['sld'])) {
644+
if (preg_match('/\.au$/', $params['tld'])) {
645645
$canRenew = synergywholesaledomains_apiRequest('domainRenewRequired', $params, $request, false);
646646
$request['doRenewal'] = (int) ('on' === $params['doRenewal'] && 'OK_RENEWAL' === $canRenew['status']);
647647
}
@@ -1118,7 +1118,6 @@ function synergywholesaledomains_GetContactDetails(array $params)
11181118
$idProtectStatus = synergywholesaledomains_apiRequest('domainInfo', $params, [], false);
11191119
$command = ('Enabled' === $idProtectStatus['idProtect'] ? 'listProtectedContacts' : 'listContacts');
11201120
$contacts = synergywholesaledomains_apiRequest($command, $params, [], false);
1121-
11221121
$response = [];
11231122

11241123
$map = [
@@ -1135,7 +1134,14 @@ function synergywholesaledomains_GetContactDetails(array $params)
11351134
'email' => 'Email',
11361135
];
11371136

1138-
foreach (['registrant', 'tech', 'billing', 'admin'] as $contact) {
1137+
$contactTypes = ['registrant'];
1138+
foreach (['admin', 'billing', 'tech'] as $otherTypes) {
1139+
if (isset($contacts[$otherTypes])) {
1140+
$contactTypes[] = $otherTypes;
1141+
}
1142+
}
1143+
1144+
foreach ($contactTypes as $contact) {
11391145
$whmcs_contact = ucfirst($contact);
11401146
$response[$whmcs_contact] = [];
11411147
foreach ($map as $from => $to) {

0 commit comments

Comments
 (0)