|
@@ -58,17 +58,8 @@ class MyMetricProvider implements ProviderInterface
|
|
|
public function usage()
|
|
public function usage()
|
|
|
{
|
|
{
|
|
|
$api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
|
|
$api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
|
|
|
-
|
|
|
|
|
- logModuleCall(
|
|
|
|
|
- 'kerioEmail',
|
|
|
|
|
- __FUNCTION__,
|
|
|
|
|
- $this->moduleParams,
|
|
|
|
|
- 'Debug Usage',
|
|
|
|
|
- $api
|
|
|
|
|
- );
|
|
|
|
|
-
|
|
|
|
|
try {
|
|
try {
|
|
|
- $api->login($params['serverhostname'], $params['serverusername'], $params['serverpassword']);
|
|
|
|
|
|
|
+ $api->login($this->moduleParams['serverhostname'], $this->moduleParams['serverusername'], $this->moduleParams['serverpassword']);
|
|
|
$domains = $api->getDomains(['id','name']);
|
|
$domains = $api->getDomains(['id','name']);
|
|
|
} catch (KerioApiException $error) {
|
|
} catch (KerioApiException $error) {
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
@@ -81,6 +72,13 @@ class MyMetricProvider implements ProviderInterface
|
|
|
return ['error' => $error->getMessage()];
|
|
return ['error' => $error->getMessage()];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ logModuleCall(
|
|
|
|
|
+ 'kerioEmail',
|
|
|
|
|
+ __FUNCTION__,
|
|
|
|
|
+ $this->moduleParams,
|
|
|
|
|
+ 'Debug Usage',
|
|
|
|
|
+ $domains
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
$usage = [];
|
|
$usage = [];
|
|
|
foreach ($domains as $domain)
|
|
foreach ($domains as $domain)
|