From: hickert Date: Wed, 31 May 2006 10:11:04 +0000 (+0000) Subject: Fixed cyrus mail method to support MB intead of KB quotas. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ada4d480eeeb132e47cd113571b9a8d5ce41bbdd;p=gosa.git Fixed cyrus mail method to support MB intead of KB quotas. Don't touch the quota value 2147483647. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3578 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_mail-methods-cyrus.inc b/include/class_mail-methods-cyrus.inc index edb4d7941..6eab34624 100644 --- a/include/class_mail-methods-cyrus.inc +++ b/include/class_mail-methods-cyrus.inc @@ -70,12 +70,22 @@ class mailMethodCyrus extends mailMethod if(is_array($quota_value)) { if (isset($quota_value["STORAGE"]) && is_array($quota_value["STORAGE"])){ /* use for PHP >= 4.3 */ - $result['quotaUsage']= (int) ($quota_value["STORAGE"]['usage'] / 1024); - $result['gosaMailQuota']= (int) ($quota_value["STORAGE"]['limit'] / 1024); + if($quota_value["STORAGE"]['limit'] == 2147483647){ + $result['quotaUsage']= (int) ($quota_value["STORAGE"]['usage'] / 1024); + $result['gosaMailQuota']= (int) ($quota_value["STORAGE"]['limit'] ); + }else{ + $result['quotaUsage']= (int) ($quota_value["STORAGE"]['usage'] / 1024); + $result['gosaMailQuota']= (int) ($quota_value["STORAGE"]['limit'] / 1024); + } } else { /* backward icompatible */ - $result['quotaUsage']= (int) ($quota_value['usage'] / 1024); - $result['gosaMailQuota']= (int) ($quota_value['limit'] / 1024); + if($quota_value['usage'] == 2147483647){ + $result['quotaUsage']= (int) ($quota_value['usage'] / 1024); + $result['gosaMailQuota']= (int) ($quota_value['limit'] ); + }else{ + $result['quotaUsage']= (int) ($quota_value['usage'] / 1024); + $result['gosaMailQuota']= (int) ($quota_value['limit'] / 1024); + } } }elseif(!$quota_value){ return(false); @@ -124,7 +134,7 @@ class mailMethodCyrus extends mailMethod function setQuota($folder, $gosaMailQuota) { /* Workaround for the php imap extension */ - if ($gosaMailQuota == ""){ + if (($gosaMailQuota == "") || ($gosaMailQuota== "2147483647")){ $gosaMailQuota= "2147483647"; }elseif($gosaMailQuota > 0){ $gosaMailQuota = $gosaMailQuota *1024;