wsp-10299 Web Publishing not created in IIS 8.5 + related bugs. Update Sql.

This commit is contained in:
Alexander Trofimov 2015-01-26 19:06:01 +07:00
parent 45425c12d2
commit d4d62f4ebf
5 changed files with 156 additions and 23 deletions

View file

@ -35236,12 +35236,15 @@ EXEC sp_xml_preparedocument @idoc OUTPUT, @XmlProperties
DELETE FROM ServiceItemProperties
WHERE ItemID = @ItemID
INSERT INTO ServiceItemProperties
(
ItemID,
PropertyName,
PropertyValue
)
-- Add the xml data into a temp table for the capability and robust
IF OBJECT_ID('tempdb..#TempTable') IS NOT NULL DROP TABLE #TempTable
CREATE TABLE #TempTable(
ItemID int,
PropertyName nvarchar(50),
PropertyValue nvarchar(3000))
INSERT INTO #TempTable (ItemID, PropertyName, PropertyValue)
SELECT
@ItemID,
PropertyName,
@ -35252,6 +35255,21 @@ FROM OPENXML(@idoc, '/properties/property',1) WITH
PropertyValue nvarchar(3000) '@value'
) as PV
-- Move data from temp table to real table
INSERT INTO ServiceItemProperties
(
ItemID,
PropertyName,
PropertyValue
)
SELECT
ItemID,
PropertyName,
PropertyValue
FROM #TempTable
DROP TABLE #TempTable
-- remove document
exec sp_xml_removedocument @idoc

View file

@ -8307,3 +8307,81 @@ BEGIN
INSERT INTO [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_DELETE_EXCHANGE_ACCOUNTS', N'WebsitePanel.EnterpriseServer.DeleteExchangeAccountsTask, WebsitePanel.EnterpriseServer.Code', 3)
END
GO
ALTER PROCEDURE [dbo].[UpdateServiceItem]
(
@ActorID int,
@ItemID int,
@ItemName nvarchar(500),
@XmlProperties ntext
)
AS
BEGIN TRAN
-- 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)
-- update item
UPDATE ServiceItems SET ItemName = @ItemName
WHERE ItemID=@ItemID
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @XmlProperties
-- Execute a SELECT statement that uses the OPENXML rowset provider.
DELETE FROM ServiceItemProperties
WHERE ItemID = @ItemID
-- Add the xml data into a temp table for the capability and robust
IF OBJECT_ID('tempdb..#TempTable') IS NOT NULL DROP TABLE #TempTable
CREATE TABLE #TempTable(
ItemID int,
PropertyName nvarchar(50),
PropertyValue nvarchar(3000))
INSERT INTO #TempTable (ItemID, PropertyName, PropertyValue)
SELECT
@ItemID,
PropertyName,
PropertyValue
FROM OPENXML(@idoc, '/properties/property',1) WITH
(
PropertyName nvarchar(50) '@name',
PropertyValue nvarchar(3000) '@value'
) as PV
-- Move data from temp table to real table
INSERT INTO ServiceItemProperties
(
ItemID,
PropertyName,
PropertyValue
)
SELECT
ItemID,
PropertyName,
PropertyValue
FROM #TempTable
DROP TABLE #TempTable
-- remove document
exec sp_xml_removedocument @idoc
COMMIT TRAN
RETURN
GO

View file

