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,10 +1249,13 @@ 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 (addressesNumber > (quotaAllocated - quotaUsed)) if (quotaAllocated != -1) // check only if not unlimited
{ {
res.ErrorCodes.Add("IP_ADDRESSES_QUOTA_LIMIT_REACHED"); if (addressesNumber > (quotaAllocated - quotaUsed))
return res; {
res.ErrorCodes.Add("IP_ADDRESSES_QUOTA_LIMIT_REACHED");
return res;
}
} }
// check if requested more than available // check if requested more than available