|
|
@@ -363,7 +363,7 @@ function zimbraSingle_ClientArea($params)
|
|
|
{
|
|
|
$accessData = zimbraSingleGetAccess();
|
|
|
$clientInfo = array();
|
|
|
- $account_name = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
+ $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
$api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
|
|
|
$login = $api->login();
|
|
|
if(is_a($login, "Exception")) {
|
|
|
@@ -377,24 +377,24 @@ function zimbraSingle_ClientArea($params)
|
|
|
return false;
|
|
|
}
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
- $quota = $apiAccountManager->getQuota($account_name);
|
|
|
+ $quota = $apiAccountManager->getQuota($accountName);
|
|
|
if(is_a($quota, "Exception")) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error : could not find $account_name",
|
|
|
+ "Error : could not find $accountName",
|
|
|
$quota
|
|
|
);
|
|
|
return false;
|
|
|
}
|
|
|
- $response = $apiAccountManager->getMailbox($account_name);
|
|
|
+ $response = $apiAccountManager->getMailbox($accountName);
|
|
|
if(is_a($response, "Exception")) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: could not fetch mailbox info for $account_name",
|
|
|
+ "Error: could not fetch mailbox info for $accountName",
|
|
|
$response
|
|
|
);
|
|
|
return false;
|
|
|
@@ -404,13 +404,13 @@ function zimbraSingle_ClientArea($params)
|
|
|
$clientInfo['quota'] = bytesToHuman($quota);
|
|
|
$clientInfo['size'] = bytesToHuman($mboxSize);
|
|
|
$clientInfo['usage'] = round($usagePercent, 2);
|
|
|
- $response = $apiAccountManager->getAccountInfo($account_name);
|
|
|
+ $response = $apiAccountManager->getAccountInfo($accountName);
|
|
|
if(is_a($response, "Exception")) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: could not gather informations for $account_name",
|
|
|
+ "Error: could not gather informations for $accountName",
|
|
|
$response
|
|
|
);
|
|
|
return false;
|
|
|
@@ -445,7 +445,7 @@ function zimbraSingle_ChangePassword($params)
|
|
|
if ($checkPW = zimbraSingleCheckPassword($params['password'])) {
|
|
|
return $checkPW;
|
|
|
}
|
|
|
- $account_name = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
+ $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
$api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
|
|
|
$login = $api->login();
|
|
|
if(is_a($login, "Exception")) {
|
|
|
@@ -459,13 +459,13 @@ function zimbraSingle_ChangePassword($params)
|
|
|
return false;
|
|
|
}
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
- $response = $apiAccountManager->setAccountPassword($account_name, $params['password']);
|
|
|
+ $response = $apiAccountManager->setAccountPassword($accountName, $params['password']);
|
|
|
if(is_a($response, "Exception")) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: password for $account_name could not be set",
|
|
|
+ "Error: password for $accountName could not be set",
|
|
|
$response
|
|
|
);
|
|
|
return false;
|
|
|
@@ -504,21 +504,21 @@ function zimbraSingle_CreateAccount($params)
|
|
|
);
|
|
|
return "Error: cannot login to " . $accessData['zimbraServer'];
|
|
|
}
|
|
|
- $account_name = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
+ $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
- $accountExists = $apiAccountManager->accountExists($account_name);
|
|
|
+ $accountExists = $apiAccountManager->accountExists($accountName);
|
|
|
if(is_a($accountExists, "Exception")) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$accessData,
|
|
|
- "Error: could not verify $account_name",
|
|
|
+ "Error: could not verify $accountName",
|
|
|
$accountExists
|
|
|
);
|
|
|
- return "Error: could not verify $account_name";
|
|
|
+ return "Error: could not verify $accountName";
|
|
|
}
|
|
|
if($accountExists === true) {
|
|
|
- return "Error: account $account_name already exists";
|
|
|
+ return "Error: account $accountName already exists";
|
|
|
}
|
|
|
$attrs = array();
|
|
|
$attrs["gn"] = $params['customfields']["givenname"];
|
|
|
@@ -549,16 +549,16 @@ function zimbraSingle_CreateAccount($params)
|
|
|
return "Error: serviceclass not available";
|
|
|
}
|
|
|
$attrs['zimbraCOSId'] = $cosID;
|
|
|
- $id = $apiAccountManager->createAccount($account_name, $params['customfields']['password'], $attrs);
|
|
|
+ $id = $apiAccountManager->createAccount($accountName, $params['customfields']['password'], $attrs);
|
|
|
if(is_a($id, "Exception")) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: account $account_name not created",
|
|
|
+ "Error: account $accountName not created",
|
|
|
$id
|
|
|
);
|
|
|
- return "Error: account $account_name not created";
|
|
|
+ return "Error: account $accountName not created";
|
|
|
}
|
|
|
return 'success';
|
|
|
}
|
|
|
@@ -579,7 +579,7 @@ function zimbraSingle_CreateAccount($params)
|
|
|
function zimbraSingle_SuspendAccount($params)
|
|
|
{
|
|
|
$accessData = zimbraSingleGetAccess();
|
|
|
- $account_name = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
+ $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
$api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
|
|
|
$login = $api->login();
|
|
|
if(is_a($login, "Exception")) {
|
|
|
@@ -593,13 +593,13 @@ function zimbraSingle_SuspendAccount($params)
|
|
|
return $login->getMessage();
|
|
|
}
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
- $response = $apiAccountManager->setAccountStatus($account_name, "locked");
|
|
|
+ $response = $apiAccountManager->setAccountStatus($accountName, "locked");
|
|
|
if(is_a($response, "Exception")) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: account $account_name could not locked",
|
|
|
+ "Error: account $accountName could not locked",
|
|
|
$response
|
|
|
);
|
|
|
return false;
|
|
|
@@ -623,7 +623,7 @@ function zimbraSingle_SuspendAccount($params)
|
|
|
function zimbraSingle_UnsuspendAccount($params)
|
|
|
{
|
|
|
$accessData = zimbraSingleGetAccess();
|
|
|
- $account_name = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
+ $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
$api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
|
|
|
$login = $api->login();
|
|
|
if(is_a($login, "Exception")) {
|
|
|
@@ -637,16 +637,16 @@ function zimbraSingle_UnsuspendAccount($params)
|
|
|
return $login->getMessage();
|
|
|
}
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
- $response = $apiAccountManager->setAccountStatus($account_name, "active");
|
|
|
+ $response = $apiAccountManager->setAccountStatus($accountName, "active");
|
|
|
if(is_a($response, "Exception")) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: account $account_name could not unlocked",
|
|
|
+ "Error: account $accountName could not unlocked",
|
|
|
$response
|
|
|
);
|
|
|
- return "Error: account $account_name could not unlocked";
|
|
|
+ return "Error: account $accountName could not unlocked";
|
|
|
}
|
|
|
return 'success';
|
|
|
}
|
|
|
@@ -727,7 +727,7 @@ function zimbraSingle_TerminateAccount($params)
|
|
|
function zimbraSingle_ChangePackage($params)
|
|
|
{
|
|
|
$accessData = zimbraSingleGetAccess();
|
|
|
- $account_name = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
+ $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
$api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
|
|
|
$login = $api->login();
|
|
|
if(is_a($login, "Exception")) {
|
|
|
@@ -741,16 +741,16 @@ function zimbraSingle_ChangePackage($params)
|
|
|
return $login->getMessage();
|
|
|
}
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
- $response = $apiAccountManager->setAccountCos($account_name, $params['configoption1']);
|
|
|
+ $response = $apiAccountManager->setAccountCos($accountName, $params['configoption1']);
|
|
|
if(is_a($response, "Exception")) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: class of service for $account_name could not be set",
|
|
|
+ "Error: class of service for $accountName could not be set",
|
|
|
$response
|
|
|
);
|
|
|
- return "Error: class of service for $account_name could not be set";
|
|
|
+ return "Error: class of service for $accountName could not be set";
|
|
|
}
|
|
|
return 'success';
|
|
|
}
|