diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 08746cc4..cd99bc7a 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -5416,4 +5416,79 @@ exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @PackageID int, @Fil RETURN -GO \ No newline at end of file +GO + + + + + + +ALTER PROCEDURE [dbo].[DeleteServiceItem] +( + @ActorID int, + @ItemID int +) +AS + +-- check rights +DECLARE @PackageID int +SELECT PackageID = @PackageID FROM ServiceItems +WHERE ItemID = @ItemID + +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +BEGIN TRAN + +UPDATE Domains +SET ZoneItemID = NULL +WHERE ZoneItemID = @ItemID + +DELETE FROM Domains +WHERE WebSiteID = @ItemID AND IsDomainPointer = 1 + +UPDATE Domains +SET WebSiteID = NULL +WHERE WebSiteID = @ItemID + +UPDATE Domains +SET MailDomainID = NULL +WHERE MailDomainID = @ItemID + +-- delete item comments +DELETE FROM Comments +WHERE ItemID = @ItemID AND ItemTypeID = 'SERVICE_ITEM' + +-- delete item properties +DELETE FROM ServiceItemProperties +WHERE ItemID = @ItemID + +-- delete external IP addresses +EXEC dbo.DeleteItemIPAddresses @ActorID, @ItemID + +-- delete item +DELETE FROM ServiceItems +WHERE ItemID = @ItemID + +COMMIT TRAN + +RETURN + +GO + + + + + + + + + + + + + + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.sln b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.sln index f28eaeef..36ca6285 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.sln +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.sln @@ -2,7 +2,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2010 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C57D3F9F-7BA0-4D38-A159-B6EDA5C19B13}" ProjectSection(SolutionItems) = preProject - ..\Database\install_db.sql = ..\Database\install_db.sql ..\..\LICENSE.txt = ..\..\LICENSE.txt ..\..\Readme.htm = ..\..\Readme.htm ..\..\ReleaseNotes.htm = ..\..\ReleaseNotes.htm