From 7aa68cd775aab98a6d073ee7a755bf5e3dcfda00 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 27 Jan 2015 04:17:06 -0500 Subject: [PATCH 1/6] Added tag build-2.1.0.545 for changeset 08256acbb1c2 From b13ad8cc4120cf7e523bcaef14bbfb76b1df385b Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Tue, 27 Jan 2015 03:14:36 -0800 Subject: [PATCH 2/6] UpdateDB.sql Quotas fix --- WebsitePanel/Database/update_db.sql | 183 +++++++++++++++++++++++++++- 1 file changed, 180 insertions(+), 3 deletions(-) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index f72a0a4b..6c4e9176 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -5477,6 +5477,30 @@ GO UPDATE [dbo].[RDSCollections] SET DisplayName = [Name] WHERE DisplayName IS NULL +IF NOT EXISTS(SELECT * FROM SYS.TABLES WHERE name = 'RDSCollectionSettings') +CREATE TABLE [dbo].[RDSCollectionSettings]( + [ID] [int] IDENTITY(1,1) NOT NULL, + [RDSCollectionId] [int] NOT NULL, + [DisconnectedSessionLimitMin] [int] NULL, + [ActiveSessionLimitMin] [int] NULL, + [IdleSessionLimitMin] [int] NULL, + [BrokenConnectionAction] [nvarchar](20) NULL, + [AutomaticReconnectionEnabled] [bit] NULL, + [TemporaryFoldersDeletedOnExit] [bit] NULL, + [TemporaryFoldersPerSession] [bit] NULL, + [ClientDeviceRedirectionOptions] [nvarchar](250) NULL, + [ClientPrinterRedirected] [bit] NULL, + [ClientPrinterAsDefault] [bit] NULL, + [RDEasyPrintDriverEnabled] [bit] NULL, + [MaxRedirectedMonitors] [int] NULL, + CONSTRAINT [PK_RDSCollectionSettings] PRIMARY KEY CLUSTERED +( + [ID] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + ALTER TABLE [dbo].[RDSCollectionUsers] DROP CONSTRAINT [FK_RDSCollectionUsers_RDSCollectionId] @@ -5506,6 +5530,15 @@ ALTER TABLE [dbo].[RDSServers] WITH CHECK ADD CONSTRAINT [FK_RDSServers_RDSCol REFERENCES [dbo].[RDSCollections] ([ID]) GO +IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE CONSTRAINT_NAME ='FK_RDSCollectionSettings_RDSCollections') +ALTER TABLE [dbo].[RDSCollectionSettings] WITH CHECK ADD CONSTRAINT [FK_RDSCollectionSettings_RDSCollections] FOREIGN KEY([RDSCollectionId]) +REFERENCES [dbo].[RDSCollections] ([ID]) +ON DELETE CASCADE +GO + +ALTER TABLE [dbo].[RDSCollectionSettings] CHECK CONSTRAINT [FK_RDSCollectionSettings_RDSCollections] +GO + /*Remote Desktop Services Procedures*/ IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddRDSServer') @@ -6039,6 +6072,150 @@ SELECT RETURN GO +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetRDSCollectionSettingsByCollectionId') +DROP PROCEDURE GetRDSCollectionSettingsByCollectionId +GO +CREATE PROCEDURE [dbo].[GetRDSCollectionSettingsByCollectionId] +( + @RDSCollectionID INT +) +AS + +SELECT TOP 1 + Id, + RDSCollectionId, + DisconnectedSessionLimitMin, + ActiveSessionLimitMin, + IdleSessionLimitMin, + BrokenConnectionAction, + AutomaticReconnectionEnabled, + TemporaryFoldersDeletedOnExit, + TemporaryFoldersPerSession, + ClientDeviceRedirectionOptions, + ClientPrinterRedirected, + ClientPrinterAsDefault, + RDEasyPrintDriverEnabled, + MaxRedirectedMonitors + FROM RDSCollectionSettings + WHERE RDSCollectionID = @RDSCollectionID +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddRDSCollectionSettings') +DROP PROCEDURE AddRDSCollectionSettings +GO +CREATE PROCEDURE [dbo].[AddRDSCollectionSettings] +( + @RDSCollectionSettingsID INT OUTPUT, + @RDSCollectionId INT, + @DisconnectedSessionLimitMin INT, + @ActiveSessionLimitMin INT, + @IdleSessionLimitMin INT, + @BrokenConnectionAction NVARCHAR(20), + @AutomaticReconnectionEnabled BIT, + @TemporaryFoldersDeletedOnExit BIT, + @TemporaryFoldersPerSession BIT, + @ClientDeviceRedirectionOptions NVARCHAR(250), + @ClientPrinterRedirected BIT, + @ClientPrinterAsDefault BIT, + @RDEasyPrintDriverEnabled BIT, + @MaxRedirectedMonitors INT +) +AS + +INSERT INTO RDSCollectionSettings +( + RDSCollectionId, + DisconnectedSessionLimitMin, + ActiveSessionLimitMin, + IdleSessionLimitMin, + BrokenConnectionAction, + AutomaticReconnectionEnabled, + TemporaryFoldersDeletedOnExit, + TemporaryFoldersPerSession, + ClientDeviceRedirectionOptions, + ClientPrinterRedirected, + ClientPrinterAsDefault, + RDEasyPrintDriverEnabled, + MaxRedirectedMonitors +) +VALUES +( + @RDSCollectionId, + @DisconnectedSessionLimitMin, + @ActiveSessionLimitMin, + @IdleSessionLimitMin, + @BrokenConnectionAction, + @AutomaticReconnectionEnabled, + @TemporaryFoldersDeletedOnExit, + @TemporaryFoldersPerSession, + @ClientDeviceRedirectionOptions, + @ClientPrinterRedirected, + @ClientPrinterAsDefault, + @RDEasyPrintDriverEnabled, + @MaxRedirectedMonitors +) + +SET @RDSCollectionSettingsID = SCOPE_IDENTITY() + +RETURN +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'UpdateRDSCollectionSettings') +DROP PROCEDURE UpdateRDSCollectionSettings +GO +CREATE PROCEDURE [dbo].[UpdateRDSCollectionSettings] +( + @ID INT, + @RDSCollectionId INT, + @DisconnectedSessionLimitMin INT, + @ActiveSessionLimitMin INT, + @IdleSessionLimitMin INT, + @BrokenConnectionAction NVARCHAR(20), + @AutomaticReconnectionEnabled BIT, + @TemporaryFoldersDeletedOnExit BIT, + @TemporaryFoldersPerSession BIT, + @ClientDeviceRedirectionOptions NVARCHAR(250), + @ClientPrinterRedirected BIT, + @ClientPrinterAsDefault BIT, + @RDEasyPrintDriverEnabled BIT, + @MaxRedirectedMonitors INT +) +AS + +UPDATE UpdateRDSCollectionSettings +SET + RDSCollectionId = @RDSCollectionId, + DisconnectedSessionLimitMin = @DisconnectedSessionLimitMin, + ActiveSessionLimitMin = @ActiveSessionLimitMin, + IdleSessionLimitMin = @IdleSessionLimitMin, + BrokenConnectionAction = @BrokenConnectionAction, + AutomaticReconnectionEnabled = @AutomaticReconnectionEnabled, + TemporaryFoldersDeletedOnExit = @TemporaryFoldersDeletedOnExit, + TemporaryFoldersPerSession = @TemporaryFoldersPerSession, + ClientDeviceRedirectionOptions = @ClientDeviceRedirectionOptions, + ClientPrinterRedirected = @ClientPrinterRedirected, + ClientPrinterAsDefault = @ClientPrinterAsDefault, + RDEasyPrintDriverEnabled = @RDEasyPrintDriverEnabled, + MaxRedirectedMonitors = @MaxRedirectedMonitors +WHERE ID = @Id +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'DeleteRDSCollectionSettings') +DROP PROCEDURE DeleteRDSCollectionSettings +GO +CREATE PROCEDURE [dbo].[DeleteRDSCollectionSettings] +( + @Id int +) +AS + +DELETE FROM DeleteRDSCollectionSettings +WHERE Id = @Id +GO + -- wsp-10269: Changed php extension path in default properties for IIS70 and IIS80 provider update ServiceDefaultProperties set PropertyValue='%PROGRAMFILES(x86)%\PHP\php-cgi.exe' @@ -7751,12 +7928,12 @@ GO --add Deleted Users Quota IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'HostedSolution.DeletedUsers') BEGIN - INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (477, 13, 6, N'HostedSolution.DeletedUsers', N'Deleted Users', 2, 0, NULL, NULL) + INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (495, 13, 6, N'HostedSolution.DeletedUsers', N'Deleted Users', 2, 0, NULL, NULL) END IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'HostedSolution.DeletedUsersBackupStorageSpace') BEGIN - INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (478, 13, 6, N'HostedSolution.DeletedUsersBackupStorageSpace', N'Deleted Users Backup Storage Space, Mb', 2, 0, NULL, NULL) + INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (496, 13, 6, N'HostedSolution.DeletedUsersBackupStorageSpace', N'Deleted Users Backup Storage Space, Mb', 2, 0, NULL, NULL) END GO @@ -8003,7 +8180,7 @@ AS INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID WHERE pt.ParentPackageID = @PackageID AND ea.AccountType IN (8,9)) - ELSE IF @QuotaID = 477 -- HostedSolution.DeletedUsers + ELSE IF @QuotaID = 495 -- HostedSolution.DeletedUsers SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID From 636b3e22cae20159d3455bdbd12542fc50608d33 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Tue, 27 Jan 2015 04:48:25 -0800 Subject: [PATCH 3/6] RDS Collection settings added --- WebsitePanel/Database/update_db.sql | 2 +- .../RemoteDesktopServicesProxy.cs | 147 +++++++ .../Data/DataProvider.cs | 91 ++++- .../RemoteDesktopServicesController.cs | 100 ++++- .../esRemoteDesktopServices.asmx.cs | 12 + .../IRemoteDesktopServices.cs | 1 + .../RemoteDesktopServices/RdsCollection.cs | 2 + .../RdsCollectionSettings.cs | 26 ++ .../RemoteDesktopServices/RdsEnums.cs | 38 ++ .../WebsitePanel.Providers.Base.csproj | 2 + .../Windows2012.cs | 58 +++ .../RemoteDesktopServicesProxy.cs | 77 ++-- .../RemoteDesktopServices.asmx.cs | 16 + .../ESModule_ControlsHierarchy.config | 1 + .../App_Data/WebsitePanel_Modules.config | 3 +- .../WebsitePanel_SharedResources.ascx.resx | 3 + .../App_Themes/Default/Styles/Skin.css | 3 +- .../RDSEditCollectionSettings.ascx.resx | 159 ++++++++ .../RDS/RDSEditCollectionApps.ascx.cs | 3 +- .../RDS/RDSEditCollectionSettings.ascx | 186 +++++++++ .../RDS/RDSEditCollectionSettings.ascx.cs | 228 +++++++++++ ...RDSEditCollectionSettings.ascx.designer.cs | 366 ++++++++++++++++++ .../RDS/UserControls/RDSCollectionTabs.ascx | 4 +- .../UserControls/RDSCollectionTabs.ascx.cs | 3 +- .../RDS/UserControls/RDSSessionLimit.ascx | 22 ++ .../RDS/UserControls/RDSSessionLimit.ascx.cs | 29 ++ .../RDSSessionLimit.ascx.designer.cs | 24 ++ .../WebsitePanel.Portal.Modules.csproj | 65 ++-- 28 files changed, 1610 insertions(+), 61 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollectionSettings.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsEnums.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSEditCollectionSettings.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionSettings.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionSettings.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionSettings.ascx.designer.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSSessionLimit.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSSessionLimit.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSSessionLimit.ascx.designer.cs diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 6c4e9176..0347f00b 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -6184,7 +6184,7 @@ CREATE PROCEDURE [dbo].[UpdateRDSCollectionSettings] ) AS -UPDATE UpdateRDSCollectionSettings +UPDATE RDSCollectionSettings SET RDSCollectionId = @RDSCollectionId, DisconnectedSessionLimitMin = @DisconnectedSessionLimitMin, diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs index f53a5bee..5b87a4eb 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs @@ -32,12 +32,16 @@ namespace WebsitePanel.EnterpriseServer { private System.Threading.SendOrPostCallback GetRdsCollectionOperationCompleted; + private System.Threading.SendOrPostCallback GetRdsCollectionSettingsOperationCompleted; + private System.Threading.SendOrPostCallback GetOrganizationRdsCollectionsOperationCompleted; private System.Threading.SendOrPostCallback AddRdsCollectionOperationCompleted; private System.Threading.SendOrPostCallback EditRdsCollectionOperationCompleted; + private System.Threading.SendOrPostCallback EditRdsCollectionSettingsOperationCompleted; + private System.Threading.SendOrPostCallback GetRdsCollectionsPagedOperationCompleted; private System.Threading.SendOrPostCallback RemoveRdsCollectionOperationCompleted; @@ -104,6 +108,9 @@ namespace WebsitePanel.EnterpriseServer { /// public event GetRdsCollectionCompletedEventHandler GetRdsCollectionCompleted; + /// + public event GetRdsCollectionSettingsCompletedEventHandler GetRdsCollectionSettingsCompleted; + /// public event GetOrganizationRdsCollectionsCompletedEventHandler GetOrganizationRdsCollectionsCompleted; @@ -113,6 +120,9 @@ namespace WebsitePanel.EnterpriseServer { /// public event EditRdsCollectionCompletedEventHandler EditRdsCollectionCompleted; + /// + public event EditRdsCollectionSettingsCompletedEventHandler EditRdsCollectionSettingsCompleted; + /// public event GetRdsCollectionsPagedCompletedEventHandler GetRdsCollectionsPagedCompleted; @@ -241,6 +251,47 @@ namespace WebsitePanel.EnterpriseServer { } } + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCollectionSettings", 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 RdsCollectionSettings GetRdsCollectionSettings(int collectionId) { + object[] results = this.Invoke("GetRdsCollectionSettings", new object[] { + collectionId}); + return ((RdsCollectionSettings)(results[0])); + } + + /// + public System.IAsyncResult BeginGetRdsCollectionSettings(int collectionId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetRdsCollectionSettings", new object[] { + collectionId}, callback, asyncState); + } + + /// + public RdsCollectionSettings EndGetRdsCollectionSettings(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((RdsCollectionSettings)(results[0])); + } + + /// + public void GetRdsCollectionSettingsAsync(int collectionId) { + this.GetRdsCollectionSettingsAsync(collectionId, null); + } + + /// + public void GetRdsCollectionSettingsAsync(int collectionId, object userState) { + if ((this.GetRdsCollectionSettingsOperationCompleted == null)) { + this.GetRdsCollectionSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsCollectionSettingsOperationCompleted); + } + this.InvokeAsync("GetRdsCollectionSettings", new object[] { + collectionId}, this.GetRdsCollectionSettingsOperationCompleted, userState); + } + + private void OnGetRdsCollectionSettingsOperationCompleted(object arg) { + if ((this.GetRdsCollectionSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetRdsCollectionSettingsCompleted(this, new GetRdsCollectionSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetOrganizationRdsCollections", 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[] GetOrganizationRdsCollections(int itemId) { @@ -370,6 +421,50 @@ namespace WebsitePanel.EnterpriseServer { } } + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/EditRdsCollectionSettings", 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 EditRdsCollectionSettings(int itemId, RdsCollection collection) { + object[] results = this.Invoke("EditRdsCollectionSettings", new object[] { + itemId, + collection}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginEditRdsCollectionSettings(int itemId, RdsCollection collection, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("EditRdsCollectionSettings", new object[] { + itemId, + collection}, callback, asyncState); + } + + /// + public ResultObject EndEditRdsCollectionSettings(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void EditRdsCollectionSettingsAsync(int itemId, RdsCollection collection) { + this.EditRdsCollectionSettingsAsync(itemId, collection, null); + } + + /// + public void EditRdsCollectionSettingsAsync(int itemId, RdsCollection collection, object userState) { + if ((this.EditRdsCollectionSettingsOperationCompleted == null)) { + this.EditRdsCollectionSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEditRdsCollectionSettingsOperationCompleted); + } + this.InvokeAsync("EditRdsCollectionSettings", new object[] { + itemId, + collection}, this.EditRdsCollectionSettingsOperationCompleted, userState); + } + + private void OnEditRdsCollectionSettingsOperationCompleted(object arg) { + if ((this.EditRdsCollectionSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.EditRdsCollectionSettingsCompleted(this, new EditRdsCollectionSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCollectionsPaged", 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 RdsCollectionPaged GetRdsCollectionsPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { @@ -1737,6 +1832,32 @@ namespace WebsitePanel.EnterpriseServer { } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetRdsCollectionSettingsCompletedEventHandler(object sender, GetRdsCollectionSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetRdsCollectionSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetRdsCollectionSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public RdsCollectionSettings Result { + get { + this.RaiseExceptionIfNecessary(); + return ((RdsCollectionSettings)(this.results[0])); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetOrganizationRdsCollectionsCompletedEventHandler(object sender, GetOrganizationRdsCollectionsCompletedEventArgs e); @@ -1815,6 +1936,32 @@ namespace WebsitePanel.EnterpriseServer { } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void EditRdsCollectionSettingsCompletedEventHandler(object sender, EditRdsCollectionSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class EditRdsCollectionSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal EditRdsCollectionSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetRdsCollectionsPagedCompletedEventHandler(object sender, GetRdsCollectionsPagedCompletedEventArgs e); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs index 137defe7..86a2de49 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs @@ -4556,6 +4556,95 @@ namespace WebsitePanel.EnterpriseServer #region RDS + public static IDataReader GetRdsCollectionSettingsByCollectionId(int collectionId) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetRDSCollectionSettingsByCollectionId", + new SqlParameter("@RDSCollectionID", collectionId) + ); + } + + public static int AddRdsCollectionSettings(RdsCollectionSettings settings) + { + return AddRdsCollectionSettings(settings.RdsCollectionId, settings.DisconnectedSessionLimitMin, settings.ActiveSessionLimitMin, settings.IdleSessionLimitMin, settings.BrokenConnectionAction, + settings.AutomaticReconnectionEnabled, settings.TemporaryFoldersDeletedOnExit, settings.TemporaryFoldersPerSession, settings.ClientDeviceRedirectionOptions, settings.ClientPrinterRedirected, + settings.ClientPrinterAsDefault, settings.RDEasyPrintDriverEnabled, settings.MaxRedirectedMonitors); + } + + private static int AddRdsCollectionSettings(int rdsCollectionId, int disconnectedSessionLimitMin, int activeSessionLimitMin, int idleSessionLimitMin, string brokenConnectionAction, + bool automaticReconnectionEnabled, bool temporaryFoldersDeletedOnExit, bool temporaryFoldersPerSession, string clientDeviceRedirectionOptions, bool ClientPrinterRedirected, + bool clientPrinterAsDefault, bool rdEasyPrintDriverEnabled, int maxRedirectedMonitors) + { + SqlParameter rdsCollectionSettingsId = new SqlParameter("@RDSCollectionSettingsID", SqlDbType.Int); + rdsCollectionSettingsId.Direction = ParameterDirection.Output; + + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "AddRDSCollectionSettings", + rdsCollectionSettingsId, + new SqlParameter("@RdsCollectionId", rdsCollectionId), + new SqlParameter("@DisconnectedSessionLimitMin", disconnectedSessionLimitMin), + new SqlParameter("@ActiveSessionLimitMin", activeSessionLimitMin), + new SqlParameter("@IdleSessionLimitMin", idleSessionLimitMin), + new SqlParameter("@BrokenConnectionAction", brokenConnectionAction), + new SqlParameter("@AutomaticReconnectionEnabled", automaticReconnectionEnabled), + new SqlParameter("@TemporaryFoldersDeletedOnExit", temporaryFoldersDeletedOnExit), + new SqlParameter("@TemporaryFoldersPerSession", temporaryFoldersPerSession), + new SqlParameter("@ClientDeviceRedirectionOptions", clientDeviceRedirectionOptions), + new SqlParameter("@ClientPrinterRedirected", ClientPrinterRedirected), + new SqlParameter("@ClientPrinterAsDefault", clientPrinterAsDefault), + new SqlParameter("@RDEasyPrintDriverEnabled", rdEasyPrintDriverEnabled), + new SqlParameter("@MaxRedirectedMonitors", maxRedirectedMonitors) + ); + + return Convert.ToInt32(rdsCollectionSettingsId.Value); + } + + public static void UpdateRDSCollectionSettings(RdsCollectionSettings settings) + { + UpdateRDSCollectionSettings(settings.Id, settings.RdsCollectionId, settings.DisconnectedSessionLimitMin, settings.ActiveSessionLimitMin, settings.IdleSessionLimitMin, settings.BrokenConnectionAction, + settings.AutomaticReconnectionEnabled, settings.TemporaryFoldersDeletedOnExit, settings.TemporaryFoldersPerSession, settings.ClientDeviceRedirectionOptions, settings.ClientPrinterRedirected, + settings.ClientPrinterAsDefault, settings.RDEasyPrintDriverEnabled, settings.MaxRedirectedMonitors); + } + + public static void UpdateRDSCollectionSettings(int id, int rdsCollectionId, int disconnectedSessionLimitMin, int activeSessionLimitMin, int idleSessionLimitMin, string brokenConnectionAction, + bool automaticReconnectionEnabled, bool temporaryFoldersDeletedOnExit, bool temporaryFoldersPerSession, string clientDeviceRedirectionOptions, bool ClientPrinterRedirected, + bool clientPrinterAsDefault, bool rdEasyPrintDriverEnabled, int maxRedirectedMonitors) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "UpdateRDSCollectionSettings", + new SqlParameter("@Id", id), + new SqlParameter("@RdsCollectionId", rdsCollectionId), + new SqlParameter("@DisconnectedSessionLimitMin", disconnectedSessionLimitMin), + new SqlParameter("@ActiveSessionLimitMin", activeSessionLimitMin), + new SqlParameter("@IdleSessionLimitMin", idleSessionLimitMin), + new SqlParameter("@BrokenConnectionAction", brokenConnectionAction), + new SqlParameter("@AutomaticReconnectionEnabled", automaticReconnectionEnabled), + new SqlParameter("@TemporaryFoldersDeletedOnExit", temporaryFoldersDeletedOnExit), + new SqlParameter("@TemporaryFoldersPerSession", temporaryFoldersPerSession), + new SqlParameter("@ClientDeviceRedirectionOptions", clientDeviceRedirectionOptions), + new SqlParameter("@ClientPrinterRedirected", ClientPrinterRedirected), + new SqlParameter("@ClientPrinterAsDefault", clientPrinterAsDefault), + new SqlParameter("@RDEasyPrintDriverEnabled", rdEasyPrintDriverEnabled), + new SqlParameter("@MaxRedirectedMonitors", maxRedirectedMonitors) + ); + } + + public static void DeleteRDSCollectionSettings(int id) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "DeleteRDSCollectionSettings", + new SqlParameter("@Id", id) + ); + } + public static IDataReader GetRDSCollectionsByItemId(int itemId) { return SqlHelper.ExecuteReader( @@ -4614,7 +4703,7 @@ namespace WebsitePanel.EnterpriseServer new SqlParameter("@ItemID", itemId), new SqlParameter("@Name", name), new SqlParameter("@Description", description), - new SqlParameter("DisplayName", displayName) + new SqlParameter("@DisplayName", displayName) ); // read identity diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs index c7338859..67ab6ab2 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs @@ -58,6 +58,11 @@ namespace WebsitePanel.EnterpriseServer return GetRdsCollectionInternal(collectionId); } + public static RdsCollectionSettings GetRdsCollectionSettings(int collectionId) + { + return GetRdsCollectionSettingsInternal(collectionId); + } + public static List GetOrganizationRdsCollections(int itemId) { return GetOrganizationRdsCollectionsInternal(itemId); @@ -73,6 +78,11 @@ namespace WebsitePanel.EnterpriseServer return EditRdsCollectionInternal(itemId, collection); } + public static ResultObject EditRdsCollectionSettings(int itemId, RdsCollection collection) + { + return EditRdsCollectionSettingsInternal(itemId, collection); + } + public static RdsCollectionPaged GetRdsCollectionsPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { return GetRdsCollectionsPagedInternal(itemId, filterColumn, filterValue, sortColumn, startRow, maximumRows); @@ -226,13 +236,15 @@ namespace WebsitePanel.EnterpriseServer private static RdsCollection GetRdsCollectionInternal(int collectionId) { var collection = ObjectUtils.FillObjectFromDataReader(DataProvider.GetRDSCollectionById(collectionId)); + var collectionSettings = ObjectUtils.FillObjectFromDataReader(DataProvider.GetRdsCollectionSettingsByCollectionId(collectionId)); + collection.Settings = collectionSettings; var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "ADD_RDS_COLLECTION"); try { // load organization - Organization org = OrganizationController.GetOrganization(4115); + Organization org = OrganizationController.GetOrganization(collection.ItemId); if (org == null) { result.IsSuccess = false; @@ -253,6 +265,13 @@ namespace WebsitePanel.EnterpriseServer return collection; } + private static RdsCollectionSettings GetRdsCollectionSettingsInternal(int collectionId) + { + var collection = ObjectUtils.FillObjectFromDataReader(DataProvider.GetRDSCollectionById(collectionId)); + + return ObjectUtils.FillObjectFromDataReader(DataProvider.GetRdsCollectionSettingsByCollectionId(collectionId)); + } + private static List GetOrganizationRdsCollectionsInternal(int itemId) { var collections = ObjectUtils.CreateListFromDataReader(DataProvider.GetRDSCollectionsByItemId(itemId)); @@ -280,8 +299,37 @@ namespace WebsitePanel.EnterpriseServer var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); collection.Name = GetFormattedCollectionName(collection.DisplayName, org.OrganizationId); + + collection.Settings = new RdsCollectionSettings + { + DisconnectedSessionLimitMin = 0, + ActiveSessionLimitMin = 0, + IdleSessionLimitMin = 0, + BrokenConnectionAction = BrokenConnectionActionValues.Disconnect.ToString(), + AutomaticReconnectionEnabled = true, + TemporaryFoldersDeletedOnExit = true, + TemporaryFoldersPerSession = true, + ClientDeviceRedirectionOptions = string.Join(",", new List + { + ClientDeviceRedirectionOptionValues.AudioVideoPlayBack.ToString(), + ClientDeviceRedirectionOptionValues.AudioRecording.ToString(), + ClientDeviceRedirectionOptionValues.SmartCard.ToString(), + ClientDeviceRedirectionOptionValues.Clipboard.ToString(), + ClientDeviceRedirectionOptionValues.Drive.ToString(), + ClientDeviceRedirectionOptionValues.PlugAndPlayDevice.ToString() + }.ToArray()), + ClientPrinterRedirected = true, + ClientPrinterAsDefault = true, + RDEasyPrintDriverEnabled = true, + MaxRedirectedMonitors = 16 + }; + rds.CreateCollection(org.OrganizationId, collection); - collection.Id = DataProvider.AddRDSCollection(itemId, collection.Name, collection.Description, collection.DisplayName); + collection.Id = DataProvider.AddRDSCollection(itemId, collection.Name, collection.Description, collection.DisplayName); + + collection.Settings.RdsCollectionId = collection.Id; + int settingsId = DataProvider.AddRdsCollectionSettings(collection.Settings); + collection.Settings.Id = settingsId; foreach (var server in collection.Servers) { @@ -359,6 +407,54 @@ namespace WebsitePanel.EnterpriseServer return result; } + private static ResultObject EditRdsCollectionSettingsInternal(int itemId, RdsCollection collection) + { + var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "EDIT_RDS_COLLECTION_SETTINGS"); + + try + { + Organization org = OrganizationController.GetOrganization(itemId); + + if (org == null) + { + result.IsSuccess = false; + result.AddError("", new NullReferenceException("Organization not found")); + return result; + } + + var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); + rds.EditRdsCollectionSettings(collection); + var collectionSettings = ObjectUtils.FillObjectFromDataReader(DataProvider.GetRdsCollectionSettingsByCollectionId(collection.Id)); + + if (collectionSettings == null) + { + DataProvider.AddRdsCollectionSettings(collection.Settings); + } + else + { + DataProvider.UpdateRDSCollectionSettings(collection.Settings); + } + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_COLLECTION", ex); + throw TaskManager.WriteError(ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + private static RdsCollectionPaged GetRdsCollectionsPagedInternal(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { DataSet ds = DataProvider.GetRDSCollectionsPaged(itemId, filterColumn, filterValue, sortColumn, startRow, maximumRows); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs index 4061033d..3aed999a 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs @@ -58,6 +58,12 @@ namespace WebsitePanel.EnterpriseServer return RemoteDesktopServicesController.GetRdsCollection(collectionId); } + [WebMethod] + public RdsCollectionSettings GetRdsCollectionSettings(int collectionId) + { + return RemoteDesktopServicesController.GetRdsCollectionSettings(collectionId); + } + [WebMethod] public List GetOrganizationRdsCollections(int itemId) { @@ -76,6 +82,12 @@ namespace WebsitePanel.EnterpriseServer return RemoteDesktopServicesController.EditRdsCollection(itemId, collection); } + [WebMethod] + public ResultObject EditRdsCollectionSettings(int itemId, RdsCollection collection) + { + return RemoteDesktopServicesController.EditRdsCollectionSettings(itemId, collection); + } + [WebMethod] public RdsCollectionPaged GetRdsCollectionsPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs index 455db52d..343baa96 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs @@ -65,5 +65,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices bool SetApplicationUsers(string collectionName, RemoteApplication remoteApp, string[] users); bool CheckRDSServerAvaliable(string hostname); List GetServersExistingInCollections(); + void EditRdsCollectionSettings(RdsCollection collection); } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollection.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollection.cs index 9814a216..0b9727aa 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollection.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollection.cs @@ -37,6 +37,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices public RdsCollection() { Servers = new List(); + Settings = new RdsCollectionSettings(); } public int Id { get; set; } @@ -45,5 +46,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices public string Description { get; set; } public string DisplayName { get; set; } public List Servers { get; set; } + public RdsCollectionSettings Settings { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollectionSettings.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollectionSettings.cs new file mode 100644 index 00000000..5827ecc6 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollectionSettings.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.RemoteDesktopServices +{ + [Serializable] + public class RdsCollectionSettings + { + public int Id { get; set; } + public int RdsCollectionId { get; set; } + public int DisconnectedSessionLimitMin { get; set; } + public int ActiveSessionLimitMin { get; set; } + public int IdleSessionLimitMin { get; set; } + public string BrokenConnectionAction { get; set; } + public bool AutomaticReconnectionEnabled { get; set; } + public bool TemporaryFoldersDeletedOnExit { get; set; } + public bool TemporaryFoldersPerSession { get; set; } + public string ClientDeviceRedirectionOptions { get; set; } + public bool ClientPrinterRedirected { get; set; } + public bool ClientPrinterAsDefault { get; set; } + public bool RDEasyPrintDriverEnabled { get; set; } + public int MaxRedirectedMonitors { get; set; } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsEnums.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsEnums.cs new file mode 100644 index 00000000..ded659f3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsEnums.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.RemoteDesktopServices +{ + public enum BrokenConnectionActionValues + { + Disconnect, + LogOff + } + + public enum ClientDeviceRedirectionOptionValues + { + AudioVideoPlayBack, + AudioRecording, + SmartCard, + PlugAndPlayDevice, + Drive, + Clipboard + } + + public enum SecurityLayerValues + { + RDP, + Negotiate, + SSL + } + + public enum EncryptionLevel + { + Low, + ClientCompatible, + High, + FipsCompliant + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index 99707c63..e3d9ff2b 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -131,6 +131,8 @@ + + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index 0a71b867..05a2dc37 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -35,6 +35,7 @@ using System.Net.NetworkInformation; using System.Net.Sockets; using System.Runtime.Remoting; using System.Text; +using System.Reflection; using Microsoft.Win32; using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Server.Utils; @@ -258,6 +259,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices throw new Exception("Collection not created"); } + EditRdsCollectionSettingsInternal(collection, runSpace); var orgPath = GetOrganizationPath(organizationId); if (!ActiveDirectoryUtils.AdObjectExists(GetComputerGroupPath(organizationId, collection.Name))) @@ -310,6 +312,30 @@ namespace WebsitePanel.Providers.RemoteDesktopServices return result; } + public void EditRdsCollectionSettings(RdsCollection collection) + { + Runspace runSpace = null; + + try + { + runSpace = OpenRunspace(); + + if (collection.Settings != null) + { + var errors = EditRdsCollectionSettingsInternal(collection, runSpace); + + if (errors.Count > 0) + { + throw new Exception(string.Format("Settings not setted:\r\n{0}", string.Join("r\\n\\", errors.ToArray()))); + } + } + } + finally + { + CloseRunspace(runSpace); + } + } + public List GetServersExistingInCollections() { Runspace runSpace = null; @@ -1618,6 +1644,38 @@ namespace WebsitePanel.Providers.RemoteDesktopServices return existingHosts; } + internal List EditRdsCollectionSettingsInternal(RdsCollection collection, Runspace runspace) + { + object[] errors; + Command cmd = new Command("Set-RDSessionCollectionConfiguration"); + cmd.Parameters.Add("CollectionName", collection.Name); + cmd.Parameters.Add("ConnectionBroker", ConnectionBroker); + + var properties = collection.Settings.GetType().GetProperties(); + + foreach(var prop in properties) + { + if (prop.Name.ToLower() != "id" && prop.Name.ToLower() != "rdscollectionid") + { + var value = prop.GetValue(collection.Settings, null); + + if (value != null) + { + cmd.Parameters.Add(prop.Name, value); + } + } + } + + ExecuteShellCommand(runspace, cmd, false, out errors); + + if (errors != null) + { + return errors.Select(e => e.ToString()).ToList(); + } + + return new List(); + } + #endregion } } diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs index dd085a7e..772de6e9 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs @@ -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. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -59,6 +31,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { private System.Threading.SendOrPostCallback CreateCollectionOperationCompleted; + private System.Threading.SendOrPostCallback EditRdsCollectionSettingsOperationCompleted; + private System.Threading.SendOrPostCallback AddRdsServersToDeploymentOperationCompleted; private System.Threading.SendOrPostCallback GetCollectionOperationCompleted; @@ -109,6 +83,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { /// public event CreateCollectionCompletedEventHandler CreateCollectionCompleted; + /// + public event EditRdsCollectionSettingsCompletedEventHandler EditRdsCollectionSettingsCompleted; + /// public event AddRdsServersToDeploymentCompletedEventHandler AddRdsServersToDeploymentCompleted; @@ -217,6 +194,46 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { } } + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/EditRdsCollectionSettings", 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 EditRdsCollectionSettings(RdsCollection collection) { + this.Invoke("EditRdsCollectionSettings", new object[] { + collection}); + } + + /// + public System.IAsyncResult BeginEditRdsCollectionSettings(RdsCollection collection, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("EditRdsCollectionSettings", new object[] { + collection}, callback, asyncState); + } + + /// + public void EndEditRdsCollectionSettings(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void EditRdsCollectionSettingsAsync(RdsCollection collection) { + this.EditRdsCollectionSettingsAsync(collection, null); + } + + /// + public void EditRdsCollectionSettingsAsync(RdsCollection collection, object userState) { + if ((this.EditRdsCollectionSettingsOperationCompleted == null)) { + this.EditRdsCollectionSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEditRdsCollectionSettingsOperationCompleted); + } + this.InvokeAsync("EditRdsCollectionSettings", new object[] { + collection}, this.EditRdsCollectionSettingsOperationCompleted, userState); + } + + private void OnEditRdsCollectionSettingsOperationCompleted(object arg) { + if ((this.EditRdsCollectionSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.EditRdsCollectionSettingsCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddRdsServersToDeployment", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] @@ -1172,6 +1189,10 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void EditRdsCollectionSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void AddRdsServersToDeploymentCompletedEventHandler(object sender, AddRdsServersToDeploymentCompletedEventArgs e); diff --git a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs index e004f3f6..1dd8b6e6 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs @@ -76,6 +76,22 @@ namespace WebsitePanel.Server } } + [WebMethod, SoapHeader("settings")] + public void EditRdsCollectionSettings(RdsCollection collection) + { + try + { + Log.WriteStart("'{0}' EditRdsCollectionSettings", ProviderSettings.ProviderName); + RDSProvider.EditRdsCollectionSettings(collection); + Log.WriteEnd("'{0}' EditRdsCollectionSettings", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' EditRdsCollectionSettings", ProviderSettings.ProviderName), ex); + throw; + } + } + [WebMethod, SoapHeader("settings")] public bool AddRdsServersToDeployment(RdsServer[] servers) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config index 435afa1d..29dde726 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config @@ -149,4 +149,5 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config index d2caf292..885e8b53 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config @@ -579,7 +579,8 @@ - + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx index ad62b955..3d851e29 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5638,4 +5638,7 @@ Collection not created + + RDS Collection settings not updated + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Styles/Skin.css b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Styles/Skin.css index d1328e2c..08834b23 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Styles/Skin.css +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Styles/Skin.css @@ -25,9 +25,10 @@ td.Normal > br {display:none;} .NormalTextBox + br + span {font-size:11px; color:#888;} td.Normal .NormalTextBox + span {display:inline-block; padding:0;} .FormSimpleLabel {padding:9px 8px 14px 0; color:#555; vertical-align:top;} -.FormLabel150, .FormLabel200 {padding:9px 8px 14px 0; color:#888; vertical-align:top;} +.FormLabel150, .FormLabel200, .FormLabel260 {padding:9px 8px 14px 0; color:#888; vertical-align:top;} .FormLabel150 {width:150px;} .FormLabel200 {width:200px;} +.FormLabel260 {width:260px;} .Huge {font-family:'Segoe UI Light','Open Sans',Arial!important; font-size:36px; font-weight:300; color:#333; background:none !important; border:none !important; padding:0 !important; letter-spacing:-1px;} .FormBody .Huge {font-size:18px; font-weight:600; letter-spacing:0;} .Right .SubHead {width:80px;} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSEditCollectionSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSEditCollectionSettings.ascx.resx new file mode 100644 index 00000000..98985552 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSEditCollectionSettings.ascx.resx @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Active session limit: + + + When session limit is reached or connection is broken: + + + End a disconneted session: + + + Enable redirection for the following: + + + Idle session limit: + + + Monitors + + + Maximum number of redirected monitors: + + + Printers + + + Set RD Session Host server timeout and reconnection settings for the session collection. + + + Temporary folder settings: + + + Edit RDS Collection Settings + + + Client Settings + + + Session Settings + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionApps.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionApps.ascx.cs index da547518..01addcb1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionApps.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionApps.ascx.cs @@ -37,8 +37,7 @@ using WebsitePanel.Providers.RemoteDesktopServices; namespace WebsitePanel.Portal.RDS { public partial class RDSEditCollectionApps : WebsitePanelModuleBase - { - + { protected void Page_Load(object sender, EventArgs e) { remoreApps.Module = Module; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionSettings.ascx new file mode 100644 index 00000000..a2bd0546 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionSettings.ascx @@ -0,0 +1,186 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RDSEditCollectionSettings.ascx.cs" Inherits="WebsitePanel.Portal.RDS.RDSEditCollectionSettings" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ Register Src="UserControls/RDSCollectionApps.ascx" TagName="CollectionApps" TagPrefix="wsp"%> +<%@ Register Src="UserControls/RDSCollectionTabs.ascx" TagName="CollectionTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/RDSSessionLimit.ascx" TagName="SessionLimit" TagPrefix="wsp" %> +<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %> +<%@ Register Src="../UserControls/ItemButtonPanel.ascx" TagName="ItemButtonPanel" TagPrefix="wsp" %> + + + + +
+
+
+
+
+
+
+ + + - + +
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + +
+ +
+ +
+ +
+
+ + + + + + + + + + +
+ +
+ +
+
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + +
+ +
+ +
+ +
+
+ + + + + + + + +
+ +
+
+
+ +
+ +
+
+
+
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionSettings.ascx.cs new file mode 100644 index 00000000..b64a0df6 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionSettings.ascx.cs @@ -0,0 +1,228 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.RemoteDesktopServices; + +namespace WebsitePanel.Portal.RDS +{ + public partial class RDSEditCollectionSettings : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + WriteScriptBlock(); + + if (!IsPostBack) + { + RdsCollection collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID); + RdsCollectionSettings settings = ES.Services.RDS.GetRdsCollectionSettings(PanelRequest.CollectionID); + collection.Settings = settings; + + if (collection.Settings == null) + { + collection.Settings = new RdsCollectionSettings + { + DisconnectedSessionLimitMin = 0, + ActiveSessionLimitMin = 0, + IdleSessionLimitMin = 0, + BrokenConnectionAction = BrokenConnectionActionValues.Disconnect.ToString(), + AutomaticReconnectionEnabled = true, + TemporaryFoldersDeletedOnExit = true, + TemporaryFoldersPerSession = true, + ClientDeviceRedirectionOptions = string.Join(",", new List + { + ClientDeviceRedirectionOptionValues.AudioVideoPlayBack.ToString(), + ClientDeviceRedirectionOptionValues.AudioRecording.ToString(), + ClientDeviceRedirectionOptionValues.SmartCard.ToString(), + ClientDeviceRedirectionOptionValues.Clipboard.ToString(), + ClientDeviceRedirectionOptionValues.Drive.ToString(), + ClientDeviceRedirectionOptionValues.PlugAndPlayDevice.ToString() + }.ToArray()), + ClientPrinterRedirected = true, + ClientPrinterAsDefault = true, + RDEasyPrintDriverEnabled = true, + MaxRedirectedMonitors = 16 + }; + } + + litCollectionName.Text = collection.DisplayName; + BindControls(collection); + } + } + + private void BindControls(RdsCollection collection) + { + slDisconnectedSessionLimit.SelectedLimit = collection.Settings.DisconnectedSessionLimitMin; + slActiveSessionLimit.SelectedLimit = collection.Settings.ActiveSessionLimitMin; + slIdleSessionLimit.SelectedLimit = collection.Settings.IdleSessionLimitMin; + + if (collection.Settings.BrokenConnectionAction == BrokenConnectionActionValues.Disconnect.ToString()) + { + chDisconnect.Checked = true; + chAutomaticReconnection.Enabled = true; + } + else + { + chEndSession.Checked = true; + chAutomaticReconnection.Enabled = false; + } + + chAutomaticReconnection.Checked = collection.Settings.AutomaticReconnectionEnabled; + chDeleteOnExit.Checked = collection.Settings.TemporaryFoldersDeletedOnExit; + chUseFolders.Checked = collection.Settings.TemporaryFoldersPerSession; + + if (collection.Settings.ClientDeviceRedirectionOptions != null) + { + chAudioVideo.Checked = collection.Settings.ClientDeviceRedirectionOptions.Contains(ClientDeviceRedirectionOptionValues.AudioVideoPlayBack.ToString()); + chAudioRecording.Checked = collection.Settings.ClientDeviceRedirectionOptions.Contains(ClientDeviceRedirectionOptionValues.AudioRecording.ToString()); + chDrives.Checked = collection.Settings.ClientDeviceRedirectionOptions.Contains(ClientDeviceRedirectionOptionValues.Drive.ToString()); + chSmartCards.Checked = collection.Settings.ClientDeviceRedirectionOptions.Contains(ClientDeviceRedirectionOptionValues.SmartCard.ToString()); + chPlugPlay.Checked = collection.Settings.ClientDeviceRedirectionOptions.Contains(ClientDeviceRedirectionOptionValues.PlugAndPlayDevice.ToString()); + chClipboard.Checked = collection.Settings.ClientDeviceRedirectionOptions.Contains(ClientDeviceRedirectionOptionValues.Clipboard.ToString()); + } + + chPrinterRedirection.Checked = collection.Settings.ClientPrinterRedirected; + chDefaultDevice.Checked = collection.Settings.ClientPrinterAsDefault; + chDefaultDevice.Enabled = collection.Settings.ClientPrinterRedirected; + chEasyPrint.Checked = collection.Settings.RDEasyPrintDriverEnabled; + chEasyPrint.Enabled = collection.Settings.ClientPrinterRedirected; + tbMonitorsNumber.Text = collection.Settings.MaxRedirectedMonitors.ToString(); + } + + private bool EditCollectionSettings() + { + try + { + RdsCollection collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID); + collection.Settings.RdsCollectionId = collection.Id; + collection.Settings = GetSettings(collection.Settings); + ES.Services.RDS.EditRdsCollectionSettings(PanelRequest.ItemID, collection); + } + catch (Exception ex) + { + ShowErrorMessage("RDSCOLLECTIONSETTINGS_NOT_UPDATES", ex); + return false; + } + + return true; + } + + private RdsCollectionSettings GetSettings(RdsCollectionSettings settings) + { + settings.DisconnectedSessionLimitMin = slDisconnectedSessionLimit.SelectedLimit; + settings.ActiveSessionLimitMin = slActiveSessionLimit.SelectedLimit; + settings.IdleSessionLimitMin = slIdleSessionLimit.SelectedLimit; + settings.AutomaticReconnectionEnabled = chAutomaticReconnection.Checked; + + if (chDisconnect.Checked) + { + settings.BrokenConnectionAction = BrokenConnectionActionValues.Disconnect.ToString(); + } + else + { + settings.BrokenConnectionAction = BrokenConnectionActionValues.LogOff.ToString(); + } + + settings.TemporaryFoldersDeletedOnExit = chDeleteOnExit.Checked; + settings.TemporaryFoldersPerSession = chUseFolders.Checked; + settings.ClientPrinterRedirected = chPrinterRedirection.Checked; + settings.ClientPrinterAsDefault = chDefaultDevice.Checked; + settings.RDEasyPrintDriverEnabled = chEasyPrint.Checked; + settings.MaxRedirectedMonitors = Convert.ToInt32(tbMonitorsNumber.Text); + + List redirectionOptions = new List(); + + if (chAudioVideo.Checked) + { + redirectionOptions.Add(ClientDeviceRedirectionOptionValues.AudioVideoPlayBack.ToString()); + } + + if (chAudioRecording.Checked) + { + redirectionOptions.Add(ClientDeviceRedirectionOptionValues.AudioRecording.ToString()); + } + + if (chSmartCards.Checked) + { + redirectionOptions.Add(ClientDeviceRedirectionOptionValues.SmartCard.ToString()); + } + + if (chPlugPlay.Checked) + { + redirectionOptions.Add(ClientDeviceRedirectionOptionValues.PlugAndPlayDevice.ToString()); + } + + if (chDrives.Checked) + { + redirectionOptions.Add(ClientDeviceRedirectionOptionValues.Drive.ToString()); + } + + if (chClipboard.Checked) + { + redirectionOptions.Add(ClientDeviceRedirectionOptionValues.Clipboard.ToString()); + } + + settings.ClientDeviceRedirectionOptions = string.Join(",", redirectionOptions.ToArray()); + + return settings; + } + + protected void btnSave_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + { + return; + } + + EditCollectionSettings(); + } + + protected void btnSaveExit_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + { + return; + } + + if (EditCollectionSettings()) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "rds_collections", "SpaceID=" + PanelSecurity.PackageId)); + } + } + + protected override void OnPreRender(EventArgs e) + { + chPrinterRedirection.Attributes["onclick"] = String.Format("TogglePrinterCheckboxes('{0}', '{1}', '{2}');", chPrinterRedirection.ClientID, chDefaultDevice.ClientID, chEasyPrint.ClientID); + chDisconnect.Attributes["onclick"] = String.Format("EnableReconnectionCheckbox('{0}', true);", chAutomaticReconnection.ClientID); + chEndSession.Attributes["onclick"] = String.Format("EnableReconnectionCheckbox('{0}', false);", chAutomaticReconnection.ClientID); + base.OnPreRender(e); + } + + private void WriteScriptBlock() + { + string scriptKey = "RdsSettingsScript"; + if (!Page.ClientScript.IsClientScriptBlockRegistered(scriptKey)) + { + Page.ClientScript.RegisterClientScriptBlock(GetType(), scriptKey, @""); + } + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionSettings.ascx.designer.cs new file mode 100644 index 00000000..0bb4e3f3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionSettings.ascx.designer.cs @@ -0,0 +1,366 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.RDS { + + + public partial class RDSEditCollectionSettings { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// imgEditRDSCollection control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgEditRDSCollection; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// litCollectionName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litCollectionName; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.RDS.UserControls.RdsServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// secRdsSessionSettings control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secRdsSessionSettings; + + /// + /// panelRdsSessionSettings control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel panelRdsSessionSettings; + + /// + /// locSessionLimitHeader control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSessionLimitHeader; + + /// + /// locDisconnectedSessionLimit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDisconnectedSessionLimit; + + /// + /// slDisconnectedSessionLimit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.RDS.UserControls.RDSSessionLimit slDisconnectedSessionLimit; + + /// + /// locActiveSessionLimit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locActiveSessionLimit; + + /// + /// slActiveSessionLimit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.RDS.UserControls.RDSSessionLimit slActiveSessionLimit; + + /// + /// locIdleSessionLimit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locIdleSessionLimit; + + /// + /// slIdleSessionLimit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.RDS.UserControls.RDSSessionLimit slIdleSessionLimit; + + /// + /// locCollectionBroken control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locCollectionBroken; + + /// + /// chDisconnect control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton chDisconnect; + + /// + /// chAutomaticReconnection control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chAutomaticReconnection; + + /// + /// chEndSession control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton chEndSession; + + /// + /// locTempFolder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTempFolder; + + /// + /// chDeleteOnExit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chDeleteOnExit; + + /// + /// chUseFolders control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chUseFolders; + + /// + /// secRdsClientSettings control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secRdsClientSettings; + + /// + /// panelRdsClientSettings control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel panelRdsClientSettings; + + /// + /// locEnableRedirection control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locEnableRedirection; + + /// + /// chAudioVideo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chAudioVideo; + + /// + /// chAudioRecording control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chAudioRecording; + + /// + /// chSmartCards control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chSmartCards; + + /// + /// chPlugPlay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chPlugPlay; + + /// + /// chDrives control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chDrives; + + /// + /// chClipboard control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chClipboard; + + /// + /// locPrinters control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrinters; + + /// + /// chPrinterRedirection control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chPrinterRedirection; + + /// + /// chDefaultDevice control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chDefaultDevice; + + /// + /// chEasyPrint control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chEasyPrint; + + /// + /// locMonitors control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMonitors; + + /// + /// locMonitorsNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMonitorsNumber; + + /// + /// tbMonitorsNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox tbMonitorsNumber; + + /// + /// buttonPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ItemButtonPanel buttonPanel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx index 5ad4020a..06dc8446 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx @@ -5,13 +5,13 @@ - + <%# Eval("Name") %> - + <%# Eval("Name") %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs index 340559f7..7c99c275 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs @@ -19,8 +19,9 @@ namespace WebsitePanel.Portal.RDS.UserControls private void BindTabs() { - List tabsList = new List(); + List tabsList = new List(); tabsList.Add(CreateTab("rds_edit_collection", "Tab.RdsServers")); + tabsList.Add(CreateTab("rds_edit_collection_settings", "Tab.Settings")); tabsList.Add(CreateTab("rds_collection_edit_apps", "Tab.RdsApplications")); tabsList.Add(CreateTab("rds_collection_edit_users", "Tab.RdsUsers")); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSSessionLimit.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSSessionLimit.ascx new file mode 100644 index 00000000..44011983 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSSessionLimit.ascx @@ -0,0 +1,22 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RDSSessionLimit.ascx.cs" Inherits="WebsitePanel.Portal.RDS.UserControls.RDSSessionLimit" %> + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSSessionLimit.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSSessionLimit.ascx.cs new file mode 100644 index 00000000..ebbdbe02 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSSessionLimit.ascx.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebsitePanel.Portal.RDS.UserControls +{ + public partial class RDSSessionLimit : System.Web.UI.UserControl + { + public int SelectedLimit + { + get + { + return Convert.ToInt32(SessionLimit.SelectedItem.Value); + } + set + { + SessionLimit.SelectedValue = value.ToString(); + } + } + + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSSessionLimit.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSSessionLimit.ascx.designer.cs new file mode 100644 index 00000000..6a4e7ec0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSSessionLimit.ascx.designer.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.RDS.UserControls { + + + public partial class RDSSessionLimit { + + /// + /// SessionLimit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList SessionLimit; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj index e077bc36..0156e3bd 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -211,35 +211,35 @@ - + OrganizationDeletedUsers.ascx ASPXCodeBehind - - - ExchangeCheckDomainName.ascx - ASPXCodeBehind - - - OrganizationDeletedUsers.ascx - - + + ExchangeCheckDomainName.ascx - - + ASPXCodeBehind + + + OrganizationDeletedUsers.ascx + + + ExchangeCheckDomainName.ascx + + OrganizationDeletedUserGeneralSettings.ascx ASPXCodeBehind - - + + Windows2012_Settings.ascx ASPXCodeBehind - - + + OrganizationDeletedUserGeneralSettings.ascx - - + + Windows2012_Settings.ascx - - + + OrganizationDeletedUserMemberOf.ascx ASPXCodeBehind @@ -302,6 +302,13 @@ RDSEditCollectionApps.ascx + + RDSEditCollectionSettings.ascx + ASPXCodeBehind + + + RDSEditCollectionSettings.ascx + RDSEditCollectionUsers.ascx ASPXCodeBehind @@ -351,6 +358,13 @@ RDSCollectionTabs.ascx + + RDSSessionLimit.ascx + ASPXCodeBehind + + + RDSSessionLimit.ascx + True True @@ -4341,11 +4355,13 @@ + + @@ -4353,6 +4369,7 @@ + @@ -4366,7 +4383,9 @@ Designer - + + Designer + ResXFileCodeGenerator DomainLookupView.ascx.Designer.cs @@ -5649,7 +5668,9 @@ Designer - + + Designer + From 79e72251b14431b1f839dc132c0600ecc43f5296 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 27 Jan 2015 09:11:14 -0500 Subject: [PATCH 4/6] Added tag build-2.1.0.546 for changeset 410341b9981f From b1e5ded416d7c2a321c4949ce223ac2aaeaf4808 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 27 Jan 2015 23:12:55 -0500 Subject: [PATCH 5/6] Backed out changeset: 17a9203f2f31 --- .../WebsitePanel/UserSpaces.ascx.cs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserSpaces.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserSpaces.ascx.cs index 8d029680..1a086347 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserSpaces.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserSpaces.ascx.cs @@ -48,7 +48,6 @@ namespace WebsitePanel.Portal { XmlNodeList xmlIcons = null; DataSet myPackages; - int currentPackage; protected void Page_Load(object sender, EventArgs e) { @@ -69,15 +68,6 @@ namespace WebsitePanel.Portal ddlPackageSelect.DataTextField = myPackages.Tables[0].Columns[2].ColumnName; ddlPackageSelect.DataValueField = myPackages.Tables[0].Columns[0].ColumnName; ddlPackageSelect.DataBind(); - if(Session["currentPackage"] == null) { - if(ddlPackageSelect.Items.Count > 0) { - Session["currentPackage"] = ddlPackageSelect.Items[0].Value; - currentPackage = int.Parse(Session["currentPackage"].ToString()); - } - } else { - currentPackage = int.Parse(Session["currentPackage"].ToString()); - ddlPackageSelect.SelectedValue = currentPackage.ToString(); - } } // USER UserPackagesPanel.Visible = true; @@ -88,7 +78,7 @@ namespace WebsitePanel.Portal EmptyPackagesList.Visible = true; } else { ddlPackageSelect.Visible = true; - myPackages = new PackagesHelper().GetMyPackage(currentPackage); + myPackages = new PackagesHelper().GetMyPackage(int.Parse(ddlPackageSelect.SelectedValue)); PackagesList.DataSource = myPackages; PackagesList.DataBind(); } @@ -251,8 +241,8 @@ namespace WebsitePanel.Portal } public void openSelectedPackage(Object sender, EventArgs e) { - Session["currentPackage"] = int.Parse(ddlPackageSelect.SelectedValue); - Response.Redirect(Request.RawUrl); + PackagesList.DataSource = new PackagesHelper().GetMyPackage(int.Parse(ddlPackageSelect.SelectedValue)); + PackagesList.DataBind(); } } } From 2e364e190ab0ab5d0ee9b204e0f54ed494f47c2f Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 27 Jan 2015 23:21:16 -0500 Subject: [PATCH 6/6] Added tag build-2.1.0.547 for changeset bae51a4c3e29