From b1af779c18700cfd700aeec470a032bab75657b9 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Fri, 16 Jan 2015 02:47:54 -0800 Subject: [PATCH] RDS quotas --- WebsitePanel/Database/update_db.sql | 36 +++++++ .../Packages/Quotas.cs | 1 + .../Data/DataProvider.cs | 28 +++++ .../HostedSolution/OrganizationController.cs | 21 ++++ .../RemoteDesktopServicesController.cs | 19 ++++ .../esRemoteDesktopServices.asmx.cs | 12 +++ .../HostedSolution/OrganizationStatistics.cs | 7 +- .../Windows2012.cs | 43 ++++---- .../WebsitePanel_SharedResources.ascx.resx | 3 + .../OrganizationHome.ascx.resx | 12 +++ .../ExchangeServer/OrganizationHome.ascx | 32 ++++++ .../ExchangeServer/OrganizationHome.ascx.cs | 39 +++++++ .../OrganizationHome.ascx.designer.cs | 100 +++++++++++++----- .../WebsitePanel/RDS/RDSCollections.ascx.cs | 6 ++ 14 files changed, 310 insertions(+), 49 deletions(-) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 3f40cf5e..0b218c17 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -2416,6 +2416,12 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDe END GO +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'RDS.Collections') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (491, 45, 2, N'RDS.Collections',N'Remote Desktop Servers',2, 0 , NULL) +END +GO + -- RDS Provider IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [DisplayName] = 'Remote Desktop Services Windows 2012') @@ -6003,6 +6009,36 @@ SELECT RETURN GO +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetOrganizationRdsCollectionsCount') +DROP PROCEDURE GetOrganizationRdsCollectionsCount +GO +CREATE PROCEDURE [dbo].GetOrganizationRdsCollectionsCount +( + @ItemID INT, + @TotalNumber int OUTPUT +) +AS +SELECT + @TotalNumber = Count([Id]) + FROM [dbo].[RDSCollections] WHERE [ItemId] = @ItemId +RETURN +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetOrganizationRdsServersCount') +DROP PROCEDURE GetOrganizationRdsServersCount +GO +CREATE PROCEDURE [dbo].GetOrganizationRdsServersCount +( + @ItemID INT, + @TotalNumber int OUTPUT +) +AS +SELECT + @TotalNumber = Count([Id]) + FROM [dbo].[RDSServers] WHERE [ItemId] = @ItemId +RETURN +GO IF OBJECTPROPERTY(object_id('dbo.GetExchangeAccountByAccountNameWithoutItemId'), N'IsProcedure') = 1 diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs index 7dbabc4c..fa36171f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs @@ -262,5 +262,6 @@ order by rg.groupOrder public const string RDS_USERS = "RDS.Users"; public const string RDS_SERVERS = "RDS.Servers"; + public const string RDS_COLLECTIONS = "RDS.Collections"; } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs index 5854f729..aef785b9 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs @@ -4543,6 +4543,34 @@ namespace WebsitePanel.EnterpriseServer return Convert.ToInt32(count.Value); } + public static int GetOrganizationRdsCollectionsCount(int itemId) + { + SqlParameter count = new SqlParameter("@TotalNumber", SqlDbType.Int); + count.Direction = ParameterDirection.Output; + + DataSet ds = SqlHelper.ExecuteDataset(ConnectionString, CommandType.StoredProcedure, + ObjectQualifier + "GetOrganizationRdsCollectionsCount", + count, + new SqlParameter("@ItemId", itemId)); + + // read identity + return Convert.ToInt32(count.Value); + } + + public static int GetOrganizationRdsServersCount(int itemId) + { + SqlParameter count = new SqlParameter("@TotalNumber", SqlDbType.Int); + count.Direction = ParameterDirection.Output; + + DataSet ds = SqlHelper.ExecuteDataset(ConnectionString, CommandType.StoredProcedure, + ObjectQualifier + "GetOrganizationRdsServersCount", + count, + new SqlParameter("@ItemId", itemId)); + + // read identity + return Convert.ToInt32(count.Value); + } + public static void UpdateRDSCollection(RdsCollection collection) { UpdateRDSCollection(collection.Id, collection.ItemId, collection.Name, collection.Description, collection.DisplayName); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index 6fc370f6..8b4abd9a 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -992,6 +992,13 @@ namespace WebsitePanel.EnterpriseServer stats.UsedEnterpriseStorageSpace = folders.Where(x => x.FRSMQuotaMB != -1).Sum(x => x.FRSMQuotaMB); } + + if (cntxTmp.Groups.ContainsKey(ResourceGroups.RDS)) + { + stats.CreatedRdsUsers = RemoteDesktopServicesController.GetOrganizationRdsUsersCount(org.Id); + stats.CreatedRdsCollections = RemoteDesktopServicesController.GetOrganizationRdsCollectionsCount(org.Id); + stats.CreatedRdsServers = RemoteDesktopServicesController.GetOrganizationRdsServersCount(org.Id); + } } else { @@ -1066,6 +1073,13 @@ namespace WebsitePanel.EnterpriseServer stats.UsedEnterpriseStorageSpace += folders.Where(x => x.FRSMQuotaMB != -1).Sum(x => x.FRSMQuotaMB); } + + if (cntxTmp.Groups.ContainsKey(ResourceGroups.RDS)) + { + stats.CreatedRdsUsers += RemoteDesktopServicesController.GetOrganizationRdsUsersCount(o.Id); + stats.CreatedRdsCollections += RemoteDesktopServicesController.GetOrganizationRdsCollectionsCount(o.Id); + stats.CreatedRdsServers += RemoteDesktopServicesController.GetOrganizationRdsServersCount(o.Id); + } } } } @@ -1119,6 +1133,13 @@ namespace WebsitePanel.EnterpriseServer stats.AllocatedEnterpriseStorageSpace = cntx.Quotas[Quotas.ENTERPRISESTORAGE_DISKSTORAGESPACE].QuotaAllocatedValue; } + if (cntx.Groups.ContainsKey(ResourceGroups.RDS)) + { + stats.AllocatedRdsServers = cntx.Quotas[Quotas.RDS_SERVERS].QuotaAllocatedValue; + stats.AllocatedRdsCollections = cntx.Quotas[Quotas.RDS_COLLECTIONS].QuotaAllocatedValue; + stats.AllocatedRdsUsers = cntx.Quotas[Quotas.RDS_USERS].QuotaAllocatedValue; + } + return stats; } catch (Exception ex) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs index 198490cc..6496e7f6 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs @@ -203,6 +203,16 @@ namespace WebsitePanel.EnterpriseServer return GetOrganizationRdsUsersCountInternal(itemId); } + public static int GetOrganizationRdsServersCount(int itemId) + { + return GetOrganizationRdsServersCountInternal(itemId); + } + + public static int GetOrganizationRdsCollectionsCount(int itemId) + { + return GetOrganizationRdsCollectionsCountInternal(itemId); + } + public static List GetApplicationUsers(int itemId, int collectionId, RemoteApplication remoteApp) { return GetApplicationUsersInternal(itemId, collectionId, remoteApp); @@ -591,6 +601,15 @@ namespace WebsitePanel.EnterpriseServer return DataProvider.GetOrganizationRdsUsersCount(itemId); } + private static int GetOrganizationRdsServersCountInternal(int itemId) + { + return DataProvider.GetOrganizationRdsServersCount(itemId); + } + + private static int GetOrganizationRdsCollectionsCountInternal(int itemId) + { + return DataProvider.GetOrganizationRdsCollectionsCount(itemId); + } private static List GetCollectionRdsServersInternal(int collectionId) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs index 43df9f33..70aa4fa9 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs @@ -236,6 +236,18 @@ namespace WebsitePanel.EnterpriseServer return RemoteDesktopServicesController.GetOrganizationRdsUsersCount(itemId); } + [WebMethod] + public int GetOrganizationRdsServersCount(int itemId) + { + return RemoteDesktopServicesController.GetOrganizationRdsServersCount(itemId); + } + + [WebMethod] + public int GetOrganizationRdsCollectionsCount(int itemId) + { + return RemoteDesktopServicesController.GetOrganizationRdsCollectionsCount(itemId); + } + [WebMethod] public List GetApplicationUsers(int itemId, int collectionId, RemoteApplication remoteApp) { diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatistics.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatistics.cs index 4e0fdc62..d6dd00e6 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatistics.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatistics.cs @@ -370,7 +370,12 @@ namespace WebsitePanel.Providers.HostedSolution set { createdResourceMailboxes = value; } } - + public int CreatedRdsServers { get; set; } + public int CreatedRdsCollections { get; set; } + public int CreatedRdsUsers { get; set; } + public int AllocatedRdsServers { get; set; } + public int AllocatedRdsCollections { get; set; } + public int AllocatedRdsUsers { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index 953addf0..0a71b867 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2015, Outercurve Foundation. +// Copyright (c) 2015, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -220,20 +220,20 @@ namespace WebsitePanel.Providers.RemoteDesktopServices try { - runSpace = OpenRunspace(); + runSpace = OpenRunspace(); var existingServers = GetServersExistingInCollections(runSpace); - existingServers = existingServers.Select(x => x.ToUpper()).Intersect(collection.Servers.Select(x => x.FqdName.ToUpper())).ToList(); + existingServers = existingServers.Select(x => x.ToUpper()).Intersect(collection.Servers.Select(x => x.FqdName.ToUpper())).ToList(); if (existingServers.Any()) { throw new Exception(string.Format("Server{0} {1} already added to another collection", existingServers.Count == 1 ? "" : "s", string.Join(" ,", existingServers.ToArray()))); - } + } foreach (var server in collection.Servers) { //If server will restart it will not be added to collection - //Do not install feature here + //Do not install feature here if (!ExistRdsServerInDeployment(runSpace, server)) { @@ -786,7 +786,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices } internal void CreateRdRapForce(Runspace runSpace, string gatewayHost, string policyName, string collectionName, List groups) - { + { //New-Item -Path "RDS:\GatewayServer\RAP" -Name "Allow Connections To Everywhere" -UserGroups "Administrators@." -ComputerGroupType 1 //Set-Item -Path "RDS:\GatewayServer\RAP\Allow Connections To Everywhere\PortNumbers" -Value 3389,3390 @@ -795,6 +795,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices RemoveRdRap(runSpace, gatewayHost, policyName); } + Log.WriteWarning(gatewayHost); var userGroupParametr = string.Format("@({0})", string.Join(",", groups.Select(x => string.Format("\"{0}@{1}\"", x, RootDomain)).ToArray())); var computerGroupParametr = string.Format("\"{0}@{1}\"", GetComputersGroupName(collectionName), RootDomain); @@ -804,8 +805,10 @@ namespace WebsitePanel.Providers.RemoteDesktopServices rdRapCommand.Parameters.Add("UserGroups", userGroupParametr); rdRapCommand.Parameters.Add("ComputerGroupType", 1); rdRapCommand.Parameters.Add("ComputerGroup", computerGroupParametr); - + Log.WriteWarning("User Group:" + userGroupParametr); + Log.WriteWarning("Computer Group:" + computerGroupParametr); ExecuteRemoteShellCommand(runSpace, gatewayHost, rdRapCommand, RdsModuleName); + Log.WriteWarning("RD RAP Added"); } internal void RemoveRdRap(Runspace runSpace, string gatewayHost, string name) @@ -1595,22 +1598,22 @@ namespace WebsitePanel.Providers.RemoteDesktopServices internal List GetServersExistingInCollections(Runspace runSpace) { var existingHosts = new List(); - var scripts = new List(); - scripts.Add(string.Format("$sessions = Get-RDSessionCollection -ConnectionBroker {0}", ConnectionBroker)); - scripts.Add(string.Format("foreach($session in $sessions){{Get-RDSessionHost $session.CollectionName -ConnectionBroker {0}|Select SessionHost}}", ConnectionBroker)); - object[] errors; + //var scripts = new List(); + //scripts.Add(string.Format("$sessions = Get-RDSessionCollection -ConnectionBroker {0}", ConnectionBroker)); + //scripts.Add(string.Format("foreach($session in $sessions){{Get-RDSessionHost $session.CollectionName -ConnectionBroker {0}|Select SessionHost}}", ConnectionBroker)); + //object[] errors; - var sessionHosts = ExecuteShellCommand(runSpace, scripts, out errors); + //var sessionHosts = ExecuteShellCommand(runSpace, scripts, out errors); - foreach(var host in sessionHosts) - { - var sessionHost = GetPSObjectProperty(host, "SessionHost"); + //foreach(var host in sessionHosts) + //{ + // var sessionHost = GetPSObjectProperty(host, "SessionHost"); - if (sessionHost != null) - { - existingHosts.Add(sessionHost.ToString()); - } - } + // if (sessionHost != null) + // { + // existingHosts.Add(sessionHost.ToString()); + // } + //} return existingHosts; } 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 27771dda..8f4f1497 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5590,6 +5590,9 @@ Remote Desktop Users + + Remote Desktop Collections + Error creating rds collection. You need to add at least 1 rds server to collection diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx index c6347b42..7c55ac0c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx @@ -222,4 +222,16 @@ Service Levels + + Remote Desktop + + + RDS Servers + + + RDS Collections + + + RDS Users + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx index 2817164c..6c87216e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx @@ -341,6 +341,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs index 07b5c9d1..f54fa11f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs @@ -305,6 +305,16 @@ namespace WebsitePanel.Portal.ExchangeServer } else serviceLevelsStatsPanel.Visible = false; + + if (cntx.Groups.ContainsKey(ResourceGroups.RDS)) + { + remoteDesktopStatsPanel.Visible = true; + BindRemoteDesktopStats(orgStats, tenantStats); + } + else + { + remoteDesktopStatsPanel.Visible = false; + } } private void BindCRMStats(OrganizationStatistics stats, OrganizationStatistics tenantStats) @@ -447,5 +457,34 @@ namespace WebsitePanel.Portal.ExchangeServer } } + private void BindRemoteDesktopStats(OrganizationStatistics stats, OrganizationStatistics tenantStats) + { + rdsServers.QuotaValue = stats.AllocatedRdsServers; + rdsServers.QuotaUsedValue = stats.CreatedRdsServers; + if (stats.AllocatedRdsServers != -1) + { + rdsServers.QuotaAvailable = tenantStats.AllocatedRdsServers - tenantStats.CreatedRdsServers; + } + + rdsCollections.QuotaValue = stats.AllocatedRdsCollections; + rdsCollections.QuotaUsedValue = stats.CreatedRdsCollections; + + if (stats.AllocatedRdsCollections != -1) + { + rdsCollections.QuotaAvailable = tenantStats.AllocatedRdsCollections - tenantStats.CreatedRdsCollections; + } + + rdsUsers.QuotaValue = stats.AllocatedRdsUsers; + rdsUsers.QuotaUsedValue = stats.CreatedRdsUsers; + + if (stats.AllocatedRdsCollections != -1) + { + rdsUsers.QuotaAvailable = tenantStats.AllocatedRdsUsers - tenantStats.CreatedRdsUsers; + } + + lnkRdsServers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "rds_collections", "SpaceID=" + PanelSecurity.PackageId); + lnkRdsCollections.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "rds_collections", "SpaceID=" + PanelSecurity.PackageId); + lnkRdsUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "rds_collections", "SpaceID=" + PanelSecurity.PackageId); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs index c2baf362..730b0509 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.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. @@ -822,5 +794,77 @@ namespace WebsitePanel.Portal.ExchangeServer { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Localize locServiceLevels; + + /// + /// remoteDesktopStatsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel remoteDesktopStatsPanel; + + /// + /// locRemoteDesktop control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locRemoteDesktop; + + /// + /// lnkRdsServers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkRdsServers; + + /// + /// rdsServers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaViewer rdsServers; + + /// + /// lnkRdsCollections control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkRdsCollections; + + /// + /// rdsCollections control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaViewer rdsCollections; + + /// + /// lnkRdsUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkRdsUsers; + + /// + /// rdsUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaViewer rdsUsers; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx.cs index 097e62f7..e892b209 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx.cs @@ -45,6 +45,12 @@ namespace WebsitePanel.Portal.RDS if (!IsPostBack) { } + + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + if (cntx.Quotas.ContainsKey(Quotas.RDS_COLLECTIONS)) + { + btnAddCollection.Enabled = (!(cntx.Quotas[Quotas.RDS_COLLECTIONS].QuotaAllocatedValue <= gvRDSCollections.Rows.Count) || (cntx.Quotas[Quotas.RDS_COLLECTIONS].QuotaAllocatedValue == -1)); + } } public string GetServerName(string collectionId)