|
|
@@ -1,12 +1,6 @@
|
|
|
<?php
|
|
|
namespace ThurData\Servers\KerioEmail\App\UI\Client\DomainAlias\Providers;
|
|
|
-use ThurData\Servers\KerioEmail\App\Helpers\KerioManager;
|
|
|
-use ThurData\Servers\KerioEmail\App\Libs\Product\ProductManager;
|
|
|
-use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Repository;
|
|
|
-use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Services\Create\CreateDistributionList;
|
|
|
-use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Services\Create\CreateDomainAlias;
|
|
|
-use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Services\Delete\DeleteDomainAlias;
|
|
|
-use ThurData\Servers\KerioEmail\Core\Models\Whmcs\Hosting;
|
|
|
+
|
|
|
use ThurData\Servers\KerioEmail\Core\UI\ResponseTemplates\HtmlDataJsonResponse;
|
|
|
use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\DataProviders\BaseDataProvider;
|
|
|
use ThurData\Servers\KerioEmail\Api\KerioWhmcs;
|
|
|
@@ -24,12 +18,11 @@ class AddDomainAliasDataProvider extends BaseDataProvider
|
|
|
|
|
|
public function read()
|
|
|
{
|
|
|
- $hosting = Hosting::where('id', $this->getRequestValue('id'))->first();
|
|
|
-
|
|
|
+ $domain = $this->getWhmcsParamByKey('domain');
|
|
|
$api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
|
|
|
try {
|
|
|
$api->login($this->getWhmcsParamByKey('serverhostname'), $this->getWhmcsParamByKey('serverusername'), $this->getWhmcsParamByKey('serverpassword'));
|
|
|
- $domainID = $api->getDomainId($this->getWhmcsParamByKey('domain'));
|
|
|
+ $domainID = $api->getDomainId($domain);
|
|
|
} catch (KerioApiException $error) {
|
|
|
logModuleCall(
|
|
|
'kerioEmail',
|
|
|
@@ -42,7 +35,7 @@ class AddDomainAliasDataProvider extends BaseDataProvider
|
|
|
}
|
|
|
$api->logout();
|
|
|
$this->data['domainId'] = $domainID;
|
|
|
- $this->data['domain'] = $this->getWhmcsParamByKey('domain');
|
|
|
+ $this->data['domain'] = $domain;
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -54,6 +47,7 @@ class AddDomainAliasDataProvider extends BaseDataProvider
|
|
|
public function create()
|
|
|
{
|
|
|
|
|
|
+ $maildomain = $this->getWhmcsParamByKey('domain');
|
|
|
$api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
|
|
|
try {
|
|
|
$api->login($this->getWhmcsParamByKey('serverhostname'), $this->getWhmcsParamByKey('serverusername'), $this->getWhmcsParamByKey('serverpassword'));
|
|
|
@@ -69,7 +63,7 @@ class AddDomainAliasDataProvider extends BaseDataProvider
|
|
|
return ['error' => $error->getMessage()];
|
|
|
}
|
|
|
foreach($domains as $domain) {
|
|
|
- if(($domain['name']) === $this->getWhmcsParamByKey('domain')){
|
|
|
+ if($domain['name'] === $maildomain){
|
|
|
$domainID = $domain['id'];
|
|
|
$aliasList = $domain['aliasList'];
|
|
|
}
|