From fb64707187344bd78b2d23ea7ef8192284bd6ac6 Mon Sep 17 00:00:00 2001 From: dev_amdtel Date: Thu, 24 Oct 2013 15:35:38 +0400 Subject: [PATCH] 1. Registered RDS provider 2. Added provider setting modify dialog 3. Added RDS quota --- WebsitePanel/Database/update_db.sql | 29 +++++++++++ .../Common/Constants.cs | 2 +- .../Windows2012.cs | 6 ++- .../WebsitePanel_SharedResources.ascx.resx | 6 +-- .../ProviderControls/RDS_Settings.ascx | 12 +++++ .../ProviderControls/RDS_Settings.ascx.cs | 52 +++++++++++++++++++ .../RDS_Settings.ascx.designer.cs | 42 +++++++++++++++ .../WebsitePanel.Portal.Modules.csproj | 8 +++ 8 files changed, 152 insertions(+), 5 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/RDS_Settings.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/RDS_Settings.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/RDS_Settings.ascx.designer.cs diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 1547a587..03265998 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -2372,3 +2372,32 @@ UPDATE AdditionalGroups SET GroupName = @GroupName WHERE ID = @GroupID GO + + + +-- Remote Desktop Services + +-- RDS ResourceGroup + +IF NOT EXISTS (SELECT * FROM [dbo].[ResourceGroups] WHERE [GroupName] = 'RDS') +BEGIN +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (45, N'RDS', 26, NULL, 1) +END +GO + +-- RDS Quota + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'RDS.Users') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (450, 45, 1, N'RDS.Users',N'Remote Desktop Users',2, 0 , NULL) +END +GO + +-- RDS Provider + +IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [DisplayName] = 'Remote Desktop Services Windows 2012') +BEGIN +INSERT [dbo].[Providers] ([ProviderId], [GroupId], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) +VALUES(1501, 45, N'RemoteDesktopServices2012', N'Remote Desktop Services Windows 2012', N'WebsitePanel.Providers.RemoteDesktopServices.Windows2012,WebsitePanel.Providers.RemoteDesktopServices.Windows2012', N'RDS', 1) +END +GO diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Common/Constants.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Common/Constants.cs index 56a981d0..9d5bfab4 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Common/Constants.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Common/Constants.cs @@ -66,7 +66,7 @@ namespace WebsitePanel.Providers.Common public const string AdministrationToolService = "AdministrationToolService"; - + public const string UsersHome = "UsersHome"; } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index a62c52cc..122f9fbf 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -35,6 +35,7 @@ using Microsoft.Win32; using WebsitePanel.Server.Utils; using WebsitePanel.Providers.Utils; using WebsitePanel.Providers.OS; +using WebsitePanel.Providers.Common; namespace WebsitePanel.Providers.RemoteDesktopServices @@ -45,7 +46,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices #region Properties protected string UsersHome { - get { return FileUtils.EvaluateSystemVariables(ProviderSettings["UsersHome"]); } + get { return FileUtils.EvaluateSystemVariables(ProviderSettings[Constants.UsersHome]); } } #endregion @@ -121,6 +122,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices public override bool IsInstalled() { + // TODO: Remove it. + return true; + Server.Utils.OS.WindowsVersion version = WebsitePanel.Server.Utils.OS.GetVersion(); return version == WebsitePanel.Server.Utils.OS.WindowsVersion.WindowsServer2012; } 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 d188ccc2..d6bb4628 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5110,9 +5110,6 @@ Recoverable Items Storage, MB - - Hosted Exchange - Disk Storage Space, MB @@ -5359,4 +5356,7 @@ Group general settings have been successfully updated. + + Remote Desktop Services + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/RDS_Settings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/RDS_Settings.ascx new file mode 100644 index 00000000..209e90f0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/RDS_Settings.ascx @@ -0,0 +1,12 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RDS_Settings.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.RDS_Settings" %> + + + + + +
+ + + + +
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/RDS_Settings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/RDS_Settings.ascx.cs new file mode 100644 index 00000000..5fd2e411 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/RDS_Settings.ascx.cs @@ -0,0 +1,52 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - 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. + +using System; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.Common; + +namespace WebsitePanel.Portal.ProviderControls +{ + public partial class RDS_Settings : WebsitePanelControlBase, IHostingServiceProviderSettings + { + protected void Page_Load(object sender, EventArgs e) + { + } + + public void BindSettings(System.Collections.Specialized.StringDictionary settings) + { + txtUsersHome.Text = settings[Constants.UsersHome]; + } + + public void SaveSettings(System.Collections.Specialized.StringDictionary settings) + { + settings[Constants.UsersHome] = txtUsersHome.Text; + } + + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/RDS_Settings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/RDS_Settings.ascx.designer.cs new file mode 100644 index 00000000..1b472f45 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/RDS_Settings.ascx.designer.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// <автоматически создаваемое> +// Этот код создан программой. +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.ProviderControls { + + + public partial class RDS_Settings { + + /// + /// lblUsersHome элемент управления. + /// + /// + /// Автоматически создаваемое поле. + /// Для изменения переместите объявление поля из файла конструктора в файл кода программной части. + /// + protected global::System.Web.UI.WebControls.Label lblUsersHome; + + /// + /// txtUsersHome элемент управления. + /// + /// + /// Автоматически создаваемое поле. + /// Для изменения переместите объявление поля из файла конструктора в файл кода программной части. + /// + protected global::System.Web.UI.WebControls.TextBox txtUsersHome; + + /// + /// RequiredFieldValidator1 элемент управления. + /// + /// + /// Автоматически создаваемое поле. + /// Для изменения переместите объявление поля из файла конструктора в файл кода программной части. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1; + } +} 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 8353f1a3..8eef80c9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -479,6 +479,13 @@ Lync_Settings.ascx ASPXCodeBehind + + RDS_Settings.ascx + ASPXCodeBehind + + + RDS_Settings.ascx + ServersEditWebPlatformInstaller.ascx ASPXCodeBehind @@ -4021,6 +4028,7 @@ +