This commit is contained in:
Virtuworks 2012-09-19 23:47:11 -04:00
commit b83fdd6ad1

View file

@ -2572,11 +2572,23 @@ namespace WebsitePanel.EnterpriseServer
} }
ExchangeMailboxPlan plan = GetExchangeMailboxPlan(itemId, mailboxPlanId); ExchangeMailboxPlan plan = GetExchangeMailboxPlan(itemId, mailboxPlanId);
if (maxDiskSpace != -1) if (maxDiskSpace != -1)
{
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)) if ((quotaUsed + plan.MailboxSizeMB) > (maxDiskSpace))
return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES; return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES;
} }
}
// get mailbox settings // get mailbox settings
int exchangeServiceId = GetExchangeServiceID(org.PackageId); int exchangeServiceId = GetExchangeServiceID(org.PackageId);