|
|
@@ -213,6 +213,15 @@ function zimbraSingleUnsuspendAccount($userData)
|
|
|
function zimbraSingleDeleteAccount($userData)
|
|
|
{
|
|
|
$accessData = zimbraSingleGetAccess();
|
|
|
+
|
|
|
+ logModuleCall(
|
|
|
+ 'zimbrasingle',
|
|
|
+ __FUNCTION__,
|
|
|
+ $params,
|
|
|
+ "debug: accessdata",
|
|
|
+ $accessData
|
|
|
+ );
|
|
|
+
|
|
|
$account_name = $userData['username'] . '@' . $userData['maildomain'];
|
|
|
|
|
|
$api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
|
|
|
@@ -226,35 +235,34 @@ function zimbraSingleDeleteAccount($userData)
|
|
|
""
|
|
|
);
|
|
|
return false;
|
|
|
- } else {
|
|
|
- $apiAccountManager = new Zm_Account($api);
|
|
|
- $response = $apiAccountManager->getAccountStatus($account_name);
|
|
|
- if(is_a($response, "Exception")) {
|
|
|
- logModuleCall(
|
|
|
- 'zimbrasingle',
|
|
|
- __FUNCTION__,
|
|
|
- $params,
|
|
|
- "Error : account $account_name could not verified",
|
|
|
- ""
|
|
|
- );
|
|
|
- return false;
|
|
|
- }
|
|
|
- if ($response != 'locked') {
|
|
|
- return "Account $account_name active, suspend account first";
|
|
|
- }
|
|
|
- $response = $apiAccountManager->deleteAccount($account_name);
|
|
|
- if(is_a($response, "Exception")) {
|
|
|
- logModuleCall(
|
|
|
- 'zimbrasingle',
|
|
|
- __FUNCTION__,
|
|
|
- $params,
|
|
|
- "Error : account $account_name could not removed",
|
|
|
- ""
|
|
|
- );
|
|
|
- return false;
|
|
|
- }
|
|
|
- return 'success';
|
|
|
}
|
|
|
+ $apiAccountManager = new Zm_Account($api);
|
|
|
+ $response = $apiAccountManager->getAccountStatus($account_name);
|
|
|
+ if(is_a($response, "Exception")) {
|
|
|
+ logModuleCall(
|
|
|
+ 'zimbrasingle',
|
|
|
+ __FUNCTION__,
|
|
|
+ $params,
|
|
|
+ "Error : account $account_name could not verified",
|
|
|
+ ""
|
|
|
+ );
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($response != 'locked') {
|
|
|
+ return "Account $account_name active, suspend account first";
|
|
|
+ }
|
|
|
+ $response = $apiAccountManager->deleteAccount($account_name);
|
|
|
+ if(is_a($response, "Exception")) {
|
|
|
+ logModuleCall(
|
|
|
+ 'zimbrasingle',
|
|
|
+ __FUNCTION__,
|
|
|
+ $params,
|
|
|
+ "Error : account $account_name could not removed",
|
|
|
+ ""
|
|
|
+ );
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return 'success';
|
|
|
}
|
|
|
|
|
|
function zimbraSingleChangePassword($userData) {
|