From 64264767d7a0cc232fe11159aa4b1b9d5745b04f Mon Sep 17 00:00:00 2001 From: andryyy Date: Tue, 23 Feb 2021 08:42:04 +0100 Subject: [PATCH] [Web] Fix quota-left calculations when editing a mailbox (respect max domain quota) --- data/web/inc/functions.mailbox.inc.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php index a2f181c4a..b537467c5 100644 --- a/data/web/inc/functions.mailbox.inc.php +++ b/data/web/inc/functions.mailbox.inc.php @@ -2361,6 +2361,14 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { ); continue; } + if ((($is_now['quota_used'] / 1048576) + $quota_m) > $DomainData['quota']) { + $_SESSION['return'][] = array( + 'type' => 'danger', + 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr), + 'msg' => array('mailbox_quota_left_exceeded', ($is_now['max_new_quota'] / 1048576)) + ); + continue; + } if ($quota_m > $DomainData['maxquota']) { $_SESSION['return'][] = array( 'type' => 'danger', @@ -2369,14 +2377,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { ); continue; } - if (((($is_now['quota_used'] / 1048576) - $quota_m) + $quota_m) > $DomainData['quota']) { - $_SESSION['return'][] = array( - 'type' => 'danger', - 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr), - 'msg' => array('mailbox_quota_left_exceeded', ($is_now['max_new_quota'] / 1048576)) - ); - continue; - } $extra_acls = array(); if (isset($_data['extended_sender_acl'])) { if (!isset($_SESSION['acl']['extend_sender_acl']) || $_SESSION['acl']['extend_sender_acl'] != "1" ) {