Procházet zdrojové kódy

update createAccount

andre před 2 roky
rodič
revize
03ff616d08
1 změnil soubory, kde provedl 9 přidání a 8 odebrání
  1. 9 8
      app/Http/Actions/CreateAccount.php

+ 9 - 8
app/Http/Actions/CreateAccount.php

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