From 56395709f3b9f1d1aa8d78b48f8d1974ec573e6d Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sat, 16 Mar 2019 16:04:22 +0100 Subject: [PATCH] Make quota levels configurable Signed-off-by: Sven Strickroth --- config.inc.php | 4 ++++ templates/list-virtual_mailbox.tpl | 4 ++-- templates/list.tpl | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/config.inc.php b/config.inc.php index 370d829e..f7328a64 100644 --- a/config.inc.php +++ b/config.inc.php @@ -344,6 +344,10 @@ $CONF['quota'] = 'NO'; $CONF['domain_quota'] = 'YES'; // You can either use '1024000' or '1048576' $CONF['quota_multiplier'] = '1024000'; +// fill state threshold (in per cent) for medium level (displayed as orange) +$CONF['quota_level_med_pct'] = 55; +// fill state threshold (in per cent) for high level (displayed as red) +$CONF['quota_level_high_pct'] = 90; // Transport // If you want to define additional transport options for a domain set this to 'YES'. diff --git a/templates/list-virtual_mailbox.tpl b/templates/list-virtual_mailbox.tpl index 40eecc58..c0cad18a 100644 --- a/templates/list-virtual_mailbox.tpl +++ b/templates/list-virtual_mailbox.tpl @@ -60,9 +60,9 @@ {if $boolconf_used_quotas} - {if $divide_quota.quota_width[$i]>90} + {if $divide_quota.quota_width[$i] > $conf.quota_level_high_pct} {assign var="quota_level" value="high"} - {elseif $divide_quota.quota_width[$i]>55} + {elseif $divide_quota.quota_width[$i] > $conf.quota_level_med_pct} {assign var="quota_level" value="mid"} {else} {assign var="quota_level" value="low"} diff --git a/templates/list.tpl b/templates/list.tpl index c23bb799..a333e751 100644 --- a/templates/list.tpl +++ b/templates/list.tpl @@ -91,9 +91,9 @@ {elseif $field.type == 'quot'} {assign "tmpkey" "_{$key}_percent"} - {if $item[$tmpkey]>90} + {if $item[$tmpkey] > $conf.quota_level_high_pct} {assign var="quota_level" value="high"} - {elseif $item[$tmpkey]>55} + {elseif $item[$tmpkey] > $conf.quota_level_med_pct} {assign var="quota_level" value="mid"} {else} {assign var="quota_level" value="low"}