Main RDS Service added to System Settings
This commit is contained in:
parent
743563baa2
commit
d8393577d3
16 changed files with 403 additions and 165 deletions
|
@ -44,6 +44,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
public const string WPI_SETTINGS = "WpiSettings";
|
||||
public const string FILEMANAGER_SETTINGS = "FileManagerSettings";
|
||||
public const string PACKAGE_DISPLAY_SETTINGS = "PackageDisplaySettings";
|
||||
public const string RDS_SETTINGS = "RdsSettings";
|
||||
|
||||
// key to access to wpi main & custom feed in wpi settings
|
||||
public const string WPI_MAIN_FEED_KEY = "WpiMainFeedUrl";
|
||||
|
|
|
@ -18,9 +18,9 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
using System.Web.Services.Protocols;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using WebsitePanel.Providers.HostedSolution;
|
||||
using WebsitePanel.Providers.RemoteDesktopServices;
|
||||
using WebsitePanel.Providers.Common;
|
||||
using WebsitePanel.Providers.HostedSolution;
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
|
@ -126,6 +126,8 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
|
||||
private System.Threading.SendOrPostCallback AddRdsCertificateOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback GetRdsServicesOperationCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public esRemoteDesktopServices() {
|
||||
this.Url = "http://localhost:9002/esRemoteDesktopServices.asmx";
|
||||
|
@ -275,6 +277,9 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
/// <remarks/>
|
||||
public event AddRdsCertificateCompletedEventHandler AddRdsCertificateCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event GetRdsServicesCompletedEventHandler GetRdsServicesCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCollection", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public RdsCollection GetRdsCollection(int collectionId) {
|
||||
|
@ -1999,7 +2004,7 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsServerInfo", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public RdsServerInfo GetRdsServerInfo(int itemId, string fqdnName) {
|
||||
public RdsServerInfo GetRdsServerInfo([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> itemId, string fqdnName) {
|
||||
object[] results = this.Invoke("GetRdsServerInfo", new object[] {
|
||||
itemId,
|
||||
fqdnName});
|
||||
|
@ -2007,7 +2012,7 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginGetRdsServerInfo(int itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||
public System.IAsyncResult BeginGetRdsServerInfo(System.Nullable<int> itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("GetRdsServerInfo", new object[] {
|
||||
itemId,
|
||||
fqdnName}, callback, asyncState);
|
||||
|
@ -2020,12 +2025,12 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsServerInfoAsync(int itemId, string fqdnName) {
|
||||
public void GetRdsServerInfoAsync(System.Nullable<int> itemId, string fqdnName) {
|
||||
this.GetRdsServerInfoAsync(itemId, fqdnName, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsServerInfoAsync(int itemId, string fqdnName, object userState) {
|
||||
public void GetRdsServerInfoAsync(System.Nullable<int> itemId, string fqdnName, object userState) {
|
||||
if ((this.GetRdsServerInfoOperationCompleted == null)) {
|
||||
this.GetRdsServerInfoOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsServerInfoOperationCompleted);
|
||||
}
|
||||
|
@ -2043,7 +2048,7 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsServerStatus", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public string GetRdsServerStatus(int itemId, string fqdnName) {
|
||||
public string GetRdsServerStatus([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> itemId, string fqdnName) {
|
||||
object[] results = this.Invoke("GetRdsServerStatus", new object[] {
|
||||
itemId,
|
||||
fqdnName});
|
||||
|
@ -2051,7 +2056,7 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginGetRdsServerStatus(int itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||
public System.IAsyncResult BeginGetRdsServerStatus(System.Nullable<int> itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("GetRdsServerStatus", new object[] {
|
||||
itemId,
|
||||
fqdnName}, callback, asyncState);
|
||||
|
@ -2064,12 +2069,12 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsServerStatusAsync(int itemId, string fqdnName) {
|
||||
public void GetRdsServerStatusAsync(System.Nullable<int> itemId, string fqdnName) {
|
||||
this.GetRdsServerStatusAsync(itemId, fqdnName, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsServerStatusAsync(int itemId, string fqdnName, object userState) {
|
||||
public void GetRdsServerStatusAsync(System.Nullable<int> itemId, string fqdnName, object userState) {
|
||||
if ((this.GetRdsServerStatusOperationCompleted == null)) {
|
||||
this.GetRdsServerStatusOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsServerStatusOperationCompleted);
|
||||
}
|
||||
|
@ -2087,7 +2092,7 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/ShutDownRdsServer", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public ResultObject ShutDownRdsServer(int itemId, string fqdnName) {
|
||||
public ResultObject ShutDownRdsServer([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> itemId, string fqdnName) {
|
||||
object[] results = this.Invoke("ShutDownRdsServer", new object[] {
|
||||
itemId,
|
||||
fqdnName});
|
||||
|
@ -2095,7 +2100,7 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginShutDownRdsServer(int itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||
public System.IAsyncResult BeginShutDownRdsServer(System.Nullable<int> itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("ShutDownRdsServer", new object[] {
|
||||
itemId,
|
||||
fqdnName}, callback, asyncState);
|
||||
|
@ -2108,12 +2113,12 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void ShutDownRdsServerAsync(int itemId, string fqdnName) {
|
||||
public void ShutDownRdsServerAsync(System.Nullable<int> itemId, string fqdnName) {
|
||||
this.ShutDownRdsServerAsync(itemId, fqdnName, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void ShutDownRdsServerAsync(int itemId, string fqdnName, object userState) {
|
||||
public void ShutDownRdsServerAsync(System.Nullable<int> itemId, string fqdnName, object userState) {
|
||||
if ((this.ShutDownRdsServerOperationCompleted == null)) {
|
||||
this.ShutDownRdsServerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnShutDownRdsServerOperationCompleted);
|
||||
}
|
||||
|
@ -2131,7 +2136,7 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/RestartRdsServer", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public ResultObject RestartRdsServer(int itemId, string fqdnName) {
|
||||
public ResultObject RestartRdsServer([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> itemId, string fqdnName) {
|
||||
object[] results = this.Invoke("RestartRdsServer", new object[] {
|
||||
itemId,
|
||||
fqdnName});
|
||||
|
@ -2139,7 +2144,7 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginRestartRdsServer(int itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||
public System.IAsyncResult BeginRestartRdsServer(System.Nullable<int> itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("RestartRdsServer", new object[] {
|
||||
itemId,
|
||||
fqdnName}, callback, asyncState);
|
||||
|
@ -2152,12 +2157,12 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void RestartRdsServerAsync(int itemId, string fqdnName) {
|
||||
public void RestartRdsServerAsync(System.Nullable<int> itemId, string fqdnName) {
|
||||
this.RestartRdsServerAsync(itemId, fqdnName, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void RestartRdsServerAsync(int itemId, string fqdnName, object userState) {
|
||||
public void RestartRdsServerAsync(System.Nullable<int> itemId, string fqdnName, object userState) {
|
||||
if ((this.RestartRdsServerOperationCompleted == null)) {
|
||||
this.RestartRdsServerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRestartRdsServerOperationCompleted);
|
||||
}
|
||||
|
@ -2342,14 +2347,14 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCertificateByItemId", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public RdsCertificate GetRdsCertificateByItemId(int itemId) {
|
||||
public RdsCertificate GetRdsCertificateByItemId([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> itemId) {
|
||||
object[] results = this.Invoke("GetRdsCertificateByItemId", new object[] {
|
||||
itemId});
|
||||
return ((RdsCertificate)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginGetRdsCertificateByItemId(int itemId, System.AsyncCallback callback, object asyncState) {
|
||||
public System.IAsyncResult BeginGetRdsCertificateByItemId(System.Nullable<int> itemId, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("GetRdsCertificateByItemId", new object[] {
|
||||
itemId}, callback, asyncState);
|
||||
}
|
||||
|
@ -2361,12 +2366,12 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsCertificateByItemIdAsync(int itemId) {
|
||||
public void GetRdsCertificateByItemIdAsync(System.Nullable<int> itemId) {
|
||||
this.GetRdsCertificateByItemIdAsync(itemId, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsCertificateByItemIdAsync(int itemId, object userState) {
|
||||
public void GetRdsCertificateByItemIdAsync(System.Nullable<int> itemId, object userState) {
|
||||
if ((this.GetRdsCertificateByItemIdOperationCompleted == null)) {
|
||||
this.GetRdsCertificateByItemIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsCertificateByItemIdOperationCompleted);
|
||||
}
|
||||
|
@ -2422,6 +2427,44 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsServices", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public ServiceInfo[] GetRdsServices() {
|
||||
object[] results = this.Invoke("GetRdsServices", new object[0]);
|
||||
return ((ServiceInfo[])(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginGetRdsServices(System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("GetRdsServices", new object[0], callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public ServiceInfo[] EndGetRdsServices(System.IAsyncResult asyncResult) {
|
||||
object[] results = this.EndInvoke(asyncResult);
|
||||
return ((ServiceInfo[])(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsServicesAsync() {
|
||||
this.GetRdsServicesAsync(null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsServicesAsync(object userState) {
|
||||
if ((this.GetRdsServicesOperationCompleted == null)) {
|
||||
this.GetRdsServicesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsServicesOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("GetRdsServices", new object[0], this.GetRdsServicesOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnGetRdsServicesOperationCompleted(object arg) {
|
||||
if ((this.GetRdsServicesCompleted != null)) {
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.GetRdsServicesCompleted(this, new GetRdsServicesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public new void CancelAsync(object userState) {
|
||||
base.CancelAsync(userState);
|
||||
|
@ -3675,4 +3718,30 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void GetRdsServicesCompletedEventHandler(object sender, GetRdsServicesCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
public partial class GetRdsServicesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||
|
||||
private object[] results;
|
||||
|
||||
internal GetRdsServicesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||
base(exception, cancelled, userState) {
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public ServiceInfo[] Result {
|
||||
get {
|
||||
this.RaiseExceptionIfNecessary();
|
||||
return ((ServiceInfo[])(this.results[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -248,22 +248,22 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return GetRdsCollectionSessionHostsInternal(collectionId);
|
||||
}
|
||||
|
||||
public static RdsServerInfo GetRdsServerInfo(int itemId, string fqdnName)
|
||||
public static RdsServerInfo GetRdsServerInfo(int? itemId, string fqdnName)
|
||||
{
|
||||
return GetRdsServerInfoInternal(itemId, fqdnName);
|
||||
}
|
||||
|
||||
public static string GetRdsServerStatus(int itemId, string fqdnName)
|
||||
public static string GetRdsServerStatus(int? itemId, string fqdnName)
|
||||
{
|
||||
return GetRdsServerStatusInternal(itemId, fqdnName);
|
||||
}
|
||||
|
||||
public static ResultObject ShutDownRdsServer(int itemId, string fqdnName)
|
||||
public static ResultObject ShutDownRdsServer(int? itemId, string fqdnName)
|
||||
{
|
||||
return ShutDownRdsServerInternal(itemId, fqdnName);
|
||||
}
|
||||
|
||||
public static ResultObject RestartRdsServer(int itemId, string fqdnName)
|
||||
public static ResultObject RestartRdsServer(int? itemId, string fqdnName)
|
||||
{
|
||||
return RestartRdsServerInternal(itemId, fqdnName);
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return GetRdsCertificateByServiceIdInternal(serviceId);
|
||||
}
|
||||
|
||||
public static RdsCertificate GetRdsCertificateByItemId(int itemId)
|
||||
public static RdsCertificate GetRdsCertificateByItemId(int? itemId)
|
||||
{
|
||||
return GetRdsCertificateByItemIdInternal(itemId);
|
||||
}
|
||||
|
@ -298,22 +298,23 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return AddRdsCertificateInternal(certificate);
|
||||
}
|
||||
|
||||
public static List<ServiceInfo> GetRdsServices()
|
||||
{
|
||||
return GetRdsServicesInternal();
|
||||
}
|
||||
|
||||
private static List<ServiceInfo> GetRdsServicesInternal()
|
||||
{
|
||||
return ObjectUtils.CreateListFromDataSet<ServiceInfo>(DataProvider.GetServicesByGroupName(SecurityContext.User.UserId, ResourceGroups.RDS));
|
||||
}
|
||||
|
||||
private static ResultObject InstallSessionHostsCertificateInternal(RdsServer rdsServer)
|
||||
{
|
||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "INSTALL_CERTIFICATE");
|
||||
|
||||
try
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(rdsServer.ItemId.Value);
|
||||
|
||||
if (org == null)
|
||||
{
|
||||
result.IsSuccess = false;
|
||||
result.AddError("", new NullReferenceException("Organization not found"));
|
||||
return result;
|
||||
}
|
||||
|
||||
int serviceId = GetRemoteDesktopServiceID(org.PackageId);
|
||||
int serviceId = GetRdsServiceId(rdsServer.ItemId);
|
||||
var rds = GetRemoteDesktopServices(serviceId);
|
||||
var certificate = GetRdsCertificateByServiceIdInternal(serviceId);
|
||||
|
||||
|
@ -351,16 +352,9 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return result;
|
||||
}
|
||||
|
||||
private static RdsCertificate GetRdsCertificateByItemIdInternal(int itemId)
|
||||
private static RdsCertificate GetRdsCertificateByItemIdInternal(int? itemId)
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
|
||||
if (org == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int serviceId = GetRemoteDesktopServiceID(org.PackageId);
|
||||
int serviceId = GetRdsServiceId(itemId);
|
||||
var result = ObjectUtils.FillObjectFromDataReader<RdsCertificate>(DataProvider.GetRdsCertificateByServiceId(serviceId));
|
||||
|
||||
return result;
|
||||
|
@ -539,20 +533,6 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
try
|
||||
{
|
||||
foreach(var server in collection.Servers)
|
||||
{
|
||||
if (!server.FqdName.EndsWith(domainName, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
throw TaskManager.WriteError(new Exception("Fully Qualified Domain Name not valid."));
|
||||
}
|
||||
|
||||
if (!CheckRDSServerAvaliable(server.FqdName))
|
||||
{
|
||||
throw TaskManager.WriteError(new Exception(string.Format("Unable to connect to {0} server.", server.FqdName)));
|
||||
}
|
||||
}
|
||||
|
||||
// load organization
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
if (org == null)
|
||||
{
|
||||
|
@ -560,6 +540,20 @@ namespace WebsitePanel.EnterpriseServer
|
|||
}
|
||||
|
||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||
|
||||
foreach(var server in collection.Servers)
|
||||
{
|
||||
if (!server.FqdName.EndsWith(domainName, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
throw TaskManager.WriteError(new Exception("Fully Qualified Domain Name not valid."));
|
||||
}
|
||||
|
||||
if (!rds.CheckRDSServerAvaliable(server.FqdName))
|
||||
{
|
||||
throw TaskManager.WriteError(new Exception(string.Format("Unable to connect to {0} server.", server.FqdName)));
|
||||
}
|
||||
}
|
||||
|
||||
collection.Name = GetFormattedCollectionName(collection.DisplayName, org.OrganizationId);
|
||||
|
||||
collection.Settings = new RdsCollectionSettings
|
||||
|
@ -1031,12 +1025,17 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
try
|
||||
{
|
||||
if (CheckRDSServerAvaliable(rdsServer.FqdName))
|
||||
int serviceId = GetRdsMainServiceId();
|
||||
var rds = GetRemoteDesktopServices(serviceId);
|
||||
|
||||
if (rds.CheckRDSServerAvaliable(rdsServer.FqdName))
|
||||
{
|
||||
var domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName;
|
||||
|
||||
if (rdsServer.FqdName.EndsWith(domainName, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
rds.AddSessionHostFeatureToServer(rdsServer.FqdName);
|
||||
rds.MoveSessionHostToRdsOU(rdsServer.Name);
|
||||
rdsServer.Id = DataProvider.AddRDSServer(rdsServer.Name, rdsServer.FqdName, rdsServer.Description);
|
||||
}
|
||||
else
|
||||
|
@ -1194,12 +1193,6 @@ namespace WebsitePanel.EnterpriseServer
|
|||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||
|
||||
RdsServer rdsServer = GetRdsServer(serverId);
|
||||
|
||||
//if (!rds.CheckSessionHostFeatureInstallation(rdsServer.FqdName))
|
||||
{
|
||||
rds.AddSessionHostFeatureToServer(rdsServer.FqdName);
|
||||
}
|
||||
|
||||
rds.MoveRdsServerToTenantOU(rdsServer.FqdName, org.OrganizationId);
|
||||
DataProvider.AddRDSServerToOrganization(itemId, serverId);
|
||||
}
|
||||
|
@ -1508,36 +1501,32 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return result;
|
||||
}
|
||||
|
||||
private static RdsServerInfo GetRdsServerInfoInternal(int itemId, string fqdnName)
|
||||
private static RdsServerInfo GetRdsServerInfoInternal(int? itemId, string fqdnName)
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
int serviceId = GetRdsServiceId(itemId);
|
||||
var result = new RdsServerInfo();
|
||||
|
||||
if (org == null)
|
||||
if (serviceId != -1)
|
||||
{
|
||||
return new RdsServerInfo();
|
||||
var rds = GetRemoteDesktopServices(serviceId);
|
||||
result = rds.GetRdsServerInfo(fqdnName);
|
||||
}
|
||||
|
||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||
var result = rds.GetRdsServerInfo(fqdnName);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static string GetRdsServerStatusInternal(int itemId, string fqdnName)
|
||||
private static string GetRdsServerStatusInternal(int? itemId, string fqdnName)
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
var result = "Unavailable";
|
||||
|
||||
if (org == null)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||
var serviceId = GetRdsServiceId(itemId);
|
||||
|
||||
try
|
||||
{
|
||||
result = rds.GetRdsServerStatus(fqdnName);
|
||||
if (serviceId != -1)
|
||||
{
|
||||
var rds = GetRemoteDesktopServices(serviceId);
|
||||
result = rds.GetRdsServerStatus(fqdnName);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -1546,23 +1535,19 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return result;
|
||||
}
|
||||
|
||||
private static ResultObject ShutDownRdsServerInternal(int itemId, string fqdnName)
|
||||
private static ResultObject ShutDownRdsServerInternal(int? itemId, string fqdnName)
|
||||
{
|
||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "SHUTDOWN_RDS_SERVER");
|
||||
|
||||
try
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
int serviceId = GetRdsServiceId(itemId);
|
||||
|
||||
if (org == null)
|
||||
if (serviceId != -1)
|
||||
{
|
||||
result.IsSuccess = false;
|
||||
result.AddError("", new NullReferenceException("Organization not found"));
|
||||
return result;
|
||||
var rds = GetRemoteDesktopServices(serviceId);
|
||||
rds.ShutDownRdsServer(fqdnName);
|
||||
}
|
||||
|
||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||
rds.ShutDownRdsServer(fqdnName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -1583,23 +1568,19 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return result;
|
||||
}
|
||||
|
||||
private static ResultObject RestartRdsServerInternal(int itemId, string fqdnName)
|
||||
private static ResultObject RestartRdsServerInternal(int? itemId, string fqdnName)
|
||||
{
|
||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "RESTART_RDS_SERVER");
|
||||
|
||||
try
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
int serviceId = GetRdsServiceId(itemId);
|
||||
|
||||
if (org == null)
|
||||
if (serviceId != -1)
|
||||
{
|
||||
result.IsSuccess = false;
|
||||
result.AddError("", new NullReferenceException("Organization not found"));
|
||||
return result;
|
||||
var rds = GetRemoteDesktopServices(serviceId);
|
||||
rds.RestartRdsServer(fqdnName);
|
||||
}
|
||||
|
||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||
rds.RestartRdsServer(fqdnName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -1763,20 +1744,6 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return address;
|
||||
}
|
||||
|
||||
private static bool CheckRDSServerAvaliable(string hostname)
|
||||
{
|
||||
bool result = false;
|
||||
var ping = new Ping();
|
||||
var reply = ping.Send(hostname, 1000);
|
||||
|
||||
if (reply.Status == IPStatus.Success)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static ResultObject DeleteRemoteDesktopServiceInternal(int itemId)
|
||||
{
|
||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "CLEANUP");
|
||||
|
@ -1821,6 +1788,29 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return PackageController.GetPackageServiceId(packageId, ResourceGroups.RDS);
|
||||
}
|
||||
|
||||
private static int GetRdsServiceId(int? itemId)
|
||||
{
|
||||
int serviceId = -1;
|
||||
|
||||
if (itemId.HasValue)
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(itemId.Value);
|
||||
|
||||
if (org == null)
|
||||
{
|
||||
return serviceId;
|
||||
}
|
||||
|
||||
serviceId = GetRemoteDesktopServiceID(org.PackageId);
|
||||
}
|
||||
else
|
||||
{
|
||||
serviceId = GetRdsMainServiceId();
|
||||
}
|
||||
|
||||
return serviceId;
|
||||
}
|
||||
|
||||
private static RemoteDesktopServices GetRemoteDesktopServices(int serviceId)
|
||||
{
|
||||
var rds = new RemoteDesktopServices();
|
||||
|
@ -1829,6 +1819,25 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return rds;
|
||||
}
|
||||
|
||||
private static int GetRdsMainServiceId()
|
||||
{
|
||||
var settings = SystemController.GetSystemSettings(WebsitePanel.EnterpriseServer.SystemSettings.RDS_SETTINGS);
|
||||
|
||||
if (!string.IsNullOrEmpty(settings["RdsMainController"]))
|
||||
{
|
||||
return Convert.ToInt32(settings["RdsMainController"]);
|
||||
}
|
||||
|
||||
var rdsServices = GetRdsServicesInternal();
|
||||
|
||||
if (rdsServices.Any())
|
||||
{
|
||||
return rdsServices.First().ServiceId;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
private static string GetFormattedCollectionName(string displayName, string organizationId)
|
||||
{
|
||||
return string.Format("{0}-{1}", organizationId, displayName.Replace(" ", "_"));
|
||||
|
|
|
@ -291,25 +291,25 @@ namespace WebsitePanel.EnterpriseServer
|
|||
}
|
||||
|
||||
[WebMethod]
|
||||
public RdsServerInfo GetRdsServerInfo(int itemId, string fqdnName)
|
||||
public RdsServerInfo GetRdsServerInfo(int? itemId, string fqdnName)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetRdsServerInfo(itemId, fqdnName);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public string GetRdsServerStatus(int itemId, string fqdnName)
|
||||
public string GetRdsServerStatus(int? itemId, string fqdnName)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetRdsServerStatus(itemId, fqdnName);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject ShutDownRdsServer(int itemId, string fqdnName)
|
||||
public ResultObject ShutDownRdsServer(int? itemId, string fqdnName)
|
||||
{
|
||||
return RemoteDesktopServicesController.ShutDownRdsServer(itemId, fqdnName);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject RestartRdsServer(int itemId, string fqdnName)
|
||||
public ResultObject RestartRdsServer(int? itemId, string fqdnName)
|
||||
{
|
||||
return RemoteDesktopServicesController.RestartRdsServer(itemId, fqdnName);
|
||||
}
|
||||
|
@ -339,7 +339,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
}
|
||||
|
||||
[WebMethod]
|
||||
public RdsCertificate GetRdsCertificateByItemId(int itemId)
|
||||
public RdsCertificate GetRdsCertificateByItemId(int? itemId)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetRdsCertificateByItemId(itemId);
|
||||
}
|
||||
|
@ -349,5 +349,11 @@ namespace WebsitePanel.EnterpriseServer
|
|||
{
|
||||
return RemoteDesktopServicesController.AddRdsCertificate(certificate);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public List<ServiceInfo> GetRdsServices()
|
||||
{
|
||||
return RemoteDesktopServicesController.GetRdsServices();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,5 +79,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
void MoveRdsServerToTenantOU(string hostName, string organizationId);
|
||||
void RemoveRdsServerFromTenantOU(string hostName, string organizationId);
|
||||
void InstallCertificate(byte[] certificate, string password, List<string> hostNames);
|
||||
void MoveSessionHostToRdsOU(string hostName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1103,7 +1103,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
{
|
||||
var guid = Guid.NewGuid();
|
||||
var x509Cert = new X509Certificate2(certificate, password, X509KeyStorageFlags.Exportable);
|
||||
//var content = x509Cert.Export(X509ContentType.Pfx);
|
||||
var filePath = SaveCertificate(certificate, guid);
|
||||
runspace = OpenRunspace();
|
||||
|
||||
|
@ -1114,6 +1113,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
|
||||
if (!errors.Any())
|
||||
{
|
||||
RemoveCertificate(runspace, hostName, x509Cert.Thumbprint);
|
||||
errors = ImportCertificate(runspace, hostName, password, string.Format("c:\\{0}.pfx", guid), x509Cert.Thumbprint);
|
||||
}
|
||||
|
||||
|
@ -1137,6 +1137,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
}
|
||||
}
|
||||
|
||||
private void RemoveCertificate(Runspace runspace, string hostName, string thumbprint)
|
||||
{
|
||||
var scripts = new List<string>
|
||||
{
|
||||
string.Format("Remove-Item -Path cert:\\LocalMachine\\My\\{0}", thumbprint)
|
||||
};
|
||||
|
||||
object[] errors = null;
|
||||
ExecuteRemoteShellCommand(runspace, hostName, scripts, out errors);
|
||||
}
|
||||
|
||||
private object[] ImportCertificate(Runspace runspace, string hostName, string password, string certificatePath, string thumbprint)
|
||||
{
|
||||
var scripts = new List<string>
|
||||
|
@ -1366,6 +1377,27 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
}
|
||||
}
|
||||
|
||||
public void MoveSessionHostToRdsOU(string hostName)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ComputersRootOU))
|
||||
{
|
||||
CheckOrCreateComputersRoot(GetComputersRootPath());
|
||||
}
|
||||
|
||||
var computerObject = GetComputerObject(hostName);
|
||||
|
||||
if (computerObject != null)
|
||||
{
|
||||
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
|
||||
|
||||
if (!ActiveDirectoryUtils.IsComputerInGroup(samName, RdsServersRootOU))
|
||||
{
|
||||
DirectoryEntry group = new DirectoryEntry(GetRdsServersGroupPath());
|
||||
computerObject.MoveTo(group);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void MoveRdsServerToTenantOU(string hostName, string organizationId)
|
||||
{
|
||||
var tenantComputerGroupPath = GetTenantComputerGroupPath(organizationId);
|
||||
|
|
|
@ -99,6 +99,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
|
||||
private System.Threading.SendOrPostCallback InstallCertificateOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback MoveSessionHostToRdsOUOperationCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public RemoteDesktopServices() {
|
||||
this.Url = "http://localhost:9003/RemoteDesktopServices.asmx";
|
||||
|
@ -209,6 +211,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
/// <remarks/>
|
||||
public event InstallCertificateCompletedEventHandler InstallCertificateCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event MoveSessionHostToRdsOUCompletedEventHandler MoveSessionHostToRdsOUCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
|
@ -1737,6 +1742,46 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/MoveSessionHostToRdsOU", 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 MoveSessionHostToRdsOU(string hostName) {
|
||||
this.Invoke("MoveSessionHostToRdsOU", new object[] {
|
||||
hostName});
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginMoveSessionHostToRdsOU(string hostName, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("MoveSessionHostToRdsOU", new object[] {
|
||||
hostName}, callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void EndMoveSessionHostToRdsOU(System.IAsyncResult asyncResult) {
|
||||
this.EndInvoke(asyncResult);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void MoveSessionHostToRdsOUAsync(string hostName) {
|
||||
this.MoveSessionHostToRdsOUAsync(hostName, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void MoveSessionHostToRdsOUAsync(string hostName, object userState) {
|
||||
if ((this.MoveSessionHostToRdsOUOperationCompleted == null)) {
|
||||
this.MoveSessionHostToRdsOUOperationCompleted = new System.Threading.SendOrPostCallback(this.OnMoveSessionHostToRdsOUOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("MoveSessionHostToRdsOU", new object[] {
|
||||
hostName}, this.MoveSessionHostToRdsOUOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnMoveSessionHostToRdsOUOperationCompleted(object arg) {
|
||||
if ((this.MoveSessionHostToRdsOUCompleted != null)) {
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.MoveSessionHostToRdsOUCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public new void CancelAsync(object userState) {
|
||||
base.CancelAsync(userState);
|
||||
|
@ -2366,4 +2411,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void InstallCertificateCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void MoveSessionHostToRdsOUCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||
}
|
||||
|
|
|
@ -646,5 +646,21 @@ namespace WebsitePanel.Server
|
|||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public void MoveSessionHostToRdsOU(string hostName)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' MoveSessionHostToRdsOU", ProviderSettings.ProviderName);
|
||||
RDSProvider.MoveSessionHostToRdsOU(hostName);
|
||||
Log.WriteEnd("'{0}' MoveSessionHostToRdsOU", ProviderSettings.ProviderName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' MoveSessionHostToRdsOU", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -162,4 +162,10 @@
|
|||
<data name="litFileManagerEditableExtensions.Text" xml:space="preserve">
|
||||
<value>(One (1) extension per line)</value>
|
||||
</data>
|
||||
<data name="lblRdsController.Text" xml:space="preserve">
|
||||
<value>Main RDS Controller:</value>
|
||||
</data>
|
||||
<data name="RdsSettings.Text" xml:space="preserve">
|
||||
<value>RDS</value>
|
||||
</data>
|
||||
</root>
|
|
@ -54,11 +54,8 @@ namespace WebsitePanel.Portal
|
|||
|
||||
foreach (var rdsServer in rdsServers.Servers)
|
||||
{
|
||||
if (rdsServer.ItemId.HasValue)
|
||||
{
|
||||
rdsServer.Status = ES.Services.RDS.GetRdsServerStatus(rdsServer.ItemId.Value, rdsServer.FqdName);
|
||||
rdsServer.SslAvailable = ES.Services.RDS.GetRdsCertificateByItemId(rdsServer.ItemId.Value) != null;
|
||||
}
|
||||
rdsServer.Status = ES.Services.RDS.GetRdsServerStatus(null, rdsServer.FqdName);
|
||||
rdsServer.SslAvailable = ES.Services.RDS.GetRdsCertificateByItemId(rdsServer.ItemId) != null;
|
||||
}
|
||||
|
||||
return rdsServers.Servers;
|
||||
|
|
|
@ -205,7 +205,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<asp:CheckBox ID="cbAuthentication" Text="Allow connections only from computers runnig Remote Desktop with Network Level Authentication" runat="server"/>
|
||||
<asp:CheckBox ID="cbAuthentication" Text="Allow connections only from computers running Remote Desktop with Network Level Authentication" runat="server"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lnkInstallCertificate" runat="server" Text="Certificate" Visible='<%# Convert.ToBoolean(Eval("SslAvailable")) && Eval("ItemId") != null && Eval("Status") != null && Eval("Status").ToString().StartsWith("Online") %>'
|
||||
<asp:LinkButton ID="lnkInstallCertificate" runat="server" Text="Certificate" Visible='<%# Convert.ToBoolean(Eval("SslAvailable")) && Eval("Status") != null && Eval("Status").ToString().StartsWith("Online") %>'
|
||||
CommandName="InstallCertificate" CommandArgument='<%# Eval("Id") %>' ToolTip="Repair Certificate"
|
||||
OnClientClick="if(confirm('Are you sure you want to install certificate?')) ShowProgressDialog('Installing certificate...'); else return false;"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
|
@ -100,7 +100,7 @@
|
|||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lnkRemove" runat="server" Text="Remove" Visible='<%# Eval("ItemId") == null %>'
|
||||
CommandName="DeleteItem" CommandArgument='<%# Eval("Id") %>'
|
||||
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to delete selected rds server?')"></asp:LinkButton>
|
||||
meta:resourcekey="cmdDelete" OnClientClick="if(confirm('Are you sure you want to delete selected rds server??')) ShowProgressDialog('Removeing RDS Server...'); else return false;"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
|
|
|
@ -88,6 +88,8 @@ namespace WebsitePanel.Portal
|
|||
result = ES.Services.RDS.RemoveRdsServer(rdsServerId);
|
||||
}
|
||||
|
||||
((ModalPopupExtender)asyncTasks.FindControl("ModalPopupProperties")).Hide();
|
||||
|
||||
if (!result.IsSuccess)
|
||||
{
|
||||
messageBox.ShowMessage(result, "REMOTE_DESKTOP_SERVICES_REMOVE_RDSSERVER", "RDS");
|
||||
|
@ -136,7 +138,7 @@ namespace WebsitePanel.Portal
|
|||
{
|
||||
ViewInfoModal.Show();
|
||||
var rdsServer = ES.Services.RDS.GetRdsServer(Convert.ToInt32(serverId));
|
||||
var serverInfo = ES.Services.RDS.GetRdsServerInfo(rdsServer.ItemId.Value, rdsServer.FqdName);
|
||||
var serverInfo = ES.Services.RDS.GetRdsServerInfo(null, rdsServer.FqdName);
|
||||
litProcessor.Text = string.Format("{0}x{1} MHz", serverInfo.NumberOfCores, serverInfo.MaxClockSpeed);
|
||||
litLoadPercentage.Text = string.Format("{0}%", serverInfo.LoadPercentage);
|
||||
litMemoryAllocated.Text = string.Format("{0} MB", serverInfo.MemoryAllocatedMb);
|
||||
|
@ -149,14 +151,14 @@ namespace WebsitePanel.Portal
|
|||
private void Restart(string serverId)
|
||||
{
|
||||
var rdsServer = ES.Services.RDS.GetRdsServer(Convert.ToInt32(serverId));
|
||||
ES.Services.RDS.RestartRdsServer(rdsServer.ItemId.Value, rdsServer.FqdName);
|
||||
ES.Services.RDS.RestartRdsServer(null, rdsServer.FqdName);
|
||||
Response.Redirect(Request.Url.ToString(), true);
|
||||
}
|
||||
|
||||
private void ShutDown(string serverId)
|
||||
{
|
||||
var rdsServer = ES.Services.RDS.GetRdsServer(Convert.ToInt32(serverId));
|
||||
ES.Services.RDS.ShutDownRdsServer(rdsServer.ItemId.Value, rdsServer.FqdName);
|
||||
ES.Services.RDS.ShutDownRdsServer(null, rdsServer.FqdName);
|
||||
Response.Redirect(Request.Url.ToString(), true);
|
||||
}
|
||||
|
||||
|
|
|
@ -70,6 +70,18 @@
|
|||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
||||
|
||||
<wsp:CollapsiblePanel ID="RdsSettings" runat="server" TargetControlID="PanelRdsSettings" meta:resourcekey="RdsSettings" Text="RDS" />
|
||||
<asp:Panel ID="PanelRdsSettings" runat="server" Height="0" style="overflow:hidden;">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="SubHead" style="width:200px;"><asp:Localize ID="lblRdsController" runat="server" meta:resourcekey="lblRdsController" />
|
||||
<td style="width:200px;">
|
||||
<asp:DropDownList ID="ddlRdsController" runat="server" CssClass="HugeTextBox200"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
||||
</div>
|
||||
<div class="FormFooter">
|
||||
<asp:Button runat="server" ID="btnSaveSettings" meta:resourcekey="btnSaveSettings"
|
||||
|
|
|
@ -51,6 +51,7 @@ namespace WebsitePanel.Portal
|
|||
public const string SMTP_ENABLE_SSL = "SmtpEnableSsl";
|
||||
public const string BACKUPS_PATH = "BackupsPath";
|
||||
public const string FILE_MANAGER_EDITABLE_EXTENSIONS = "EditableExtensions";
|
||||
public const string RDS_MAIN_CONTROLLER = "RdsMainController";
|
||||
|
||||
/*
|
||||
public const string FEED_ENABLE_MICROSOFT = "FeedEnableMicrosoft";
|
||||
|
@ -136,6 +137,25 @@ namespace WebsitePanel.Portal
|
|||
// Original WebsitePanel Extensions
|
||||
txtFileManagerEditableExtensions.Text = FileManager.ALLOWED_EDIT_EXTENSIONS.Replace(",", System.Environment.NewLine);
|
||||
}
|
||||
|
||||
// RDS
|
||||
var services = ES.Services.RDS.GetRdsServices();
|
||||
|
||||
foreach(var service in services)
|
||||
{
|
||||
ddlRdsController.Items.Add(new ListItem(service.ServiceName, service.ServiceId.ToString()));
|
||||
}
|
||||
|
||||
settings = ES.Services.System.GetSystemSettings(WSP.SystemSettings.RDS_SETTINGS);
|
||||
|
||||
if (settings != null && !string.IsNullOrEmpty(settings[RDS_MAIN_CONTROLLER]))
|
||||
{
|
||||
ddlRdsController.SelectedValue = settings[RDS_MAIN_CONTROLLER];
|
||||
}
|
||||
else if (ddlRdsController.Items.Count > 0)
|
||||
{
|
||||
ddlRdsController.SelectedValue = ddlRdsController.Items[0].Value;
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveSettings()
|
||||
|
@ -207,6 +227,16 @@ namespace WebsitePanel.Portal
|
|||
result = ES.Services.System.SetSystemSettings(
|
||||
WSP.SystemSettings.FILEMANAGER_SETTINGS, settings);
|
||||
|
||||
if (result < 0)
|
||||
{
|
||||
ShowResultMessage(result);
|
||||
return;
|
||||
}
|
||||
|
||||
settings = new WSP.SystemSettings();
|
||||
settings[RDS_MAIN_CONTROLLER] = ddlRdsController.SelectedValue;
|
||||
result = ES.Services.System.SetSystemSettings(WSP.SystemSettings.RDS_SETTINGS, settings);
|
||||
|
||||
if (result < 0)
|
||||
{
|
||||
ShowResultMessage(result);
|
||||
|
|
|
@ -1,31 +1,3 @@
|
|||
// Copyright (c) 2015, 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.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the Outercurve Foundation nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from this
|
||||
// software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
|
@ -220,6 +192,42 @@ namespace WebsitePanel.Portal {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal litFileManagerEditableExtensions;
|
||||
|
||||
/// <summary>
|
||||
/// RdsSettings control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.CollapsiblePanel RdsSettings;
|
||||
|
||||
/// <summary>
|
||||
/// PanelRdsSettings control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel PanelRdsSettings;
|
||||
|
||||
/// <summary>
|
||||
/// lblRdsController control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Localize lblRdsController;
|
||||
|
||||
/// <summary>
|
||||
/// ddlRdsController control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlRdsController;
|
||||
|
||||
/// <summary>
|
||||
/// btnSaveSettings control.
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue