CheckLoadUserProfile
This commit is contained in:
parent
cfb58e3423
commit
444473a73d
10 changed files with 641 additions and 233 deletions
File diff suppressed because it is too large
Load diff
|
@ -33,6 +33,7 @@ using System.Data.SqlClient;
|
|||
using System.Text.RegularExpressions;
|
||||
using WebsitePanel.Providers.HostedSolution;
|
||||
using Microsoft.ApplicationBlocks.Data;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace WebsitePanel.EnterpriseServer
|
||||
{
|
||||
|
@ -3399,5 +3400,45 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
#endregion
|
||||
|
||||
public static int GetPackageIdByName(string Name)
|
||||
{
|
||||
// get Helicon Zoo provider
|
||||
int packageId = -1;
|
||||
List<ProviderInfo> providers = ServerController.GetProviders();
|
||||
foreach (ProviderInfo providerInfo in providers)
|
||||
{
|
||||
if (string.Equals(Name, providerInfo.ProviderName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
packageId = providerInfo.ProviderId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (-1 == packageId)
|
||||
{
|
||||
throw new Exception("Provider not found");
|
||||
}
|
||||
|
||||
return packageId;
|
||||
}
|
||||
|
||||
public static int GetServiceIdByProviderForServer(int providerId, int serverId)
|
||||
{
|
||||
IDataReader reader = SqlHelper.ExecuteReader(ConnectionString, CommandType.Text,
|
||||
@"SELECT TOP 1
|
||||
ServiceID
|
||||
FROM Services
|
||||
WHERE ProviderID = @ProviderID AND ServerID = @ServerID",
|
||||
new SqlParameter("@ProviderID", providerId),
|
||||
new SqlParameter("@ServerID", serverId));
|
||||
|
||||
if (reader.Read())
|
||||
{
|
||||
return (int)reader["ServiceID"];
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ using WebsitePanel.Providers.OS;
|
|||
using OS = WebsitePanel.Providers.OS;
|
||||
using System.Collections;
|
||||
|
||||
|
||||
namespace WebsitePanel.EnterpriseServer
|
||||
{
|
||||
public class OperatingSystemController : IImportController, IBackupController
|
||||
|
@ -409,6 +410,23 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
#region Web Platform Installer
|
||||
|
||||
public static bool CheckLoadUserProfile(int serverId)
|
||||
{
|
||||
int packageId = DataProvider.GetPackageIdByName("IIS70");
|
||||
int serviceId = DataProvider.GetServiceIdByProviderForServer(packageId, serverId);
|
||||
return WebServerController.GetWebServer(serviceId).CheckLoadUserProfile();
|
||||
|
||||
}
|
||||
|
||||
public static void EnableLoadUserProfile(int serverId)
|
||||
{
|
||||
int packageId = DataProvider.GetPackageIdByName("IIS70");
|
||||
int serviceId = DataProvider.GetServiceIdByProviderForServer(packageId, serverId);
|
||||
WebServerController.GetWebServer(serviceId).EnableLoadUserProfile();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void InitWPIFeeds(int serverId, string feedUrls)
|
||||
{
|
||||
GetServerService(serverId).InitWPIFeeds(feedUrls);
|
||||
|
@ -746,6 +764,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -670,6 +670,20 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
#region Web Platform Installer
|
||||
|
||||
[WebMethod]
|
||||
public bool CheckLoadUserProfile(int serverId)
|
||||
{
|
||||
return OperatingSystemController.CheckLoadUserProfile(serverId);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void EnableLoadUserProfile(int serverId)
|
||||
{
|
||||
OperatingSystemController.EnableLoadUserProfile(serverId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
[WebMethod]
|
||||
public void InitWPIFeeds(int serverId)
|
||||
{
|
||||
|
|
|
@ -119,6 +119,8 @@ namespace WebsitePanel.Providers.Web
|
|||
|
||||
|
||||
// web app gallery
|
||||
bool CheckLoadUserProfile();
|
||||
void EnableLoadUserProfile();
|
||||
void InitFeeds(int UserId, string[] feeds);
|
||||
void SetResourceLanguage(int UserId, string resourceLanguage);
|
||||
bool IsMsDeployInstalled();
|
||||
|
@ -153,5 +155,7 @@ namespace WebsitePanel.Providers.Web
|
|||
ResultObject DeleteCertificate(SSLCertificate certificate, WebSite website);
|
||||
SSLCertificate ImportCertificate(WebSite website);
|
||||
bool CheckCertificate(WebSite webSite);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4042,6 +4042,26 @@ namespace WebsitePanel.Providers.Web
|
|||
|
||||
// moved down to IIs60
|
||||
|
||||
override public bool CheckLoadUserProfile()
|
||||
{
|
||||
using (var srvman = new ServerManager())
|
||||
{
|
||||
return srvman.ApplicationPools["WebsitePanel Server"].ProcessModel.LoadUserProfile;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override public void EnableLoadUserProfile()
|
||||
{
|
||||
using (var srvman = new ServerManager())
|
||||
{
|
||||
srvman.ApplicationPools["WebsitePanel Server"].ProcessModel.LoadUserProfile = true;
|
||||
// save changes
|
||||
srvman.CommitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3394,6 +3394,18 @@ namespace WebsitePanel.Providers.Web
|
|||
private const string WPI_INSTANCE_VIEWER = "viewer";
|
||||
private const string WPI_INSTANCE_INSTALLER = "installer";
|
||||
|
||||
virtual public bool CheckLoadUserProfile()
|
||||
{
|
||||
throw new NotImplementedException("LoadUserProfile option valid only on IIS7 or higer");
|
||||
}
|
||||
|
||||
virtual public void EnableLoadUserProfile()
|
||||
{
|
||||
throw new NotImplementedException("LoadUserProfile option valid only on IIS7 or higer");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void InitFeeds(int UserId, string[] feeds)
|
||||
{
|
||||
//need to call InitFeeds() before any operation with WPIApplicationGallery()
|
||||
|
@ -3667,5 +3679,10 @@ namespace WebsitePanel.Providers.Web
|
|||
throw new NotSupportedException();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
// Copyright (c) 2012, Outercurve Foundation.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this
|
||||
// list of conditions and the following disclaimer.
|
||||
|
@ -50,6 +45,7 @@ namespace WebsitePanel.Providers.Web
|
|||
using WebsitePanel.Providers.ResultObjects;
|
||||
using WebsitePanel.Providers.WebAppGallery;
|
||||
using WebsitePanel.Providers.Common;
|
||||
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
|
@ -180,6 +176,10 @@ namespace WebsitePanel.Providers.Web
|
|||
|
||||
private System.Threading.SendOrPostCallback DeleteHeliconApeGroupOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback CheckLoadUserProfileOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback EnableLoadUserProfileOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback InitFeedsOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback SetResourceLanguageOperationCompleted;
|
||||
|
@ -416,6 +416,12 @@ namespace WebsitePanel.Providers.Web
|
|||
/// <remarks/>
|
||||
public event DeleteHeliconApeGroupCompletedEventHandler DeleteHeliconApeGroupCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event CheckLoadUserProfileCompletedEventHandler CheckLoadUserProfileCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event EnableLoadUserProfileCompletedEventHandler EnableLoadUserProfileCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event InitFeedsCompletedEventHandler InitFeedsCompleted;
|
||||
|
||||
|
@ -3005,6 +3011,82 @@ namespace WebsitePanel.Providers.Web
|
|||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CheckLoadUserProfile", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public bool CheckLoadUserProfile() {
|
||||
object[] results = this.Invoke("CheckLoadUserProfile", new object[0]);
|
||||
return ((bool)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginCheckLoadUserProfile(System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("CheckLoadUserProfile", new object[0], callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public bool EndCheckLoadUserProfile(System.IAsyncResult asyncResult) {
|
||||
object[] results = this.EndInvoke(asyncResult);
|
||||
return ((bool)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void CheckLoadUserProfileAsync() {
|
||||
this.CheckLoadUserProfileAsync(null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void CheckLoadUserProfileAsync(object userState) {
|
||||
if ((this.CheckLoadUserProfileOperationCompleted == null)) {
|
||||
this.CheckLoadUserProfileOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckLoadUserProfileOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("CheckLoadUserProfile", new object[0], this.CheckLoadUserProfileOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnCheckLoadUserProfileOperationCompleted(object arg) {
|
||||
if ((this.CheckLoadUserProfileCompleted != null)) {
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.CheckLoadUserProfileCompleted(this, new CheckLoadUserProfileCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/EnableLoadUserProfile", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public void EnableLoadUserProfile() {
|
||||
this.Invoke("EnableLoadUserProfile", new object[0]);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginEnableLoadUserProfile(System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("EnableLoadUserProfile", new object[0], callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void EndEnableLoadUserProfile(System.IAsyncResult asyncResult) {
|
||||
this.EndInvoke(asyncResult);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void EnableLoadUserProfileAsync() {
|
||||
this.EnableLoadUserProfileAsync(null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void EnableLoadUserProfileAsync(object userState) {
|
||||
if ((this.EnableLoadUserProfileOperationCompleted == null)) {
|
||||
this.EnableLoadUserProfileOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnableLoadUserProfileOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("EnableLoadUserProfile", new object[0], this.EnableLoadUserProfileOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnEnableLoadUserProfileOperationCompleted(object arg) {
|
||||
if ((this.EnableLoadUserProfileCompleted != null)) {
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.EnableLoadUserProfileCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/InitFeeds", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
|
@ -5064,6 +5146,36 @@ namespace WebsitePanel.Providers.Web
|
|||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
|
||||
public delegate void DeleteHeliconApeGroupCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
|
||||
public delegate void CheckLoadUserProfileCompletedEventHandler(object sender, CheckLoadUserProfileCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
public partial class CheckLoadUserProfileCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||
|
||||
private object[] results;
|
||||
|
||||
internal CheckLoadUserProfileCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||
base(exception, cancelled, userState) {
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public bool Result {
|
||||
get {
|
||||
this.RaiseExceptionIfNecessary();
|
||||
return ((bool)(this.results[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
|
||||
public delegate void EnableLoadUserProfileCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
|
||||
public delegate void InitFeedsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||
|
|
|
@ -1061,6 +1061,42 @@ namespace WebsitePanel.Server
|
|||
#endregion
|
||||
|
||||
#region Web Application Gallery
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public bool CheckLoadUserProfile()
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("CheckLoadUserProfile");
|
||||
|
||||
return WebProvider.CheckLoadUserProfile();
|
||||
|
||||
Log.WriteEnd("CheckLoadUserProfile");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError("CheckLoadUserProfile", ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public void EnableLoadUserProfile()
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("EnableLoadUserProfile");
|
||||
|
||||
WebProvider.EnableLoadUserProfile();
|
||||
|
||||
Log.WriteEnd("EnableLoadUserProfile");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError("EnableLoadUserProfile", ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public void InitFeeds(int UserId, string[] feeds)
|
||||
{
|
||||
|
|
|
@ -52,6 +52,30 @@ namespace WebsitePanel.Portal
|
|||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
if (!ES.Services.Servers.CheckLoadUserProfile(PanelRequest.ServerId))
|
||||
{
|
||||
ShowWarningMessage("Server application pool \"Load User Profile\" setting is set to false. Please open IIS Manager, Application Pools, select pool running Web Site Panel Server component and set \"Load User Profile\" to TRUE. This setting is required for Web Paltform Installer to run.");
|
||||
|
||||
//ES.Services.Servers.EnableLoadUserProfile(PanelRequest.ServerId);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
ProductsPanel.Visible = false;
|
||||
keywordsList.Visible = false;
|
||||
SearchPanel.Visible = false;
|
||||
InstallButtons1.Visible = false;
|
||||
InstallButtons2.Visible = false;
|
||||
|
||||
ShowWarningMessage("Server application pool \"Load User Profile\" setting is set to false. Please open IIS Manager, Application Pools, select pool running Web Site Panel Server component and set \"Load User Profile\" to TRUE. This setting is required for Web Paltform Installer to run.");
|
||||
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
ES.Services.Servers.InitWPIFeeds(PanelRequest.ServerId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue