|
|
@@ -266,18 +266,19 @@ function zimbraSingleDeleteAccount($userData)
|
|
|
return 'success';
|
|
|
}
|
|
|
|
|
|
-function zimbraSingleChangePassword($userData, $encrypted) {
|
|
|
+function zimbraSingleChangePassword($params) {
|
|
|
$accessData = zimbraSingleGetAccess();
|
|
|
- if($encrypted == 'yes') {
|
|
|
- $passDecrypt = localAPI('DecryptPassword', array('password2' => $userData['password']));
|
|
|
- if ($passDecrypt['result'] == 'success') {
|
|
|
- $userData['password'] = $passDecrypt['password'];
|
|
|
- }
|
|
|
- }
|
|
|
- if ($checkPW = zimbraSingleCheckPassword($userData['password'])) {
|
|
|
+ if ($checkPW = zimbraSingleCheckPassword($params['password'])) {
|
|
|
return $checkPW;
|
|
|
}
|
|
|
- $account_name = $userData['username'] . '@' . $userData['maildomain'];
|
|
|
+ $account_name = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
+ logModuleCall(
|
|
|
+ 'zimbrasingle',
|
|
|
+ __FUNCTION__,
|
|
|
+ $account_name,
|
|
|
+ "Debug",
|
|
|
+ $params['password']
|
|
|
+ );
|
|
|
$api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
|
|
|
$login = $api->login();
|
|
|
if(is_a($login, "Exception")) {
|
|
|
@@ -291,7 +292,7 @@ function zimbraSingleChangePassword($userData, $encrypted) {
|
|
|
return false;
|
|
|
}
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
- $response = $apiAccountManager->setAccountPassword($account_name, $userData['password']);
|
|
|
+ $response = $apiAccountManager->setAccountPassword($account_name, $params['password']);
|
|
|
if(is_a($response, "Exception")) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|