Skip to content

Commit ede489d

Browse files
author
Till Brehm
committed
Fixed: FS#3534 - Check if mail quota check is working correctly
1 parent d678830 commit ede489d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

interface/web/mail/mail_user_edit.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function onSubmit() {
166166
}
167167

168168
// Check the quota and adjust
169-
if(isset($_POST["quota"]) && $client["limit_mailquota"] >= 0 && $app->functions->intval($this->dataRecord["quota"]) * 1024 * 1024 != $this->oldDataRecord['quota']) {
169+
if(isset($_POST["quota"]) && $client["limit_mailquota"] >= 0 && (($app->functions->intval($this->dataRecord["quota"]) * 1024 * 1024 != $this->oldDataRecord['quota']) || ($_POST["quota"] <= 0))) {
170170
$tmp = $app->db->queryOneRecord("SELECT sum(quota) as mailquota FROM mail_user WHERE mailuser_id != ".$app->functions->intval($this->id)." AND ".$app->tform->getAuthSQL('u'));
171171
$mailquota = $tmp["mailquota"] / 1024 / 1024;
172172
$new_mailbox_quota = $app->functions->intval($this->dataRecord["quota"]);
@@ -179,6 +179,7 @@ function onSubmit() {
179179
unset($tmp);
180180
unset($tmp_quota);
181181
}
182+
182183
} // end if user is not admin
183184

184185

0 commit comments

Comments
 (0)