From 3978d28ecd6c615635937419b6749dfac75bf768 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Thu, 29 Apr 2010 07:31:41 -0400
Subject: [PATCH] - Fix quota_zero_as_unlimited (#1486662)
---
CHANGELOG | 1 +
program/steps/mail/func.inc | 16 ++++++++--------
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index a8bb672..0436be5 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG RoundCube Webmail
===========================
+- Fix quota_zero_as_unlimited (#1486662)
- Fix folder subscription checking (#1486684)
- Fix INBOX appears (sometimes) twice in mailbox list (#1486672)
- Fix listing of attachments of some types e.g. "x-epoc/x-sisx-app" (#1486653)
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index ad4ca22..25b0338 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -447,10 +447,10 @@
$quota = $RCMAIL->imap->get_quota();
$quota = $RCMAIL->plugins->exec_hook('quota', $quota);
- if (!isset($quota['used']) || !isset($quota['total']))
- return rcube_label('unknown');
+ if (!$quota['total'] && $RCMAIL->config->get('quota_zero_as_unlimited'))
+ return rcube_label('unlimited');
- if (!($quota['total']==0 && $RCMAIL->config->get('quota_zero_as_unlimited')))
+ if ($quota['total'])
{
if (!isset($quota['percent']))
$quota['percent'] = min(100, round(($quota['used']/max(1,$quota['total']))*100));
@@ -463,18 +463,18 @@
$quota_result = array(
'percent' => $quota['percent'],
'title' => $quota_result,
- );
+ );
if ($attrib['width'])
$quota_result['width'] = $attrib['width'];
if ($attrib['height'])
$quota_result['height'] = $attrib['height'];
}
- }
- else
- return rcube_label('unlimited');
- return $quota_result;
+ return $quota_result;
+ }
+
+ return rcube_label('unknown');
}
--
Gitblit v1.9.1