|
|
@@ -258,15 +258,6 @@ function zimbraSingle_UsageUpdate($params) {
|
|
|
*/
|
|
|
function zimbraSingle_ChangePassword($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")) {
|
|
|
@@ -274,20 +265,19 @@ logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: cannot login to " . $accessData['zimbraServer'],
|
|
|
+ "Error: cannot login to " . $params['serverip'],
|
|
|
$login
|
|
|
);
|
|
|
return false;
|
|
|
}
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
- $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
- $response = $apiAccountManager->setAccountPassword($accountName, $params['password']);
|
|
|
+ $response = $apiAccountManager->setAccountPassword($params['username'], $params['password']);
|
|
|
if(is_a($response, "Exception")) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: password for $accountName could not be set",
|
|
|
+ "Error: password for " . $params['username'] . " could not be set",
|
|
|
$response
|
|
|
);
|
|
|
return false;
|
|
|
@@ -407,7 +397,15 @@ return 'success';
|
|
|
*/
|
|
|
function zimbraSingle_SuspendAccount($params)
|
|
|
{
|
|
|
- $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
+// 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")) {
|
|
|
@@ -421,13 +419,13 @@ function zimbraSingle_SuspendAccount($params)
|
|
|
return $login->getMessage();
|
|
|
}
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
- $response = $apiAccountManager->setAccountStatus($accountName, "locked");
|
|
|
+ $response = $apiAccountManager->setAccountStatus($params['username'], "locked");
|
|
|
if(is_a($response, "Exception")) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: account $accountName could not locked",
|
|
|
+ "Error: account " . $params['username'] . " could not locked",
|
|
|
$response
|
|
|
);
|
|
|
return false;
|