ソースを参照

debug delete account

andre 5 年 前
コミット
2645d368ef
1 ファイル変更15 行追加7 行削除
  1. 15 7
      zimbraSingle.inc

+ 15 - 7
zimbraSingle.inc

@@ -213,7 +213,7 @@ function zimbraSingleUnsuspendAccount($userData)
 function zimbraSingleDeleteAccount($userData)
 {
     $accessData = zimbraSingleGetAccess();
-    $account_name = $userData['username'] . '@' . $userData['maildomain'];
+    $accountName = $userData['username'] . '@' . $userData['maildomain'];
 
     logModuleCall(
         'zimbrasingle',
@@ -223,7 +223,6 @@ function zimbraSingleDeleteAccount($userData)
         $account_name
         );
 
-
     $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
     $login = $api->login();
     if(is_a($login, "Exception")) {
@@ -237,27 +236,36 @@ function zimbraSingleDeleteAccount($userData)
         return false;
     }
     $apiAccountManager = new Zm_Account($api);
-    $response = $apiAccountManager->getAccountStatus($account_name);
+    $response = $apiAccountManager->getAccountStatus($accountName);
     if(is_a($response, "Exception")) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error : account $account_name could not verified",
+            "Error : account $accountName could not verified",
             ""
         );
         return false;
     }
+
+    logModuleCall(
+        'zimbrasingle',
+        __FUNCTION__,
+        $params,
+        "debug: account status",
+        $response
+        );
+
     if ($response != 'locked') {
-        return "Account $account_name active, suspend account first";
+        return "Account $accountName active, suspend account first";
     }
-    $response = $apiAccountManager->deleteAccount($account_name);
+    $response = $apiAccountManager->deleteAccount($accountName);
     if(is_a($response, "Exception")) {
         logModuleCall(
         'zimbrasingle',
         __FUNCTION__,
         $params,
-        "Error : account $account_name could not removed",
+        "Error : account $accountName could not removed",
         ""
         );
         return false;