andre 5 年之前
父節點
當前提交
37f36f8fb9
共有 1 個文件被更改,包括 16 次插入17 次删除
  1. 16 17
      zimbraSingle.php

+ 16 - 17
zimbraSingle.php

@@ -439,15 +439,6 @@ function zimbraSingle_SuspendAccount($params)
  */
 function zimbraSingle_UnsuspendAccount($params)
 {
-// Debug
-logModuleCall(
-    'zimbrasingle',
-    __FUNCTION__,
-    $whmcs,
-    "Debug",
-    $params
-);
-//
     $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], "admin");
     $login = $api->login();
     if(is_a($login, "Exception")) {
@@ -489,7 +480,6 @@ logModuleCall(
  */
 function zimbraSingle_TerminateAccount($params)
 {
-    $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
     $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], "admin");
     $login = $api->login();
     if(is_a($login, "Exception")) {
@@ -503,30 +493,30 @@ function zimbraSingle_TerminateAccount($params)
         return $login->getMessage();
     }
     $apiAccountManager = new Zm_Account($api);
-    $response = $apiAccountManager->getAccountStatus($accountName);
+    $response = $apiAccountManager->getAccountStatus($params['username']);
     if(is_a($response, "Exception")) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: account $accountName could not verified",
+            "Error: account ". $params['username'] . " could not verified",
             $response
         );
-        return "Error : account $accountName could not verified";
+        return "Error : account " . $params['username'] . " Name could not verified";
     }
     if ($response != 'locked') {
-        return "Account $accountName active, suspend account first!";
+        return "Account ". $params['username'] . " active, suspend account first!";
     }
-    $response = $apiAccountManager->deleteAccount($accountName);
+    $response = $apiAccountManager->deleteAccount($params['username']);
     if(is_a($response, "Exception")) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: account $accountName could not removed",
+            "Error: account ". $params['username'] . " could not removed",
             $response
         );
-        return "Error: account $accountName could not removed";
+        return "Error: account ". $params['username'] . " could not removed";
     }
     return 'success';
 }
@@ -549,6 +539,15 @@ function zimbraSingle_TerminateAccount($params)
  */
 function zimbraSingle_ChangePackage($params)
 {
+// Debug
+logModuleCall(
+    'zimbrasingle',
+    __FUNCTION__,
+    $whmcs,
+    "Debug",
+    $params
+);
+//
     $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
     $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], "admin");
     $login = $api->login();