فهرست منبع

bugfix MetricProvider

andre 2 سال پیش
والد
کامیت
32946c30ef
1فایلهای تغییر یافته به همراه8 افزوده شده و 10 حذف شده
  1. 8 10
      app/Libs/Metrics/MyMetricProvider.php

+ 8 - 10
app/Libs/Metrics/MyMetricProvider.php

@@ -58,17 +58,8 @@ class MyMetricProvider implements ProviderInterface
     public function usage()
     {
         $api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
-
-        logModuleCall(
-            'kerioEmail',
-            __FUNCTION__,
-            $this->moduleParams,
-            'Debug Usage',
-            $api
-        );
-
         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']);
         } catch (KerioApiException $error) {
             logModuleCall(
@@ -81,6 +72,13 @@ class MyMetricProvider implements ProviderInterface
             return ['error' => $error->getMessage()];
         }
 
+        logModuleCall(
+            'kerioEmail',
+            __FUNCTION__,
+            $this->moduleParams,
+            'Debug Usage',
+            $domains
+        );
 
         $usage = [];
         foreach ($domains as $domain)