|
|
@@ -392,6 +392,9 @@ function zimbraSingle_CreateAccount($params) {
|
|
|
$attrs['zimbraCOSId'] = $cosID;
|
|
|
$baseQuota = $params['configoption2'] ? $params['configoption2'] : 1;
|
|
|
$addonQuota = $params['configoptions']['addonQuota'] ? $params['configoptions']['addonQuota'] : 0;
|
|
|
+ $newQuota = $params['configoptions']['newQuota'] ? $params['configoptions']['newQuota'] : 0;
|
|
|
+ $addonQuota = $addonQuota + $newQuota;
|
|
|
+ $params['configoptions']['newQuota'] = 0;
|
|
|
$attrs['zimbraMailQuota'] = ($baseQuota + $addonQuota) * 1073741824;
|
|
|
$zimbraID = $apiAccountManager->createAccount($params['username'], $params['password'], $attrs);
|
|
|
if(is_a($zimbraID, 'Exception')) {
|
|
|
@@ -603,21 +606,12 @@ function zimbraSingle_ChangePackage($params) {
|
|
|
);
|
|
|
return 'Error: could not set class of service for '. $params['username'];
|
|
|
}
|
|
|
- $baseQuota = $params['configoption2'] ? $params['configoption2'] : 1;
|
|
|
$addonQuota = $params['configoptions']['addonQuota'] ? $params['configoptions']['addonQuota'] : 0;
|
|
|
- $newQuota = ($baseQuota + $addonQuota) * 1073741824;
|
|
|
- $accountQuota = $apiAccountManager->getQuota($params['username']);
|
|
|
- if(is_a($accountQuota, 'Exception')) {
|
|
|
- logModuleCall(
|
|
|
- 'zimbrasingle',
|
|
|
- __FUNCTION__,
|
|
|
- $params,
|
|
|
- 'Error : could not find quota for ' . $params['username'],
|
|
|
- $accountQuota
|
|
|
- );
|
|
|
- return 'Error: could not fetch account quota for '. $params['username'];
|
|
|
- }
|
|
|
- $response = $apiAccountManager->modifyAccount($params['username'], ['zimbraMailQuota' => $newQuota,]);
|
|
|
+ $newQuota = $params['configoptions']['newQuota'] ? $params['configoptions']['newQuota'] : 0;
|
|
|
+ $addonQuota = $addonQuota + $newQuota;
|
|
|
+ $params['configoptions']['newQuota'] = 0;
|
|
|
+ $attrs['zimbraMailQuota'] = ($baseQuota + $addonQuota) * 1073741824;
|
|
|
+ $response = $apiAccountManager->modifyAccount($params['username'], $attrs);
|
|
|
if(is_a($response, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
@@ -633,7 +627,7 @@ function zimbraSingle_ChangePackage($params) {
|
|
|
->where('id', '=', $params['serviceid'])
|
|
|
->update(
|
|
|
array(
|
|
|
- 'disklimit' => $accountQuota,
|
|
|
+ 'disklimit' => $attrs['zimbraMailQuota'],
|
|
|
)
|
|
|
);
|
|
|
} catch (\Exception $e) {
|