|
|
@@ -2,19 +2,10 @@
|
|
|
|
|
|
namespace ThurData\Servers\KerioEmail\App\UI\Client\DistributionList\Providers;
|
|
|
|
|
|
-
|
|
|
use ThurData\Servers\KerioEmail\App\Enums\ProductParams;
|
|
|
use ThurData\Servers\KerioEmail\App\Enums\Kerio;
|
|
|
-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\Models\DistributionList;
|
|
|
-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\Update\UpdateDistributionList;
|
|
|
use function ThurData\Servers\KerioEmail\Core\Helper\di;
|
|
|
-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;
|
|
|
|
|
|
/**
|
|
|
@@ -49,7 +40,7 @@ class EditListDataProvider extends AddListDataProvider
|
|
|
"emailAddress",
|
|
|
"kind"
|
|
|
);
|
|
|
-
|
|
|
+ $domain = $this->getWhmcsParamByKey('domain');
|
|
|
$api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
|
|
|
try {
|
|
|
$api->login($this->getWhmcsParamByKey('serverhostname'), $this->getWhmcsParamByKey('serverusername'), $this->getWhmcsParamByKey('serverpassword'));
|
|
|
@@ -64,7 +55,7 @@ class EditListDataProvider extends AddListDataProvider
|
|
|
return ['error' => $error->getMessage()];
|
|
|
}
|
|
|
try {
|
|
|
- $domainID = $api->getDomainId($this->getWhmcsParamByKey('domain'));
|
|
|
+ $domainID = $api->getDomainId($domain);
|
|
|
} catch (KerioApiException $error) {
|
|
|
logModuleCall(
|
|
|
'kerioEmail',
|
|
|
@@ -130,18 +121,15 @@ class EditListDataProvider extends AddListDataProvider
|
|
|
}
|
|
|
$this->data['oldModerator'] = $this->data['moderator'];
|
|
|
foreach($accounts as $account) {
|
|
|
- $users[] = $account['loginName'] . '@' . $this->getWhmcsParamByKey('domain');
|
|
|
+ $users[] = $account['loginName'] . '@' . $domain;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * load lang
|
|
|
- */
|
|
|
$lang = di('lang');
|
|
|
|
|
|
$this->data['id'] = $list[0]['id'];
|
|
|
|
|
|
$this->data['listmail'] = $list[0]['name'];
|
|
|
- $this->data['domain'] = $this->getWhmcsParamByKey('domain');
|
|
|
+ $this->data['domain'] = $domain;
|
|
|
$this->data['description'] = $list[0]['description'];
|
|
|
$this->data['lang'] = $list[0]['languageId'];
|
|
|
$this->availableValues['lang'] = [ 'de' => $lang->absoluteT('german'), 'en' => $lang->absoluteT('english') ];
|