|
|
@@ -263,13 +263,6 @@ function zimbraSingle_UsageUpdate($params) {
|
|
|
}
|
|
|
$mbox = get_object_vars($response);
|
|
|
$mboxSize = $mbox['S'];
|
|
|
- logModuleCall(
|
|
|
- 'zimbrasingle',
|
|
|
- __FUNCTION__,
|
|
|
- $product,
|
|
|
- "Debug",
|
|
|
- $response
|
|
|
- );
|
|
|
Capsule::table('tblhosting')
|
|
|
->where('id', '=', $product['id'])
|
|
|
->update(
|
|
|
@@ -357,7 +350,7 @@ function zimbraSingle_CreateAccount($params)
|
|
|
);
|
|
|
return $login->getMessage();
|
|
|
}
|
|
|
- $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
+ $params['username'] = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
|
|
|
$apiAccountManager = new Zm_Account($api);
|
|
|
$accountExists = $apiAccountManager->accountExists($accountName);
|
|
|
if(is_a($accountExists, "Exception")) {
|
|
|
@@ -365,13 +358,13 @@ function zimbraSingle_CreateAccount($params)
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$accessData,
|
|
|
- "Error: could not verify $accountName",
|
|
|
+ "Error: could not verify " . $params['username'],
|
|
|
$accountExists
|
|
|
);
|
|
|
- return "Error: could not verify $accountName";
|
|
|
+ return "Error: could not verify " . $params['username'];
|
|
|
}
|
|
|
if($accountExists === true) {
|
|
|
- return "Error: account $accountName already exists";
|
|
|
+ return "Error: account ". $params['username'] . " already exists";
|
|
|
}
|
|
|
$attrs = array();
|
|
|
$attrs["gn"] = $params['customfields']["givenname"];
|
|
|
@@ -379,7 +372,7 @@ function zimbraSingle_CreateAccount($params)
|
|
|
$attrs["displayName"] = $attrs["gn"] . " " . $attrs["sn"];
|
|
|
$passDecrypt = localAPI('DecryptPassword', array('password2' => $params['customfields']['password']));
|
|
|
if ($passDecrypt['result'] == 'success') {
|
|
|
- $params['customfields']['password'] = $passDecrypt['password'];
|
|
|
+ $params['password'] = $passDecrypt['password'];
|
|
|
} else {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
@@ -402,16 +395,16 @@ function zimbraSingle_CreateAccount($params)
|
|
|
return "Error: serviceclass not available";
|
|
|
}
|
|
|
$attrs['zimbraCOSId'] = $cosID;
|
|
|
- $id = $apiAccountManager->createAccount($accountName, $params['customfields']['password'], $attrs);
|
|
|
+ $id = $apiAccountManager->createAccount($params['username'], $params['password'], $attrs);
|
|
|
if(is_a($id, "Exception")) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: account $accountName not created",
|
|
|
+ "Error: account " . $params['username'] . " not created",
|
|
|
$id
|
|
|
);
|
|
|
- return "Error: account $accountName not created";
|
|
|
+ return "Error: account " . $params['username'] . " not created";
|
|
|
}
|
|
|
return 'success';
|
|
|
}
|