Explorar o código

[Web] Fix quota-left calculations when editing a mailbox (respect max domain quota)

andryyy %!s(int64=4) %!d(string=hai) anos
pai
achega
64264767d7
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      data/web/inc/functions.mailbox.inc.php

+ 4 - 4
data/web/inc/functions.mailbox.inc.php

@@ -2361,19 +2361,19 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
               );
               );
               continue;
               continue;
             }
             }
-            if ($quota_m > $DomainData['maxquota']) {
+            if ((($is_now['quota_used'] / 1048576) + $quota_m) > $DomainData['quota']) {
               $_SESSION['return'][] = array(
               $_SESSION['return'][] = array(
                 'type' => 'danger',
                 'type' => 'danger',
                 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr),
                 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr),
-                'msg' => array('mailbox_quota_exceeded', $DomainData['maxquota'])
+                'msg' => array('mailbox_quota_left_exceeded', ($is_now['max_new_quota'] / 1048576))
               );
               );
               continue;
               continue;
             }
             }
-            if (((($is_now['quota_used'] / 1048576) - $quota_m) + $quota_m) > $DomainData['quota']) {
+            if ($quota_m > $DomainData['maxquota']) {
               $_SESSION['return'][] = array(
               $_SESSION['return'][] = array(
                 'type' => 'danger',
                 'type' => 'danger',
                 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr),
                 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr),
-                'msg' => array('mailbox_quota_left_exceeded', ($is_now['max_new_quota'] / 1048576))
+                'msg' => array('mailbox_quota_exceeded', $DomainData['maxquota'])
               );
               );
               continue;
               continue;
             }
             }