andre пре 2 година
родитељ
комит
475e7de256
1 измењених фајлова са 9 додато и 10 уклоњено
  1. 9 10
      app/UI/Client/EmailAccount/Providers/AccountDataProvider.php

+ 9 - 10
app/UI/Client/EmailAccount/Providers/AccountDataProvider.php

@@ -73,7 +73,7 @@ class AccountDataProvider extends BaseDataProvider
         $maildomain = $this->getWhmcsParamByKey('customfields')['maildomain'];
         $api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
         try {
-            $api->login($params['serverhostname'], $params['serverusername'], $params['serverpassword']);
+            $api->login($this->getWhmcsParamByKey('serverhostname'), $this->getWhmcsParamByKey('serverusername'), $this->getWhmcsParamByKey('serverpassword'));
             $domainID = $api->getDomainId($maildomain);
         } catch (KerioApiException $error) {
             logModuleCall(
@@ -88,15 +88,6 @@ class AccountDataProvider extends BaseDataProvider
         if ($domainID === FALSE) {
             return "Error: Domain $maildomain not found";
         }
-
-        logModuleCall(
-            'kerioEmail',
-            __FUNCTION__,
-            $domainID,
-            'Debug Add Account',
-            $this->formData
-        );
-
         $active = $this->formData['status'] === 'active' ? TRUE : FALSE;
         try {
             $userID = $api->createUser($domainID, $this->formData['username'], $this->formData['password'], $active);
@@ -111,6 +102,14 @@ class AccountDataProvider extends BaseDataProvider
             return ['error' => $error->getMessage()];
         }             
 
+        logModuleCall(
+            'kerioEmail',
+            __FUNCTION__,
+            $domainID,
+            'Debug Add Account',
+            $userID
+        );
+
         $account['fullName'] = $this->formData['display_name'];
         if ($this->formData['quota'] > 0) {
             $account['diskSizeLimit']['isActive'] = TRUE;