|
|
@@ -17,6 +17,7 @@ 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;
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
@@ -42,22 +43,29 @@ class EditAccountDataProvider extends BaseDataProvider
|
|
|
* load hosting
|
|
|
*/
|
|
|
$hosting = Hosting::where('id', $hid)->first();
|
|
|
-
|
|
|
- logModuleCall(
|
|
|
- 'kerioEmail',
|
|
|
- __FUNCTION__,
|
|
|
- $this->actionElementId,
|
|
|
- 'Debug Error',
|
|
|
- $hosting
|
|
|
- );
|
|
|
-
|
|
|
/**
|
|
|
* load api
|
|
|
*/
|
|
|
$api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
|
|
|
+ $fields =array(
|
|
|
+ 'id',
|
|
|
+ 'companyContactId',
|
|
|
+ 'loginName',
|
|
|
+ 'fullName',
|
|
|
+ 'description',
|
|
|
+ 'isEnabled',
|
|
|
+ 'emailAddresses',
|
|
|
+ );
|
|
|
+ $cond = array(
|
|
|
+ "fieldName" => "id",
|
|
|
+ "comparator" => "Eq",
|
|
|
+ "value" => $this->actionElementId
|
|
|
+ );
|
|
|
+
|
|
|
try {
|
|
|
$api->login($this->getWhmcsParamByKey('serverhostname'), $this->getWhmcsParamByKey('serverusername'), $this->getWhmcsParamByKey('serverpassword'));
|
|
|
-// $domains = $api->getDomains(['id','name']);
|
|
|
+ $account = $api->getUsers($fields,'',$cond);
|
|
|
+ $address = $api->getAddress($this->actionElementId);
|
|
|
} catch (KerioApiException $error) {
|
|
|
logModuleCall(
|
|
|
'kerioEmail',
|
|
|
@@ -69,6 +77,15 @@ class EditAccountDataProvider extends BaseDataProvider
|
|
|
return ['error' => $error->getMessage()];
|
|
|
}
|
|
|
$api->logout();
|
|
|
+
|
|
|
+ logModuleCall(
|
|
|
+ 'kerioEmail',
|
|
|
+ __FUNCTION__,
|
|
|
+ $account,
|
|
|
+ 'Debug Error',
|
|
|
+ $address
|
|
|
+ );
|
|
|
+
|
|
|
/*
|
|
|
$result = $repository->accounts->getAccountOptionsById($this->actionElementId);
|
|
|
|