in case we set a quota too low, force it to a proper value. Mail should be working properly now

This commit is contained in:
Benjamin Sonntag 2012-08-25 13:11:48 +00:00
parent 6ba876f10c
commit 09e0234ee2
3 changed files with 10 additions and 4 deletions

View File

@ -117,7 +117,7 @@ if (!$res=$mail->get_details($mail_id)) {
}
if ($error) $error=_("Your email has been edited successfully");
if (!$error) $error=_("Your email has been edited successfully");
$_REQUEST["domain_id"]=$dom->get_domain_byname($res["domain"]);
include("mail_list.php");

View File

@ -53,9 +53,6 @@ if ($domain=$dom->get_domain_byid($domain_id)) {
?>
<?php
if (isset($error)) {
echo "<p class=\"error\">$error</p>";
}
// Mail creation form
if ($quota->cancreate("mail")) {
@ -77,6 +74,11 @@ if (empty($mails_list)){ // If there is no mail for this domain
<hr id="topbar"/>
<h3><?php printf(_("Email addresses of the domain %s"),$domain); ?> : </h3>
<?php
if (isset($error)) {
echo "<p class=\"error\">$error</p>";
}
?>
<table class="searchtable"><tr><td>
<form method="get" name="formlist1" id="formlist1" action="mail_list.php">

View File

@ -467,6 +467,10 @@ class m_mail {
}
if ($islocal) {
if ($quotamb<(intval($me["used"]/1024/1024)+1)) {
$quotamb=intval($me["used"]/1024/1024)+1;
$err->raise("mail",_("You set a quota smaller than the current mailbox size. Since it's not allowed, we set the quota to the current mailbox size."));
}
$db->query("UPDATE mailbox SET quota=".intval($quotamb)." WHERE address_id=".$mail_id.";");
}