andre 2 年之前
父節點
當前提交
8b81388b57
共有 1 個文件被更改,包括 16 次插入1 次删除
  1. 16 1
      app/UI/Client/EmailAlias/Pages/Aliases.php

+ 16 - 1
app/UI/Client/EmailAlias/Pages/Aliases.php

@@ -141,6 +141,21 @@ class Aliases extends DataTable implements ClientArea
          * hosting model
          */
         $hosting = Hosting::where('id', $hid)->first();
+        $api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
+        try {
+            $api->login($this->getWhmcsParamByKey('serverhostname'), $this->getWhmcsParamByKey('serverusername'), $this->getWhmcsParamByKey('serverpassword'));
+//            $domains = $api->getDomains(['id','name']);
+        } catch (KerioApiException $error) {
+            logModuleCall(
+                'kerioEmail',
+                __FUNCTION__,
+                $error,
+                'Debug Error',
+                $error->getMessage()
+            );
+            return ['error' => $error->getMessage()];
+        }
+        $api->logout();
 
 /*        $accounts =(new KerioManager())
             ->getApiByHosting($hid)
@@ -154,7 +169,7 @@ class Aliases extends DataTable implements ClientArea
             __FUNCTION__,
             $hosting,
             'Debug Error',
-            $accounts
+            $$this->maildomain
         );
 
             return FALSE;