From bee81f37faf6950148fa318c24fe7802cc7ae219 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 31 May 2006 09:54:34 +0000 Subject: [PATCH] changed quota value from KB to MB git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3576 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_mail-methods-cyrus.inc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/include/class_mail-methods-cyrus.inc b/include/class_mail-methods-cyrus.inc index 0e51a9c86..edb4d7941 100644 --- a/include/class_mail-methods-cyrus.inc +++ b/include/class_mail-methods-cyrus.inc @@ -70,12 +70,12 @@ 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']= $quota_value["STORAGE"]['usage']; - $result['gosaMailQuota']= $quota_value["STORAGE"]['limit']; + $result['quotaUsage']= (int) ($quota_value["STORAGE"]['usage'] / 1024); + $result['gosaMailQuota']= (int) ($quota_value["STORAGE"]['limit'] / 1024); } else { /* backward icompatible */ - $result['quotaUsage']= $quota_value['usage']; - $result['gosaMailQuota']= $quota_value['limit']; + $result['quotaUsage']= (int) ($quota_value['usage'] / 1024); + $result['gosaMailQuota']= (int) ($quota_value['limit'] / 1024); } }elseif(!$quota_value){ return(false); @@ -126,8 +126,11 @@ class mailMethodCyrus extends mailMethod /* Workaround for the php imap extension */ if ($gosaMailQuota == ""){ $gosaMailQuota= "2147483647"; + }elseif($gosaMailQuota > 0){ + $gosaMailQuota = $gosaMailQuota *1024; } - + + /* Write mail quota */ if (!imap_set_quota($this->mbox, $folder, $gosaMailQuota)){ print_red(sprintf(_("Can't write IMAP quota. Server says '%s'."), imap_last_error())); -- 2.30.2