Fixed: Old mailbox plan size taken in considearion when setting new mailbox plan
This commit is contained in:
parent
9167da75dc
commit
e055d56d5f
1 changed files with 14 additions and 2 deletions
|
@ -2512,10 +2512,22 @@ namespace WebsitePanel.EnterpriseServer
|
|||
}
|
||||
|
||||
ExchangeMailboxPlan plan = GetExchangeMailboxPlan(itemId, mailboxPlanId);
|
||||
|
||||
if (maxDiskSpace != -1)
|
||||
{
|
||||
if ((quotaUsed + plan.MailboxSizeMB) > (maxDiskSpace))
|
||||
return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES;
|
||||
ExchangeAccount exchangeAccount = GetAccount(itemId, accountId);
|
||||
if (exchangeAccount.MailboxPlanId > 0)
|
||||
{
|
||||
ExchangeMailboxPlan oldPlan = GetExchangeMailboxPlan(itemId, exchangeAccount.MailboxPlanId);
|
||||
|
||||
if (((quotaUsed - oldPlan.MailboxSizeMB) + plan.MailboxSizeMB) > (maxDiskSpace))
|
||||
return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((quotaUsed + plan.MailboxSizeMB) > (maxDiskSpace))
|
||||
return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES;
|
||||
}
|
||||
}
|
||||
|
||||
// get mailbox settings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue