summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-04-29 11:31:41 +0000
committeralecpl <alec@alec.pl>2010-04-29 11:31:41 +0000
commit3978d28ecd6c615635937419b6749dfac75bf768 (patch)
tree2ee69e8668d72f76f19b69844f1e41826dcbc58d /program/steps
parenta004bb8cbe4a8f0adf68b5b63de1ef1d32007255 (diff)
- Fix quota_zero_as_unlimited (#1486662)
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/mail/func.inc14
1 files changed, 7 insertions, 7 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index ad4ca2257..25b0338af 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -447,10 +447,10 @@ function rcmail_quota_content($attrib=NULL)
$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 @@ function rcmail_quota_content($attrib=NULL)
$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'];
}
+
+ return $quota_result;
}
- else
- return rcube_label('unlimited');
- return $quota_result;
+ return rcube_label('unknown');
}