|
@@ -239,33 +239,25 @@ function zimbraSingle_UsageUpdate($params) {
|
|
|
->where('domainstatus', '=', 'Active')
|
|
->where('domainstatus', '=', 'Active')
|
|
|
->get();
|
|
->get();
|
|
|
foreach((array)$productsObj as $productArray) {
|
|
foreach((array)$productsObj as $productArray) {
|
|
|
- foreach($productArray as $productObj) {
|
|
|
|
|
- $product = get_object_vars($productObj);
|
|
|
|
|
- logModuleCall(
|
|
|
|
|
- 'zimbrasingle',
|
|
|
|
|
- __FUNCTION__,
|
|
|
|
|
- $productObj,
|
|
|
|
|
- 'Debug',
|
|
|
|
|
- $product
|
|
|
|
|
- );
|
|
|
|
|
- $accountQuota = $apiAccountManager->getQuota($product['username']);
|
|
|
|
|
|
|
+ foreach($productArray as $product) {
|
|
|
|
|
+ $accountQuota = $apiAccountManager->getQuota($product->username);
|
|
|
if(is_a($accountQuota, 'Exception')) {
|
|
if(is_a($accountQuota, 'Exception')) {
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
- 'Error : could not find quota for ' . $product['username'],
|
|
|
|
|
|
|
+ 'Error : could not find quota for ' . $product->username,
|
|
|
$accountQuota
|
|
$accountQuota
|
|
|
);
|
|
);
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- $mboxInfo = $apiAccountManager->getMailbox($product['username']);
|
|
|
|
|
|
|
+ $mboxInfo = $apiAccountManager->getMailbox($product->username);
|
|
|
if(is_a($mboxInfo, 'Exception')) {
|
|
if(is_a($mboxInfo, 'Exception')) {
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
- 'Error: could not fetch mailbox info for ' . $product['username'],
|
|
|
|
|
|
|
+ 'Error: could not fetch mailbox info for ' . $product->username,
|
|
|
$mboxInfo
|
|
$mboxInfo
|
|
|
);
|
|
);
|
|
|
continue;
|
|
continue;
|
|
@@ -273,7 +265,7 @@ function zimbraSingle_UsageUpdate($params) {
|
|
|
$mboxSize = $mboxInfo['S'];
|
|
$mboxSize = $mboxInfo['S'];
|
|
|
try {
|
|
try {
|
|
|
Capsule::table('tblhosting')
|
|
Capsule::table('tblhosting')
|
|
|
- ->where('id', '=', $product['id'])
|
|
|
|
|
|
|
+ ->where('id', '=', $product->id)
|
|
|
->update(
|
|
->update(
|
|
|
array(
|
|
array(
|
|
|
'diskusage' => round($mboxSize / 1048576),
|
|
'diskusage' => round($mboxSize / 1048576),
|
|
@@ -286,7 +278,7 @@ function zimbraSingle_UsageUpdate($params) {
|
|
|
'zimbrasingle',
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
- 'Error: could update usage information for ' . $product['username'],
|
|
|
|
|
|
|
+ 'Error: could update usage information for ' . $product->username,
|
|
|
$e->getMessage()
|
|
$e->getMessage()
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|