Explorar el Código

edit mailinglists

andre hace 2 años
padre
commit
4f7925270a

+ 18 - 2
app/UI/Client/DistributionList/Providers/EditListDataProvider.php

@@ -44,6 +44,11 @@ class EditListDataProvider extends AddListDataProvider
             "comparator" => "Eq",
             "value" => $this->actionElementId
         );
+        $userFields = array(
+            "hasId",
+            "emailAddress",
+            "kind"
+        );
 
         $api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
         try {
@@ -82,7 +87,18 @@ class EditListDataProvider extends AddListDataProvider
             );
             return ['error' => $error->getMessage()];
         }
-
+        try {
+            $members = $api->getMlUserList($userFields, $this->actionElementId);
+        } catch (KerioApiException $error) {
+            logModuleCall(
+                'kerioEmail',
+                __FUNCTION__,
+                $error,
+                'Debug Error',
+                $error->getMessage()
+            );
+            return ['error' => $error->getMessage()];
+        }
 
         $api->logout();
 
@@ -91,7 +107,7 @@ class EditListDataProvider extends AddListDataProvider
             __FUNCTION__,
             $list,
             'Debug Error',
-            $this->actionElementId
+            $members
         );
         /**
          * load hosting