|
|
@@ -10,8 +10,8 @@
|
|
|
* @license GPL
|
|
|
*/
|
|
|
|
|
|
-if (!defined("WHMCS")) {
|
|
|
- die("This file cannot be accessed directly");
|
|
|
+if (!defined('WHMCS')) {
|
|
|
+ die('This file cannot be accessed directly');
|
|
|
}
|
|
|
use WHMCS\Database\Capsule;
|
|
|
|
|
|
@@ -20,10 +20,10 @@ use WHMCS\Database\Capsule;
|
|
|
* This is an extend version of:
|
|
|
* @see https://github.com/alloylab/zimbra-admin-api-soap-php
|
|
|
*/
|
|
|
-require_once("api/Zm/Auth.php");
|
|
|
-require_once("api/Zm/Account.php");
|
|
|
-require_once("api/Zm/Domain.php");
|
|
|
-require_once("api/Zm/Server.php");
|
|
|
+require_once('api/Zm/Auth.php');
|
|
|
+require_once('api/Zm/Account.php');
|
|
|
+require_once('api/Zm/Domain.php');
|
|
|
+require_once('api/Zm/Server.php');
|
|
|
|
|
|
/**
|
|
|
* Helper function to find values of a named key in a multidimensional arrays or objects
|
|
|
@@ -90,19 +90,19 @@ function zimbraSingle_MetaData()
|
|
|
*/
|
|
|
function zimbraSingle_TestConnection($params)
|
|
|
{
|
|
|
- $auth = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], "admin");
|
|
|
+ $auth = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
|
|
|
$login = $auth->login();
|
|
|
- if(is_a($login, "Exception")) {
|
|
|
+ if(is_a($login, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Connection failed, cannot login to " . $params['serverip'],
|
|
|
+ 'Connection failed, cannot login to ' . $params['serverip'],
|
|
|
$login->getMessage()
|
|
|
);
|
|
|
return array(
|
|
|
'success' => false,
|
|
|
- 'error' => "Connection failed, cannot login to " . $params['serverip'],
|
|
|
+ 'error' => 'Connection failed, cannot login to ' . $params['serverip'],
|
|
|
);
|
|
|
}
|
|
|
return array(
|
|
|
@@ -144,26 +144,26 @@ function zimbraSingle_TestConnection($params)
|
|
|
function zimbraSingle_ClientArea($params)
|
|
|
{
|
|
|
$clientInfo = array();
|
|
|
- $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], "admin");
|
|
|
+ $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
|
|
|
$login = $api->login();
|
|
|
- if(is_a($login, "Exception")) {
|
|
|
+ if(is_a($login, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: cannot login to " . $accessData['zimbraServer'],
|
|
|
+ 'Error: cannot login to ' . $accessData['zimbraServer'],
|
|
|
$login->getMessage()
|
|
|
);
|
|
|
return false;
|
|
|
}
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
$accountInfo = $apiAccountManager->getAccountInfo($params['username']);
|
|
|
- if(is_a($accountInfo, "Exception")) {
|
|
|
+ if(is_a($accountInfo, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: could not gather informations for " . $params['username'],
|
|
|
+ 'Error: could not gather informations for ' . $params['username'],
|
|
|
$accountInfo->getMessage()
|
|
|
);
|
|
|
return false;
|
|
|
@@ -186,14 +186,14 @@ function zimbraSingle_ClientArea($params)
|
|
|
* @see https://developers.whmcs.com/provisioning-modules/usage-update/
|
|
|
*/
|
|
|
function zimbraSingle_UsageUpdate($params) {
|
|
|
- $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], "admin");
|
|
|
+ $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
|
|
|
$login = $api->login();
|
|
|
- if(is_a($login, "Exception")) {
|
|
|
+ if(is_a($login, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: cannot login to " . $params['serverip'],
|
|
|
+ 'Error: cannot login to ' . $params['serverip'],
|
|
|
$login->getMessage()
|
|
|
);
|
|
|
return false;
|
|
|
@@ -207,22 +207,22 @@ function zimbraSingle_UsageUpdate($params) {
|
|
|
foreach((array)$productsObj as $productObj) {
|
|
|
$product = get_object_vars($productObj[0]);
|
|
|
$accountQuota = $apiAccountManager->getQuota($product['username']);
|
|
|
- if(is_a($accountQuota, "Exception")) {
|
|
|
+ if(is_a($accountQuota, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error : could not find quota for " . $product['username'],
|
|
|
+ 'Error : could not find quota for ' . $product['username'],
|
|
|
$accountQuota->getMessage()
|
|
|
);
|
|
|
}
|
|
|
$mboxObj = $apiAccountManager->getMailbox($product['username']);
|
|
|
- if(is_a($mboxObj, "Exception")) {
|
|
|
+ if(is_a($mboxObj, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: could not fetch mailbox info for " . $product['username'],
|
|
|
+ 'Error: could not fetch mailbox info for ' . $product['username'],
|
|
|
$mboxObj->getMessage()
|
|
|
);
|
|
|
}
|
|
|
@@ -243,7 +243,7 @@ function zimbraSingle_UsageUpdate($params) {
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: could update usage information for " . $product['username'],
|
|
|
+ 'Error: could update usage information for ' . $product['username'],
|
|
|
$e->getMessage()
|
|
|
);
|
|
|
}
|
|
|
@@ -264,30 +264,30 @@ function zimbraSingle_UsageUpdate($params) {
|
|
|
*
|
|
|
* @see https://developers.whmcs.com/provisioning-modules/module-parameters/
|
|
|
*
|
|
|
- * @return string "success" or an error message
|
|
|
+ * @return string 'success' or an error message
|
|
|
*/
|
|
|
function zimbraSingle_ChangePassword($params)
|
|
|
{
|
|
|
- $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], "admin");
|
|
|
+ $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
|
|
|
$login = $api->login();
|
|
|
- if(is_a($login, "Exception")) {
|
|
|
+ if(is_a($login, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: cannot login to " . $params['serverip'],
|
|
|
+ 'Error: cannot login to ' . $params['serverip'],
|
|
|
$login->getMessage()
|
|
|
);
|
|
|
return false;
|
|
|
}
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
$response = $apiAccountManager->setAccountPassword($params['username'], $params['password']);
|
|
|
- if(is_a($response, "Exception")) {
|
|
|
+ if(is_a($response, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: password could not be set for " . $params['username'],
|
|
|
+ 'Error: password could not be set for ' . $params['username'],
|
|
|
$response->getMessage()
|
|
|
);
|
|
|
return false;
|
|
|
@@ -309,18 +309,18 @@ function zimbraSingle_ChangePassword($params)
|
|
|
*
|
|
|
* @see https://developers.whmcs.com/provisioning-modules/module-parameters/
|
|
|
*
|
|
|
- * @return string "success" or an error message
|
|
|
+ * @return string 'success' or an error message
|
|
|
*/
|
|
|
function zimbraSingle_CreateAccount($params)
|
|
|
{
|
|
|
- $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], "admin");
|
|
|
+ $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
|
|
|
$login = $api->login();
|
|
|
- if(is_a($login, "Exception")) {
|
|
|
+ if(is_a($login, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: cannot login to " . $params['serverip'],
|
|
|
+ 'Error: cannot login to ' . $params['serverip'],
|
|
|
$login->getMessage()
|
|
|
);
|
|
|
return $login->getMessage();
|
|
|
@@ -328,23 +328,23 @@ function zimbraSingle_CreateAccount($params)
|
|
|
$params['username'] = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
$accountExists = $apiAccountManager->accountExists($params['username']);
|
|
|
- if(is_a($accountExists, "Exception")) {
|
|
|
+ if(is_a($accountExists, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: could not verify " . $params['username'],
|
|
|
+ 'Error: could not verify ' . $params['username'],
|
|
|
$accountExists->getMessage()
|
|
|
);
|
|
|
- return "Error: could not verify ". $params['username'];
|
|
|
+ return 'Error: could not verify '. $params['username'];
|
|
|
}
|
|
|
if($accountExists === true) {
|
|
|
- return "Error: account already exists " . $params['username'];
|
|
|
+ return 'Error: account already exists ' . $params['username'];
|
|
|
}
|
|
|
$attrs = array();
|
|
|
- $attrs["gn"] = $params['customfields']["givenname"];
|
|
|
- $attrs["sn"] = $params['customfields']["sn"];
|
|
|
- $attrs["displayName"] = $attrs["gn"] . " " . $attrs["sn"];
|
|
|
+ $attrs['gn'] = $params['customfields']['givenname'];
|
|
|
+ $attrs['sn'] = $params['customfields']['sn'];
|
|
|
+ $attrs['displayName'] = $attrs['gn'] . ' ' . $attrs['sn'];
|
|
|
$passDecrypt = localAPI('DecryptPassword', array('password2' => $params['customfields']['password']));
|
|
|
if ($passDecrypt['result'] == 'success') {
|
|
|
$params['password'] = $passDecrypt['password'];
|
|
|
@@ -353,33 +353,33 @@ function zimbraSingle_CreateAccount($params)
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: could not decrypt password",
|
|
|
+ 'Error: could not decrypt password',
|
|
|
$passDecrypt['message']
|
|
|
);
|
|
|
- return "Error: could not decrypt password";
|
|
|
+ return 'Error: could not decrypt password';
|
|
|
}
|
|
|
$cosID = $apiAccountManager->getCosId($params['configoption1']);
|
|
|
- if(is_a($cosID, "Exception")) {
|
|
|
+ if(is_a($cosID, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: could not find serviceclass " . $params['configoption1'],
|
|
|
+ 'Error: could not find serviceclass ' . $params['configoption1'],
|
|
|
$cosID->getMessage()
|
|
|
);
|
|
|
- return "Error: could not find serviceclass " . $params['configoption1'];
|
|
|
+ return 'Error: could not find serviceclass ' . $params['configoption1'];
|
|
|
}
|
|
|
$attrs['zimbraCOSId'] = $cosID;
|
|
|
$zimbraID = $apiAccountManager->createAccount($params['username'], $params['password'], $attrs);
|
|
|
- if(is_a($zimbraID, "Exception")) {
|
|
|
+ if(is_a($zimbraID, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: could not create account " . $params['username'],
|
|
|
+ 'Error: could not create account ' . $params['username'],
|
|
|
$zimbraID->getMessage()
|
|
|
);
|
|
|
- return "Error: could not create account " . $params['username'];
|
|
|
+ return 'Error: could not create account ' . $params['username'];
|
|
|
}
|
|
|
try {
|
|
|
Capsule::table('tblhosting')
|
|
|
@@ -395,10 +395,10 @@ function zimbraSingle_CreateAccount($params)
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: could save username & password in database",
|
|
|
+ 'Error: could save username & password in database',
|
|
|
$e->getMessage()
|
|
|
);
|
|
|
- return "Error: could save username & password in database";
|
|
|
+ return 'Error: could save username & password in database';
|
|
|
}
|
|
|
return 'success';
|
|
|
}
|
|
|
@@ -414,30 +414,30 @@ function zimbraSingle_CreateAccount($params)
|
|
|
*
|
|
|
* @see https://developers.whmcs.com/provisioning-modules/module-parameters/
|
|
|
*
|
|
|
- * @return string "success" or an error message
|
|
|
+ * @return string 'success' or an error message
|
|
|
*/
|
|
|
function zimbraSingle_SuspendAccount($params)
|
|
|
{
|
|
|
- $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], "admin");
|
|
|
+ $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
|
|
|
$login = $api->login();
|
|
|
- if(is_a($login, "Exception")) {
|
|
|
+ if(is_a($login, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: cannot login to " . $params['serverip'],
|
|
|
+ 'Error: cannot login to ' . $params['serverip'],
|
|
|
$login->getMessage()
|
|
|
);
|
|
|
return $login->getMessage();
|
|
|
}
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
- $response = $apiAccountManager->setAccountStatus($params['username'], "locked");
|
|
|
- if(is_a($response, "Exception")) {
|
|
|
+ $response = $apiAccountManager->setAccountStatus($params['username'], 'locked');
|
|
|
+ if(is_a($response, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: could not lock account " . $params['username'],
|
|
|
+ 'Error: could not lock account ' . $params['username'],
|
|
|
$response->getMessage()
|
|
|
);
|
|
|
return false;
|
|
|
@@ -456,33 +456,33 @@ function zimbraSingle_SuspendAccount($params)
|
|
|
*
|
|
|
* @see https://developers.whmcs.com/provisioning-modules/module-parameters/
|
|
|
*
|
|
|
- * @return string "success" or an error message
|
|
|
+ * @return string 'success' or an error message
|
|
|
*/
|
|
|
function zimbraSingle_UnsuspendAccount($params)
|
|
|
{
|
|
|
- $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], "admin");
|
|
|
+ $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
|
|
|
$login = $api->login();
|
|
|
- if(is_a($login, "Exception")) {
|
|
|
+ if(is_a($login, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: cannot login to " . $params['serverip'],
|
|
|
+ 'Error: cannot login to ' . $params['serverip'],
|
|
|
$login->getMessage()
|
|
|
);
|
|
|
return $login->getMessage();
|
|
|
}
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
- $response = $apiAccountManager->setAccountStatus($params['username'], "active");
|
|
|
- if(is_a($response, "Exception")) {
|
|
|
+ $response = $apiAccountManager->setAccountStatus($params['username'], 'active');
|
|
|
+ if(is_a($response, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: could not unlock account " . $params['username'],
|
|
|
+ 'Error: could not unlock account ' . $params['username'],
|
|
|
$response->getMessage()
|
|
|
);
|
|
|
- return "Error: could not unlock account " . $params['username'];
|
|
|
+ return 'Error: could not unlock account ' . $params['username'];
|
|
|
}
|
|
|
return 'success';
|
|
|
}
|
|
|
@@ -497,47 +497,47 @@ function zimbraSingle_UnsuspendAccount($params)
|
|
|
*
|
|
|
* @see https://developers.whmcs.com/provisioning-modules/module-parameters/
|
|
|
*
|
|
|
- * @return string "success" or an error message
|
|
|
+ * @return string 'success' or an error message
|
|
|
*/
|
|
|
function zimbraSingle_TerminateAccount($params)
|
|
|
{
|
|
|
- $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], "admin");
|
|
|
+ $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
|
|
|
$login = $api->login();
|
|
|
- if(is_a($login, "Exception")) {
|
|
|
+ if(is_a($login, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: cannot login to " . $params['serverip'],
|
|
|
+ 'Error: cannot login to ' . $params['serverip'],
|
|
|
$login->getMessage()
|
|
|
);
|
|
|
return $login->getMessage();
|
|
|
}
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
$accountStatus = $apiAccountManager->getAccountStatus($params['username']);
|
|
|
- if(is_a($accountStatus, "Exception")) {
|
|
|
+ if(is_a($accountStatus, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: could not verify account ". $params['username'],
|
|
|
+ 'Error: could not verify account '. $params['username'],
|
|
|
$accountStatus->getMessage()
|
|
|
);
|
|
|
- return "Error : account " . $params['username'] . " Name could not verified";
|
|
|
+ return 'Error : account ' . $params['username'] . ' Name could not verified';
|
|
|
}
|
|
|
if ($accountStatus != 'locked') {
|
|
|
- return "Account ". $params['username'] . " is active, suspend account first!";
|
|
|
+ return 'Account '. $params['username'] . ' is active, suspend account first!';
|
|
|
}
|
|
|
$response = $apiAccountManager->deleteAccount($params['username']);
|
|
|
- if(is_a($response, "Exception")) {
|
|
|
+ if(is_a($response, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: could not remove account ". $params['username'],
|
|
|
+ 'Error: could not remove account '. $params['username'],
|
|
|
$response->getMessage()
|
|
|
);
|
|
|
- return "Error: could not remove account ". $params['username'];
|
|
|
+ return 'Error: could not remove account '. $params['username'];
|
|
|
}
|
|
|
return 'success';
|
|
|
}
|
|
|
@@ -556,33 +556,33 @@ function zimbraSingle_TerminateAccount($params)
|
|
|
*
|
|
|
* @see https://developers.whmcs.com/provisioning-modules/module-parameters/
|
|
|
*
|
|
|
- * @return string "success" or an error message
|
|
|
+ * @return string 'success' or an error message
|
|
|
*/
|
|
|
function zimbraSingle_ChangePackage($params)
|
|
|
{
|
|
|
- $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], "admin");
|
|
|
+ $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
|
|
|
$login = $api->login();
|
|
|
- if(is_a($login, "Exception")) {
|
|
|
+ if(is_a($login, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: cannot login to " . $params['serverip'],
|
|
|
+ 'Error: cannot login to ' . $params['serverip'],
|
|
|
$login->getMessage()
|
|
|
);
|
|
|
return $login->getMessage();
|
|
|
}
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
$response = $apiAccountManager->setAccountCos($params['username'], $params['configoption1']);
|
|
|
- if(is_a($response, "Exception")) {
|
|
|
+ if(is_a($response, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: could not set class of service for ". $params['username'],
|
|
|
+ 'Error: could not set class of service for '. $params['username'],
|
|
|
$response->getMessage()
|
|
|
);
|
|
|
- return "Error: could not set class of service for ". $params['username'];
|
|
|
+ return 'Error: could not set class of service for '. $params['username'];
|
|
|
}
|
|
|
return 'success';
|
|
|
}
|
|
|
@@ -622,31 +622,31 @@ function zimbraSingle_ConfigOptions($params)
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$adminPassCrypt,
|
|
|
- "Error: cloud not decrypt admin password" ,
|
|
|
+ 'Error: cloud not decrypt admin password' ,
|
|
|
$adminPassDecrypt['message']
|
|
|
);
|
|
|
return false;
|
|
|
}
|
|
|
- $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
|
|
|
+ $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], 'admin');
|
|
|
$login = $api->login();
|
|
|
- if(is_a($login, "Exception")) {
|
|
|
+ if(is_a($login, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: cannot login to " . $accessData['zimbraServer'],
|
|
|
+ 'Error: cannot login to ' . $accessData['zimbraServer'],
|
|
|
$login->getMessage()
|
|
|
);
|
|
|
return false;
|
|
|
}
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
$cosIDs = $apiAccountManager->getAllCos();
|
|
|
- if(is_a($cosIDs, "Exception")) {
|
|
|
+ if(is_a($cosIDs, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: could not fetch classes of service",
|
|
|
+ 'Error: could not fetch classes of service',
|
|
|
$cosIDs->getMessage()
|
|
|
);
|
|
|
return false;
|
|
|
@@ -654,10 +654,10 @@ function zimbraSingle_ConfigOptions($params)
|
|
|
$cosNames = recursiveFindAll($cosIDs, 'NAME');
|
|
|
$configOptions = array();
|
|
|
$configOptions['cos'] = array(
|
|
|
- "FriendlyName" => "Class of Service",
|
|
|
- "Type" => "dropdown",
|
|
|
- "Options" => implode(',', $cosNames),
|
|
|
- "Description" => "Select COS",
|
|
|
+ 'FriendlyName' => 'Class of Service',
|
|
|
+ 'Type' => 'dropdown',
|
|
|
+ 'Options' => implode(',', $cosNames),
|
|
|
+ 'Description' => 'Select COS',
|
|
|
);
|
|
|
return $configOptions;
|
|
|
}
|