andre il y a 2 ans
Parent
commit
7ecb73ec34

+ 13 - 7
app/UI/Client/EmailAccount/Providers/EditAccountDataProvider.php

@@ -226,13 +226,19 @@ class EditAccountDataProvider extends BaseDataProvider
         $productManager = new ProductManager();
         $productManager->loadByHostingId($hid);
 
-        logModuleCall(
-            'kerioEmail',
-            __FUNCTION__,
-            $this->formData['status'],
-            'Debug UpdateStatus',
-            $this->formData['id']
-        );
+        $status['isEnabled'] = $this->formData['status'] === 'active' ? TRUE : FALSE;
+        try {
+            $result = $api->modifyUser($this->formData['id'], $status);
+        } catch (KerioApiException $error) {
+            logModuleCall(
+                'kerioEmail',
+                __FUNCTION__,
+                $error,
+                'Debug Error',
+                $error->getMessage()
+            );
+            return ['error' => $error->getMessage()];
+        }
 
         /**
          * return success