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

@ -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,8 +46,12 @@ namespace WebsitePanel.Providers.Web.Delegation
using (var srvman = new ServerManager())
{
var adminConfig = srvman.GetAdministrationConfiguration();
//
var delegationSection = adminConfig.GetSection("system.webServer/management/delegation");
// 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();
// Update rule if exists
@ -103,8 +108,12 @@ namespace WebsitePanel.Providers.Web.Delegation
using (var srvman = new ServerManager())
{
var adminConfig = srvman.GetAdministrationConfiguration();
//
var delegationSection = adminConfig.GetSection("system.webServer/management/delegation");
// 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();
// Update rule if exists
@ -142,8 +151,12 @@ namespace WebsitePanel.Providers.Web.Delegation
using (var srvman = new ServerManager())
{
var adminConfig = srvman.GetAdministrationConfiguration();
//
var delegationSection = adminConfig.GetSection("system.webServer/management/delegation");
// 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();
// Update rule if exists
@ -171,8 +184,12 @@ namespace WebsitePanel.Providers.Web.Delegation
using (var srvman = GetServerManager())
{
var adminConfig = srvman.GetAdministrationConfiguration();
//
var delegationSection = adminConfig.GetSection("system.webServer/management/delegation");
// 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();
// Update rule if exists
@ -245,8 +262,12 @@ namespace WebsitePanel.Providers.Web.Delegation
using (var srvman = GetServerManager())
{
var adminConfig = srvman.GetAdministrationConfiguration();
//
var delegationSection = adminConfig.GetSection("system.webServer/management/delegation");
// 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();
// Remove rule if exists
@ -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