diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 275630c2..39c91f1f 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -1,4 +1,4 @@ -USE [${install.database}] +USE [${install.database}] GO -- update database version @@ -216,3 +216,102 @@ RETURN UPDATE Domains SET IsDomainPointer=0, DomainItemID=NULL WHERE MailDomainID IS NOT NULL AND isDomainPointer=1 GO + + +ALTER PROCEDURE [dbo].[GetPackageQuotas] +( + @ActorID int, + @PackageID int +) +AS + +-- check rights +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +DECLARE @PlanID int, @ParentPackageID int +SELECT @PlanID = PlanID, @ParentPackageID = ParentPackageID FROM Packages +WHERE PackageID = @PackageID + +-- get resource groups +SELECT + RG.GroupID, + RG.GroupName, + ISNULL(HPR.CalculateDiskSpace, 0) AS CalculateDiskSpace, + ISNULL(HPR.CalculateBandwidth, 0) AS CalculateBandwidth, + dbo.GetPackageAllocatedResource(@ParentPackageID, RG.GroupID, 0) AS ParentEnabled +FROM ResourceGroups AS RG +LEFT OUTER JOIN HostingPlanResources AS HPR ON RG.GroupID = HPR.GroupID AND HPR.PlanID = @PlanID +WHERE dbo.GetPackageAllocatedResource(@PackageID, RG.GroupID, 0) = 1 +ORDER BY RG.GroupOrder + + +-- return quotas +SELECT + Q.QuotaID, + Q.GroupID, + Q.QuotaName, + Q.QuotaDescription, + Q.QuotaTypeID, + dbo.GetPackageAllocatedQuota(@PackageID, Q.QuotaID) AS QuotaValue, + dbo.GetPackageAllocatedQuota(@ParentPackageID, Q.QuotaID) AS ParentQuotaValue, + ISNULL(dbo.CalculateQuotaUsage(@PackageID, Q.QuotaID), 0) AS QuotaUsedValue +FROM Quotas AS Q +WHERE Q.HideQuota IS NULL OR Q.HideQuota = 0 +ORDER BY Q.QuotaOrder +RETURN + +GO + + + + + + + +ALTER PROCEDURE [dbo].[UpdateServiceProperties] +( + @ServiceID int, + @Xml ntext +) +AS + +-- delete old properties +BEGIN TRAN +DECLARE @idoc int +--Create an internal representation of the XML document. +EXEC sp_xml_preparedocument @idoc OUTPUT, @xml + +-- Execute a SELECT statement that uses the OPENXML rowset provider. +DELETE FROM ServiceProperties +WHERE ServiceID = @ServiceID +AND PropertyName COLLATE Latin1_General_CI_AS IN +( + SELECT PropertyName + FROM OPENXML(@idoc, '/properties/property', 1) + WITH (PropertyName nvarchar(50) '@name') +) + +INSERT INTO ServiceProperties +( + ServiceID, + PropertyName, + PropertyValue +) +SELECT + @ServiceID, + PropertyName, + PropertyValue +FROM OPENXML(@idoc, '/properties/property',1) WITH +( + PropertyName nvarchar(50) '@name', + PropertyValue nvarchar(1000) '@value' +) as PV + +-- remove document +exec sp_xml_removedocument @idoc + +COMMIT TRAN +RETURN +GO + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.cs index c414927e..ba4737f3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.cs @@ -275,7 +275,12 @@ namespace WebsitePanel.Portal.ProviderControls // Helicon Ape bool registerHeliconApeGlobbally = chkHeliconApeGlobalRegistration.Checked; - if (registerHeliconApeGlobbally != (bool)ViewState["HeliconApeInitiallyEnabled"]) + + bool bHeliconApeInitiallyEnabled = false; + if (ViewState["HeliconApeInitiallyEnabled"] != null) + bHeliconApeInitiallyEnabled = (bool)ViewState["HeliconApeInitiallyEnabled"]; + + if (registerHeliconApeGlobbally != bHeliconApeInitiallyEnabled) { if (registerHeliconApeGlobbally) {