|
|
@@ -1,22 +1,14 @@
|
|
|
<?php
|
|
|
namespace ThurData\Servers\KerioEmail\App\UI\Client\EmailAlias\Pages;
|
|
|
|
|
|
-
|
|
|
-use ThurData\Servers\KerioEmail\App\Helpers\KerioManager;
|
|
|
-use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Helpers\AccountHelper;
|
|
|
-use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Models\Account;
|
|
|
-use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Models\AccountAlias;
|
|
|
-use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Repository;
|
|
|
use ThurData\Servers\KerioEmail\App\UI\Client\EmailAlias\Buttons\AddEmailAliasButton;
|
|
|
use ThurData\Servers\KerioEmail\App\UI\Client\EmailAlias\Buttons\DeleteEmailAliasButton;
|
|
|
use ThurData\Servers\KerioEmail\App\UI\Client\EmailAlias\Buttons\MassDeleteEmailAliasButton;
|
|
|
-use ThurData\Servers\KerioEmail\Core\Models\Whmcs\Hosting;
|
|
|
use ThurData\Servers\KerioEmail\Core\UI\Interfaces\ClientArea;
|
|
|
use ThurData\Servers\KerioEmail\Core\UI\Widget\DataTable\Column;
|
|
|
use ThurData\Servers\KerioEmail\Core\UI\Widget\DataTable\DataProviders\DataProvider;
|
|
|
use ThurData\Servers\KerioEmail\Core\UI\Widget\DataTable\DataProviders\Providers\ArrayDataProvider;
|
|
|
use ThurData\Servers\KerioEmail\Core\UI\Widget\DataTable\DataTable;
|
|
|
-use ThurData\Servers\KerioEmail\Core\UI\Widget\Others\Label;
|
|
|
use ThurData\Servers\KerioEmail\Api\KerioWhmcs;
|
|
|
|
|
|
/**
|
|
|
@@ -62,11 +54,6 @@ class Aliases extends DataTable implements ClientArea
|
|
|
|
|
|
public function loadData()
|
|
|
{
|
|
|
- /**
|
|
|
- * load hosting
|
|
|
- */
|
|
|
- $hosting = Hosting::where('id', $this->getRequestValue('id'))->first();
|
|
|
-
|
|
|
$fields = array(
|
|
|
"id",
|
|
|
"name",
|
|
|
@@ -135,16 +122,11 @@ class Aliases extends DataTable implements ClientArea
|
|
|
*/
|
|
|
private function isCreateButtonDisabled()
|
|
|
{
|
|
|
- $hid = $this->getRequestValue('id');
|
|
|
-
|
|
|
- /**
|
|
|
- * hosting model
|
|
|
- */
|
|
|
- $hosting = Hosting::where('id', $hid)->first();
|
|
|
+ $domain = $this->getWhmcsParamByKey('domain');
|
|
|
$api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
|
|
|
try {
|
|
|
$api->login($this->getWhmcsParamByKey('serverhostname'), $this->getWhmcsParamByKey('serverusername'), $this->getWhmcsParamByKey('serverpassword'));
|
|
|
- $domains = $api->getDomains(['id','name']);
|
|
|
+ $domainID = $api->getDomainId($domain);
|
|
|
} catch (KerioApiException $error) {
|
|
|
logModuleCall(
|
|
|
'kerioEmail',
|
|
|
@@ -155,14 +137,8 @@ class Aliases extends DataTable implements ClientArea
|
|
|
);
|
|
|
return ['error' => $error->getMessage()];
|
|
|
}
|
|
|
- foreach($domains as $maildomain) {
|
|
|
- if(($maildomain['name']) === $this->getWhmcsParamByKey('domain')){
|
|
|
- $this->maildomainID = $maildomain['id'];
|
|
|
- $this->maildomain = $maildomain['name'];
|
|
|
- }
|
|
|
- }
|
|
|
try {
|
|
|
- $accCount = $api->countUser($this->maildomainID);
|
|
|
+ $accCount = $api->countUser($domainID);
|
|
|
} catch (KerioApiException $error) {
|
|
|
logModuleCall(
|
|
|
'kerioEmail',
|