|
|
@@ -575,6 +575,34 @@ function zimbraSingle_ChangePackage($params) {
|
|
|
);
|
|
|
return 'Error: could not set class of service for '. $params['username'];
|
|
|
}
|
|
|
+ $accountQuota = $apiAccountManager->getQuota($params['username']);
|
|
|
+ if(is_a($accountQuota, 'Exception')) {
|
|
|
+ logModuleCall(
|
|
|
+ 'zimbrasingle',
|
|
|
+ __FUNCTION__,
|
|
|
+ $params,
|
|
|
+ 'Error : could not find quota for ' . $params['username'],
|
|
|
+ $accountQuota->getMessage()
|
|
|
+ );
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ Capsule::table('tblhosting')
|
|
|
+ ->where('id', '=', $params['serviceid'])
|
|
|
+ ->update(
|
|
|
+ array(
|
|
|
+ 'disklimit' => $accountQuota,
|
|
|
+ )
|
|
|
+ );
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ logModuleCall(
|
|
|
+ 'zimbrasingle',
|
|
|
+ __FUNCTION__,
|
|
|
+ $params,
|
|
|
+ 'Error: could not update quota in database',
|
|
|
+ $e->getMessage()
|
|
|
+ );
|
|
|
+ return 'Error: could not update quota in database';
|
|
|
+ }
|
|
|
return 'success';
|
|
|
}
|
|
|
|