fixed calculation of PhoneNumbers/Ip quotas in AllocatePackage

This commit is contained in:
dev_amdtel 2013-10-30 13:56:53 +04:00
parent df141565f7
commit 764da55167

View file

@ -1249,11 +1249,14 @@ namespace WebsitePanel.EnterpriseServer
int quotaUsed = cntx.Quotas[quotaName].QuotaUsedValue; int quotaUsed = cntx.Quotas[quotaName].QuotaUsedValue;
// check the maximum allowed number // check the maximum allowed number
if (quotaAllocated != -1) // check only if not unlimited
{
if (addressesNumber > (quotaAllocated - quotaUsed)) if (addressesNumber > (quotaAllocated - quotaUsed))
{ {
res.ErrorCodes.Add("IP_ADDRESSES_QUOTA_LIMIT_REACHED"); res.ErrorCodes.Add("IP_ADDRESSES_QUOTA_LIMIT_REACHED");
return res; return res;
} }
}
// check if requested more than available // check if requested more than available
if (maxAvailableIPs != -1 && if (maxAvailableIPs != -1 &&