@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WebsitePanel.Providers.Web.Iis.Common;
using Microsoft.Web.Administration;
@ -45,7 +46,11 @@ namespace WebsitePanel.Providers.Web.Delegation
using (var srvman = new ServerManager())
{
var adminConfig = srvman.GetAdministrationConfiguration();
//
// return if system.webServer/management/delegation section is not exist in config file
if (!HasDelegationSection(adminConfig))
return;
var delegationSection = adminConfig.GetSection("system.webServer/management/delegation");
//
var rulesCollection = delegationSection.GetCollection();
@ -103,7 +108,11 @@ namespace WebsitePanel.Providers.Web.Delegation
using (var srvman = new ServerManager())
{
var adminConfig = srvman.GetAdministrationConfiguration();
//
// return if system.webServer/management/delegation section is not exist in config file
if (!HasDelegationSection(adminConfig))
return;
var delegationSection = adminConfig.GetSection("system.webServer/management/delegation");
//
var rulesCollection = delegationSection.GetCollection();
@ -142,7 +151,11 @@ namespace WebsitePanel.Providers.Web.Delegation
using (var srvman = new ServerManager())
{
var adminConfig = srvman.GetAdministrationConfiguration();
//
// return if system.webServer/management/delegation section is not exist in config file
if (!HasDelegationSection(adminConfig))
return false;
var delegationSection = adminConfig.GetSection("system.webServer/management/delegation");
//
var rulesCollection = delegationSection.GetCollection();
@ -171,7 +184,11 @@ namespace WebsitePanel.Providers.Web.Delegation
using (var srvman = GetServerManager())
{
var adminConfig = srvman.GetAdministrationConfiguration();
//
// return if system.webServer/management/delegation section is not exist in config file
if (!HasDelegationSection(adminConfig))
return;
var delegationSection = adminConfig.GetSection("system.webServer/management/delegation");
//
var rulesCollection = delegationSection.GetCollection();
@ -245,7 +262,11 @@ namespace WebsitePanel.Providers.Web.Delegation
using (var srvman = GetServerManager())
{
var adminConfig = srvman.GetAdministrationConfiguration();
//
// return if system.webServer/management/delegation section is not exist in config file
if (!HasDelegationSection(adminConfig))
return;
var delegationSection = adminConfig.GetSection("system.webServer/management/delegation");
//
var rulesCollection = delegationSection.GetCollection();
@ -264,5 +285,21 @@ namespace WebsitePanel.Providers.Web.Delegation
}
}
}
private bool HasDelegationSection(Configuration adminConfig)
{
// try to get delegation section in config file (C:\Windows\system32\inetsrv\config\administration.config)
try
{
adminConfig.GetSection("system.webServer/management/delegation");
}
catch (Exception ex)
{
/* skip */
return false;
}
return true;
}
}
}

View file

@ -2072,7 +2072,7 @@ namespace WebsitePanel.Providers.Web
public new void GrantWebDeployPublishingAccess(string siteName, string accountName, string accountPassword)
{
// Web Publishing Access feature requires FullControl permissions on the web site's wwwroot folder
//GrantWebManagementAccessInternally(siteName, accountName, accountPassword, NTFSPermission.FullControl);
GrantWebManagementAccessInternally(siteName, accountName, accountPassword, NTFSPermission.FullControl);
//
EnforceDelegationRulesRestrictions(siteName, accountName);
}
@ -2086,7 +2086,7 @@ namespace WebsitePanel.Providers.Web
public new void RevokeWebDeployPublishingAccess(string siteName, string accountName)
{
// Web Publishing Access feature requires FullControl permissions on the web site's wwwroot folder
//RevokeWebManagementAccess(siteName, accountName);
RevokeWebManagementAccess(siteName, accountName);
//
RemoveDelegationRulesRestrictions(siteName, accountName);
}
@ -4336,13 +4336,13 @@ namespace WebsitePanel.Providers.Web
protected string GetFullQualifiedAccountName(string accountName)
{
if (accountName.IndexOf("\\") != -1)
return accountName; // already has domain information
//
if (!ServerSettings.ADEnabled)
return String.Format(@"{0}\{1}", Environment.MachineName, accountName);
if (accountName.IndexOf("\\") != -1)
return accountName; // already has domain information
// DO IT FOR ACTIVE DIRECTORY MODE ONLY
string domainName = null;
try

View file

@ -546,7 +546,7 @@ namespace WebsitePanel.Portal
WDeployPublishingConfirmPasswordTextBox,
WDeployPublishingAccountRequiredFieldValidator);
WDeployPublishingAccountTextBox.Text = AutoSuggestWmSvcAccontName(item, "_dploy");
WDeployPublishingAccountTextBox.Text = AutoSuggestWmSvcAccontName(item, "_deploy");
//
WDeployPublishingAccountRequiredFieldValidator.Enabled = true;
//