|
@@ -505,26 +505,8 @@ function zimbraSingle_CreateAccount($params)
|
|
|
return $login->getMessage();
|
|
return $login->getMessage();
|
|
|
}
|
|
}
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
- $accountExists = $apiAccountManager->accountExists($account_name);
|
|
|
|
|
- if(is_a($accountExists, "Exception")) {
|
|
|
|
|
- logModuleCall(
|
|
|
|
|
- 'zimbrasingle',
|
|
|
|
|
- __FUNCTION__,
|
|
|
|
|
- $params,
|
|
|
|
|
- "Error: could not check account availibility",
|
|
|
|
|
- $accountExists
|
|
|
|
|
- );
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- logModuleCall(
|
|
|
|
|
- 'zimbrasingle',
|
|
|
|
|
- __FUNCTION__,
|
|
|
|
|
- $account_name,
|
|
|
|
|
- "Debug",
|
|
|
|
|
- $accountExists
|
|
|
|
|
- );
|
|
|
|
|
- if($accountExists) {
|
|
|
|
|
- return 'Account already exist';
|
|
|
|
|
|
|
+ if($apiAccountManager->accountExists($account_name)) {
|
|
|
|
|
+ return "Error: account $account_name already exists";
|
|
|
}
|
|
}
|
|
|
$attrs = array();
|
|
$attrs = array();
|
|
|
$attrs["gn"] = $params['customfields']["givenname"];
|
|
$attrs["gn"] = $params['customfields']["givenname"];
|