Browse Source

update createAccount

andre 2 năm trước cách đây
mục cha
commit
d4a74cca15
1 tập tin đã thay đổi với 19 bổ sung10 xóa
  1. 19 10
      app/Http/Actions/CreateAccount.php

+ 19 - 10
app/Http/Actions/CreateAccount.php

@@ -71,20 +71,29 @@ class CreateAccount extends AddonController
     protected function kerioRunService($params = null)
     {
         $api = new KerioConnectApi('whmcsKerioEmail', 'Thurdata', '1.0');
-
-        logModuleCall(
-            'kerioEmail',
-            __FUNCTION__,
-            $api,
-            'Debug Features & Attributes',
-            $params
-        );
-
         try {
             $api->login($params['serverhostname'], $params['serverusername'], $params['serverpassword']);
             $result = $api->sendRequest('Domains.get');
-            $api->logout();
+
+            logModuleCall(
+                'kerioEmail',
+                __FUNCTION__,
+                $api,
+                'Debug Features & Attributes',
+                $result
+            );
+    
+             $api->logout();
         } catch (KerioApiException $error) {
+
+            logModuleCall(
+                'kerioEmail',
+                __FUNCTION__,
+                $error,
+                'Debug Error',
+                $error->getMessage()
+            );
+    
             return ['error' => $error->getMessage()];
         }