|
|
@@ -144,7 +144,25 @@ class Aliases extends DataTable implements ClientArea
|
|
|
$api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
|
|
|
try {
|
|
|
$api->login($this->getWhmcsParamByKey('serverhostname'), $this->getWhmcsParamByKey('serverusername'), $this->getWhmcsParamByKey('serverpassword'));
|
|
|
-// $domains = $api->getDomains(['id','name']);
|
|
|
+ $domains = $api->getDomains(['id','name']);
|
|
|
+ } catch (KerioApiException $error) {
|
|
|
+ logModuleCall(
|
|
|
+ 'kerioEmail',
|
|
|
+ __FUNCTION__,
|
|
|
+ $error,
|
|
|
+ 'Debug Error',
|
|
|
+ $error->getMessage()
|
|
|
+ );
|
|
|
+ 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);
|
|
|
} catch (KerioApiException $error) {
|
|
|
logModuleCall(
|
|
|
'kerioEmail',
|
|
|
@@ -167,7 +185,7 @@ class Aliases extends DataTable implements ClientArea
|
|
|
logModuleCall(
|
|
|
'kerioEmail',
|
|
|
__FUNCTION__,
|
|
|
- $hosting,
|
|
|
+ $accCount,
|
|
|
'Debug Error',
|
|
|
$this->maildomain
|
|
|
);
|