From 0e130a7af09ad5b9ccb69ae7479aaa1c599fda6d Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Thu, 29 Jan 2015 15:14:57 +0700 Subject: [PATCH 01/22] wsp-10300 Default Global Mailbox Plan --- .../ExchangeServerController.cs | 29 +-- .../WebsitePanel_SharedResources.ascx.resx | 3 + ...ttingsExchangeMailboxPlansPolicy.ascx.resx | 3 + .../SettingsExchangeMailboxPlansPolicy.ascx | 15 +- ...SettingsExchangeMailboxPlansPolicy.ascx.cs | 173 ++++++++---------- ...xchangeMailboxPlansPolicy.ascx.designer.cs | 142 +++++++------- 6 files changed, 183 insertions(+), 182 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs index be688d18..f8698cf5 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs @@ -31,6 +31,7 @@ using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Data; +using System.Linq; using System.Net.Mail; using System.Threading; using WebsitePanel.EnterpriseServer.Code.HostedSolution; @@ -2919,23 +2920,18 @@ namespace WebsitePanel.EnterpriseServer try { List mailboxPlans = new List(); + int? defaultPlanId = null; UserInfo user = ObjectUtils.FillObjectFromDataReader(DataProvider.GetUserByExchangeOrganizationIdInternally(itemId)); if (user.Role == UserRole.User) - ExchangeServerController.GetExchangeMailboxPlansByUser(itemId, user, ref mailboxPlans, archiving); + GetExchangeMailboxPlansByUser(itemId, user, ref mailboxPlans, ref defaultPlanId, archiving); else - ExchangeServerController.GetExchangeMailboxPlansByUser(0, user, ref mailboxPlans, archiving); + GetExchangeMailboxPlansByUser(0, user, ref mailboxPlans, ref defaultPlanId, archiving); - - ExchangeOrganization ExchangeOrg = ObjectUtils.FillObjectFromDataReader(DataProvider.GetExchangeOrganization(itemId)); - - if (ExchangeOrg != null) + if (defaultPlanId.HasValue) { - foreach (ExchangeMailboxPlan p in mailboxPlans) - { - p.IsDefault = (p.MailboxPlanId == ExchangeOrg.ExchangeMailboxPlanID); - } + mailboxPlans.ForEach(p => p.IsDefault = (p.MailboxPlanId == defaultPlanId.Value)); } return mailboxPlans; @@ -2950,7 +2946,7 @@ namespace WebsitePanel.EnterpriseServer } } - private static void GetExchangeMailboxPlansByUser(int itemId, UserInfo user, ref List mailboxPlans, bool archiving) + private static void GetExchangeMailboxPlansByUser(int itemId, UserInfo user, ref List mailboxPlans, ref int? defaultPlanId, bool archiving) { if ((user != null)) { @@ -2983,11 +2979,20 @@ namespace WebsitePanel.EnterpriseServer { mailboxPlans.Add(p); } + + // Set default plan + ExchangeOrganization exchangeOrg = ObjectUtils.FillObjectFromDataReader(DataProvider.GetExchangeOrganization(OrgId)); + + // If the default plan has not been set by the setting of higher priority + if (!defaultPlanId.HasValue && exchangeOrg != null && exchangeOrg.ExchangeMailboxPlanID > 0) + { + defaultPlanId = exchangeOrg.ExchangeMailboxPlanID; + } } UserInfo owner = UserController.GetUserInternally(user.OwnerId); - GetExchangeMailboxPlansByUser(0, owner, ref mailboxPlans, archiving); + GetExchangeMailboxPlansByUser(0, owner, ref mailboxPlans, ref defaultPlanId, archiving); } } 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 3d851e29..60c685cc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5335,6 +5335,9 @@ Mailbox plan updated + + Succesfully set default mailbox plan. + Lync plan update failed diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsExchangeMailboxPlansPolicy.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsExchangeMailboxPlansPolicy.ascx.resx index 220a268c..d35a7610 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsExchangeMailboxPlansPolicy.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsExchangeMailboxPlansPolicy.ascx.resx @@ -249,4 +249,7 @@ Retention policy + + Default + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx index a9a75838..e08d5b60 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx @@ -28,6 +28,15 @@ <%# PortalAntiXSS.Encode((string)Eval("MailboxPlan"))%> + + + +   + +   -
+
+
+ +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs index 04ff1c50..67fdd3fe 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs @@ -36,7 +36,7 @@ using System.Xml.Serialization; using System.Collections.Generic; using System.Collections.ObjectModel; - +using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; @@ -99,21 +99,7 @@ namespace WebsitePanel.Portal private void BindMailboxPlans() { - Providers.HostedSolution.Organization[] orgs = null; - - if (PanelSecurity.SelectedUserId != 1) - { - PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId); - - if ((Packages != null) & (Packages.GetLength(0) > 0)) - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false); - } - } - else - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false); - } + Providers.HostedSolution.Organization[] orgs = GetOrganizations(); if ((orgs != null) & (orgs.GetLength(0) > 0)) { @@ -123,6 +109,12 @@ namespace WebsitePanel.Portal gvMailboxPlans.DataBind(); } + //check if organization has only one default domain or less + if (gvMailboxPlans.Rows.Count <= 1) + { + btnSetDefaultMailboxPlan.Enabled = false; + } + btnUpdateMailboxPlan.Enabled = (string.IsNullOrEmpty(txtMailboxPlan.Text)) ? false : true; } @@ -185,21 +177,7 @@ namespace WebsitePanel.Portal if (PanelSecurity.SelectedUser.Role == UserRole.Reseller) plan.MailboxPlanType = (int)ExchangeMailboxPlanType.Reseller; - Providers.HostedSolution.Organization[] orgs = null; - - if (PanelSecurity.SelectedUserId != 1) - { - PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId); - - if ((Packages != null) & (Packages.GetLength(0) > 0)) - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false); - } - } - else - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false); - } + Providers.HostedSolution.Organization[] orgs = GetOrganizations(); if ((orgs != null) & (orgs.GetLength(0) > 0)) @@ -231,20 +209,7 @@ namespace WebsitePanel.Portal case "DeleteItem": try { - - if (PanelSecurity.SelectedUserId != 1) - { - PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId); - - if ((Packages != null) & (Packages.GetLength(0) > 0)) - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false); - } - } - else - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false); - } + orgs = GetOrganizations(); plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(orgs[0].Id, mailboxPlanId); @@ -308,20 +273,7 @@ namespace WebsitePanel.Portal case "EditItem": ViewState["MailboxPlanID"] = mailboxPlanId; - if (PanelSecurity.SelectedUserId != 1) - { - PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId); - - if ((Packages != null) & (Packages.GetLength(0) > 0)) - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false); - } - } - else - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false); - } - + orgs = GetOrganizations(); plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(orgs[0].Id, mailboxPlanId); txtMailboxPlan.Text = plan.MailboxPlan; @@ -421,24 +373,9 @@ namespace WebsitePanel.Portal return; int mailboxPlanId = (int)ViewState["MailboxPlanID"]; - Providers.HostedSolution.Organization[] orgs = null; + Providers.HostedSolution.Organization[] orgs = GetOrganizations(); Providers.HostedSolution.ExchangeMailboxPlan plan; - - if (PanelSecurity.SelectedUserId != 1) - { - PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId); - - if ((Packages != null) & (Packages.GetLength(0) > 0)) - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false); - } - } - else - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false); - } - plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(orgs[0].Id, mailboxPlanId); if (plan.ItemId != orgs[0].Id) @@ -668,36 +605,22 @@ namespace WebsitePanel.Portal { ddTags.Items.Clear(); - Providers.HostedSolution.Organization[] orgs = null; + Organization[] orgs = GetOrganizations(); - if (PanelSecurity.SelectedUserId != 1) - { - PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId); - - if ((Packages != null) & (Packages.GetLength(0) > 0)) + if ((orgs != null) && (orgs.GetLength(0) > 0)) { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false); - } - } - else - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false); - } + Providers.HostedSolution.ExchangeRetentionPolicyTag[] allTags = ES.Services.ExchangeServer.GetExchangeRetentionPolicyTags(orgs[0].Id); + List selectedTags = ViewState["Tags"] as List; - if ((orgs != null) & (orgs.GetLength(0) > 0)) - { - Providers.HostedSolution.ExchangeRetentionPolicyTag[] allTags = ES.Services.ExchangeServer.GetExchangeRetentionPolicyTags(orgs[0].Id); - List selectedTags = ViewState["Tags"] as List; - - foreach (Providers.HostedSolution.ExchangeRetentionPolicyTag tag in allTags) - { - if (selectedTags != null) + foreach (Providers.HostedSolution.ExchangeRetentionPolicyTag tag in allTags) { - if (selectedTags.Find(x => x.TagID == tag.TagID) != null) - continue; - } + if (selectedTags != null) + { + if (selectedTags.Find(x => x.TagID == tag.TagID) != null) + continue; + } - ddTags.Items.Add(new System.Web.UI.WebControls.ListItem(tag.TagName, tag.TagID.ToString())); + ddTags.Items.Add(new System.Web.UI.WebControls.ListItem(tag.TagName, tag.TagID.ToString())); } } @@ -737,5 +660,55 @@ namespace WebsitePanel.Portal } + protected Organization[] GetOrganizations() + { + Organization[] orgs = null; + + if (PanelSecurity.SelectedUserId != 1) + { + PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId); + + if ((Packages != null) & (Packages.GetLength(0) > 0)) + { + orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false); + } + } + else + { + orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false); + } + + return orgs; + } + + protected void btnSetDefaultMailboxPlan_Click(object sender, EventArgs e) + { + // get domain + int mailboxPlanId = Utils.ParseInt(Request.Form["DefaultMailboxPlan"], 0); + + try + { + var orgs = GetOrganizations(); + + if ((orgs != null) && (orgs.GetLength(0) > 0)) + { + ES.Services.ExchangeServer.SetOrganizationDefaultExchangeMailboxPlan(orgs[0].Id, mailboxPlanId); + + messageBox.ShowSuccessMessage("EXCHANGE_SET_DEFAULT_MAILBOXPLAN"); + + // rebind domains + BindMailboxPlans(); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("EXCHANGE_SET_DEFAULT_MAILBOXPLAN", ex); + } + } + + protected string IsChecked(bool val) + { + return val ? "checked" : ""; + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs index 84de2aeb..1c07cbce 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs @@ -35,11 +35,13 @@ // //------------------------------------------------------------------------------ -namespace WebsitePanel.Portal { - - - public partial class SettingsExchangeMailboxPlansPolicy { - +namespace WebsitePanel.Portal +{ + + + public partial class SettingsExchangeMailboxPlansPolicy + { + /// /// asyncTasks control. /// @@ -48,7 +50,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; - + /// /// messageBox control. /// @@ -57,7 +59,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; - + /// /// gvMailboxPlans control. /// @@ -66,7 +68,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.GridView gvMailboxPlans; - + /// /// secMailboxPlan control. /// @@ -75,7 +77,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.CollapsiblePanel secMailboxPlan; - + /// /// MailboxPlan control. /// @@ -84,7 +86,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel MailboxPlan; - + /// /// txtMailboxPlan control. /// @@ -93,7 +95,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox txtMailboxPlan; - + /// /// valRequireMailboxPlan control. /// @@ -102,7 +104,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireMailboxPlan; - + /// /// secMailboxFeatures control. /// @@ -111,7 +113,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.CollapsiblePanel secMailboxFeatures; - + /// /// MailboxFeatures control. /// @@ -120,7 +122,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel MailboxFeatures; - + /// /// chkPOP3 control. /// @@ -129,7 +131,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBox chkPOP3; - + /// /// chkIMAP control. /// @@ -138,7 +140,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBox chkIMAP; - + /// /// chkOWA control. /// @@ -147,7 +149,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBox chkOWA; - + /// /// chkMAPI control. /// @@ -156,7 +158,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBox chkMAPI; - + /// /// chkActiveSync control. /// @@ -165,7 +167,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBox chkActiveSync; - + /// /// secMailboxGeneral control. /// @@ -174,7 +176,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.CollapsiblePanel secMailboxGeneral; - + /// /// MailboxGeneral control. /// @@ -183,7 +185,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel MailboxGeneral; - + /// /// chkHideFromAddressBook control. /// @@ -192,7 +194,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBox chkHideFromAddressBook; - + /// /// secStorageQuotas control. /// @@ -201,7 +203,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.CollapsiblePanel secStorageQuotas; - + /// /// StorageQuotas control. /// @@ -210,7 +212,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel StorageQuotas; - + /// /// locMailboxSize control. /// @@ -219,7 +221,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Localize locMailboxSize; - + /// /// mailboxSize control. /// @@ -228,7 +230,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.QuotaEditor mailboxSize; - + /// /// locMaxRecipients control. /// @@ -237,7 +239,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Localize locMaxRecipients; - + /// /// maxRecipients control. /// @@ -246,7 +248,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.QuotaEditor maxRecipients; - + /// /// locMaxSendMessageSizeKB control. /// @@ -255,7 +257,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Localize locMaxSendMessageSizeKB; - + /// /// maxSendMessageSizeKB control. /// @@ -264,7 +266,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.QuotaEditor maxSendMessageSizeKB; - + /// /// locMaxReceiveMessageSizeKB control. /// @@ -273,7 +275,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Localize locMaxReceiveMessageSizeKB; - + /// /// maxReceiveMessageSizeKB control. /// @@ -282,7 +284,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.QuotaEditor maxReceiveMessageSizeKB; - + /// /// locWhenSizeExceeds control. /// @@ -291,7 +293,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Localize locWhenSizeExceeds; - + /// /// locIssueWarning control. /// @@ -300,7 +302,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Localize locIssueWarning; - + /// /// sizeIssueWarning control. /// @@ -309,7 +311,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox sizeIssueWarning; - + /// /// locProhibitSend control. /// @@ -318,7 +320,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Localize locProhibitSend; - + /// /// sizeProhibitSend control. /// @@ -327,7 +329,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox sizeProhibitSend; - + /// /// locProhibitSendReceive control. /// @@ -336,7 +338,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Localize locProhibitSendReceive; - + /// /// sizeProhibitSendReceive control. /// @@ -345,7 +347,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox sizeProhibitSendReceive; - + /// /// secDeleteRetention control. /// @@ -354,7 +356,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.CollapsiblePanel secDeleteRetention; - + /// /// DeleteRetention control. /// @@ -363,7 +365,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel DeleteRetention; - + /// /// locKeepDeletedItems control. /// @@ -372,7 +374,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Localize locKeepDeletedItems; - + /// /// daysKeepDeletedItems control. /// @@ -381,7 +383,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.ExchangeServer.UserControls.DaysBox daysKeepDeletedItems; - + /// /// secLitigationHold control. /// @@ -390,7 +392,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.CollapsiblePanel secLitigationHold; - + /// /// LitigationHold control. /// @@ -399,7 +401,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel LitigationHold; - + /// /// chkEnableLitigationHold control. /// @@ -408,7 +410,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBox chkEnableLitigationHold; - + /// /// locRecoverableItemsSpace control. /// @@ -417,7 +419,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Localize locRecoverableItemsSpace; - + /// /// recoverableItemsSpace control. /// @@ -426,7 +428,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.QuotaEditor recoverableItemsSpace; - + /// /// locRecoverableItemsWarning control. /// @@ -435,7 +437,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Localize locRecoverableItemsWarning; - + /// /// recoverableItemsWarning control. /// @@ -444,7 +446,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox recoverableItemsWarning; - + /// /// lblLitigationHoldUrl control. /// @@ -453,7 +455,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblLitigationHoldUrl; - + /// /// txtLitigationHoldUrl control. /// @@ -462,7 +464,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox txtLitigationHoldUrl; - + /// /// lblLitigationHoldMsg control. /// @@ -471,7 +473,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblLitigationHoldMsg; - + /// /// txtLitigationHoldMsg control. /// @@ -480,7 +482,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox txtLitigationHoldMsg; - + /// /// secArchiving control. /// @@ -489,7 +491,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.CollapsiblePanel secArchiving; - + /// /// Archiving control. /// @@ -498,7 +500,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel Archiving; - + /// /// chkEnableArchiving control. /// @@ -507,7 +509,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBox chkEnableArchiving; - + /// /// locArchiveQuota control. /// @@ -516,7 +518,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Localize locArchiveQuota; - + /// /// archiveQuota control. /// @@ -525,7 +527,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.QuotaEditor archiveQuota; - + /// /// locArchiveWarningQuota control. /// @@ -534,7 +536,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Localize locArchiveWarningQuota; - + /// /// archiveWarningQuota control. /// @@ -543,7 +545,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox archiveWarningQuota; - + /// /// secRetentionPolicyTags control. /// @@ -552,7 +554,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.CollapsiblePanel secRetentionPolicyTags; - + /// /// RetentionPolicyTags control. /// @@ -561,7 +563,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel RetentionPolicyTags; - + /// /// GeneralUpdatePanel control. /// @@ -570,7 +572,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.UpdatePanel GeneralUpdatePanel; - + /// /// gvPolicy control. /// @@ -579,7 +581,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.GridView gvPolicy; - + /// /// ddTags control. /// @@ -588,7 +590,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList ddTags; - + /// /// bntAddTag control. /// @@ -597,7 +599,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button bntAddTag; - + /// /// btnAddMailboxPlan control. /// @@ -606,7 +608,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button btnAddMailboxPlan; - + /// /// btnUpdateMailboxPlan control. /// @@ -615,7 +617,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button btnUpdateMailboxPlan; - + /// /// txtStatus control. /// @@ -624,5 +626,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox txtStatus; + + protected global::System.Web.UI.WebControls.Button btnSetDefaultMailboxPlan; } } From 128fdaaa0b8e8b2c8f1b744adc3bd2ae93db2be9 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Thu, 29 Jan 2015 01:28:02 -0800 Subject: [PATCH 02/22] RDS user sessions added --- .../RemoteDesktopServicesProxy.cs | 150 ++++++++++++++++++ .../RemoteDesktopServicesController.cs | 64 ++++++++ .../esRemoteDesktopServices.asmx.cs | 12 ++ .../IRemoteDesktopServices.cs | 2 + .../RemoteDesktopServices/RdsUserSession.cs | 16 ++ .../WebsitePanel.Providers.Base.csproj | 1 + .../Windows2012.cs | 73 +++++++++ .../RemoteDesktopServicesProxy.cs | 125 +++++++++++++++ .../RemoteDesktopServices.asmx.cs | 34 ++++ .../ESModule_ControlsHierarchy.config | 1 + .../App_Data/WebsitePanel_Modules.config | 1 + .../WebsitePanel_SharedResources.ascx.resx | 6 + .../RDSUserSessions.ascx.resx | 150 ++++++++++++++++++ .../WebsitePanel/RDS/RDSUserSessions.ascx | 74 +++++++++ .../WebsitePanel/RDS/RDSUserSessions.ascx.cs | 81 ++++++++++ .../RDS/RDSUserSessions.ascx.designer.cs | 105 ++++++++++++ .../RDSCollectionTabs.ascx.resx | 3 + .../RDS/UserControls/RDSCollectionTabs.ascx | 14 +- .../UserControls/RDSCollectionTabs.ascx.cs | 1 + .../WebsitePanel.Portal.Modules.csproj | 13 +- 20 files changed, 922 insertions(+), 4 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsUserSession.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSUserSessions.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.designer.cs diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs index 5b87a4eb..aa2f44e7 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs @@ -100,6 +100,10 @@ namespace WebsitePanel.EnterpriseServer { private System.Threading.SendOrPostCallback SetApplicationUsersOperationCompleted; + private System.Threading.SendOrPostCallback GetRdsUserSessionsOperationCompleted; + + private System.Threading.SendOrPostCallback LogOffRdsUserOperationCompleted; + /// public esRemoteDesktopServices() { this.Url = "http://localhost:9002/esRemoteDesktopServices.asmx"; @@ -210,6 +214,12 @@ namespace WebsitePanel.EnterpriseServer { /// public event SetApplicationUsersCompletedEventHandler SetApplicationUsersCompleted; + /// + public event GetRdsUserSessionsCompletedEventHandler GetRdsUserSessionsCompleted; + + /// + public event LogOffRdsUserCompletedEventHandler LogOffRdsUserCompleted; + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCollection", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public RdsCollection GetRdsCollection(int collectionId) { @@ -1800,6 +1810,94 @@ namespace WebsitePanel.EnterpriseServer { } } + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsUserSessions", 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 RdsUserSession[] GetRdsUserSessions(int collectionId) { + object[] results = this.Invoke("GetRdsUserSessions", new object[] { + collectionId}); + return ((RdsUserSession[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetRdsUserSessions(int collectionId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetRdsUserSessions", new object[] { + collectionId}, callback, asyncState); + } + + /// + public RdsUserSession[] EndGetRdsUserSessions(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((RdsUserSession[])(results[0])); + } + + /// + public void GetRdsUserSessionsAsync(int collectionId) { + this.GetRdsUserSessionsAsync(collectionId, null); + } + + /// + public void GetRdsUserSessionsAsync(int collectionId, object userState) { + if ((this.GetRdsUserSessionsOperationCompleted == null)) { + this.GetRdsUserSessionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsUserSessionsOperationCompleted); + } + this.InvokeAsync("GetRdsUserSessions", new object[] { + collectionId}, this.GetRdsUserSessionsOperationCompleted, userState); + } + + private void OnGetRdsUserSessionsOperationCompleted(object arg) { + if ((this.GetRdsUserSessionsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetRdsUserSessionsCompleted(this, new GetRdsUserSessionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/LogOffRdsUser", 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 LogOffRdsUser(int itemId, string unifiedSessionId, string hostServer) { + object[] results = this.Invoke("LogOffRdsUser", new object[] { + itemId, + unifiedSessionId, + hostServer}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginLogOffRdsUser(int itemId, string unifiedSessionId, string hostServer, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("LogOffRdsUser", new object[] { + itemId, + unifiedSessionId, + hostServer}, callback, asyncState); + } + + /// + public ResultObject EndLogOffRdsUser(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void LogOffRdsUserAsync(int itemId, string unifiedSessionId, string hostServer) { + this.LogOffRdsUserAsync(itemId, unifiedSessionId, hostServer, null); + } + + /// + public void LogOffRdsUserAsync(int itemId, string unifiedSessionId, string hostServer, object userState) { + if ((this.LogOffRdsUserOperationCompleted == null)) { + this.LogOffRdsUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLogOffRdsUserOperationCompleted); + } + this.InvokeAsync("LogOffRdsUser", new object[] { + itemId, + unifiedSessionId, + hostServer}, this.LogOffRdsUserOperationCompleted, userState); + } + + private void OnLogOffRdsUserOperationCompleted(object arg) { + if ((this.LogOffRdsUserCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.LogOffRdsUserCompleted(this, new LogOffRdsUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// public new void CancelAsync(object userState) { base.CancelAsync(userState); @@ -2715,4 +2813,56 @@ namespace WebsitePanel.EnterpriseServer { } } } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetRdsUserSessionsCompletedEventHandler(object sender, GetRdsUserSessionsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetRdsUserSessionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetRdsUserSessionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public RdsUserSession[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((RdsUserSession[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void LogOffRdsUserCompletedEventHandler(object sender, LogOffRdsUserCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class LogOffRdsUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal LogOffRdsUserCompletedEventArgs(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])); + } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs index 67ab6ab2..87ea9dac 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs @@ -103,6 +103,11 @@ namespace WebsitePanel.EnterpriseServer return GetRdsServersPagedInternal(filterColumn, filterValue, sortColumn, startRow, maximumRows); } + public static List GetRdsUserSessions(int collectionId) + { + return GetRdsUserSessionsInternal(collectionId); + } + public static RdsServersPaged GetFreeRdsServersPaged(int packageId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { return GetFreeRdsServersPagedInternal(packageId, filterColumn, filterValue, sortColumn, startRow, maximumRows); @@ -233,6 +238,11 @@ namespace WebsitePanel.EnterpriseServer return SetApplicationUsersInternal(itemId, collectionId, remoteApp, users); } + public static ResultObject LogOffRdsUser(int itemId, string unifiedSessionId, string hostServer) + { + return LogOffRdsUserInternal(itemId, unifiedSessionId, hostServer); + } + private static RdsCollection GetRdsCollectionInternal(int collectionId) { var collection = ObjectUtils.FillObjectFromDataReader(DataProvider.GetRDSCollectionById(collectionId)); @@ -579,6 +589,22 @@ namespace WebsitePanel.EnterpriseServer return result; } + private static List GetRdsUserSessionsInternal(int collectionId) + { + var result = new List(); + var collection = ObjectUtils.FillObjectFromDataReader(DataProvider.GetRDSCollectionById(collectionId)); + var organization = OrganizationController.GetOrganization(collection.ItemId); + + if (organization == null) + { + return result; + } + + var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(organization.PackageId)); + + return rds.GetRdsUserSessions(collection.Name).ToList(); + } + private static RdsServersPaged GetFreeRdsServersPagedInternal(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { RdsServersPaged result = new RdsServersPaged(); @@ -1105,6 +1131,44 @@ namespace WebsitePanel.EnterpriseServer return result; } + private static ResultObject LogOffRdsUserInternal(int itemId, string unifiedSessionId, string hostServer) + { + var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "LOG_OFF_RDS_USER"); + + try + { + Organization org = OrganizationController.GetOrganization(itemId); + + if (org == null) + { + result.IsSuccess = false; + result.AddError("LOG_OFF_RDS_USER", new NullReferenceException("Organization not found")); + + return result; + } + + var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); + rds.LogOffRdsUser(unifiedSessionId, hostServer); + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_LOG_OFF_RDS_USER", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + private static ResultObject AddRemoteApplicationToCollectionInternal(int itemId, RdsCollection collection, RemoteApplication remoteApp) { var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "ADD_REMOTE_APP_TO_COLLECTION"); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs index 3aed999a..de7dfb0f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs @@ -271,5 +271,17 @@ namespace WebsitePanel.EnterpriseServer { return RemoteDesktopServicesController.SetApplicationUsers(itemId, collectionId, remoteApp, users); } + + [WebMethod] + public List GetRdsUserSessions(int collectionId) + { + return RemoteDesktopServicesController.GetRdsUserSessions(collectionId); + } + + [WebMethod] + public ResultObject LogOffRdsUser(int itemId, string unifiedSessionId, string hostServer) + { + return RemoteDesktopServicesController.LogOffRdsUser(itemId, unifiedSessionId, hostServer); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs index 343baa96..942d0ced 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs @@ -66,5 +66,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices bool CheckRDSServerAvaliable(string hostname); List GetServersExistingInCollections(); void EditRdsCollectionSettings(RdsCollection collection); + List GetRdsUserSessions(string collectionName); + void LogOffRdsUser(string unifiedSessionId, string hostServer); } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsUserSession.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsUserSession.cs new file mode 100644 index 00000000..8b03a51b --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsUserSession.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.RemoteDesktopServices +{ + public class RdsUserSession + { + public string CollectionName { get; set; } + public string UserName { get; set; } + public string UnifiedSessionId { get; set; } + public string SessionState { get; set; } + public string HostServer { get; set; } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index e3d9ff2b..6e8b7bd8 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -136,6 +136,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index 05a2dc37..508b691c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -336,6 +336,50 @@ namespace WebsitePanel.Providers.RemoteDesktopServices } } + public List GetRdsUserSessions(string collectionName) + { + Runspace runSpace = null; + var result = new List(); + + try + { + runSpace = OpenRunspace(); + result = GetRdsUserSessionsInternal(collectionName, runSpace); + } + finally + { + CloseRunspace(runSpace); + } + + return result; + } + + public void LogOffRdsUser(string unifiedSessionId, string hostServer) + { + Runspace runSpace = null; + + try + { + runSpace = OpenRunspace(); + object[] errors; + Command cmd = new Command("Invoke-RDUserLogoff"); + cmd.Parameters.Add("HostServer", hostServer); + cmd.Parameters.Add("UnifiedSessionID", unifiedSessionId); + cmd.Parameters.Add("Force", true); + + ExecuteShellCommand(runSpace, cmd, false, out errors); + + if (errors != null && errors.Length > 0) + { + throw new Exception(string.Join("r\\n\\", errors.Select(e => e.ToString()).ToArray())); + } + } + finally + { + CloseRunspace(runSpace); + } + } + public List GetServersExistingInCollections() { Runspace runSpace = null; @@ -1676,6 +1720,35 @@ namespace WebsitePanel.Providers.RemoteDesktopServices return new List(); } + internal List GetRdsUserSessionsInternal(string collectionName, Runspace runSpace) + { + var result = new List(); + var scripts = new List(); + scripts.Add(string.Format("Get-RDUserSession -ConnectionBroker {0} - CollectionName {1} | ft CollectionName, Username, UnifiedSessionId, SessionState, HostServer", ConnectionBroker, collectionName)); + object[] errors; + Command cmd = new Command("Get-RDUserSession"); + cmd.Parameters.Add("CollectionName", collectionName); + cmd.Parameters.Add("ConnectionBroker", ConnectionBroker); + var userSessions = ExecuteShellCommand(runSpace, cmd, false, out errors); + + //var userSessions = ExecuteShellCommand(runSpace, scripts, out errors); + var properties = typeof(RdsUserSession).GetProperties(); + + foreach(var userSession in userSessions) + { + var session = new RdsUserSession(); + + foreach(var prop in properties) + { + prop.SetValue(session, GetPSObjectProperty(userSession, prop.Name).ToString(), null); + } + + result.Add(session); + } + + return result; + } + #endregion } } diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs index 772de6e9..3f06e32a 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs @@ -33,6 +33,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { private System.Threading.SendOrPostCallback EditRdsCollectionSettingsOperationCompleted; + private System.Threading.SendOrPostCallback GetRdsUserSessionsOperationCompleted; + private System.Threading.SendOrPostCallback AddRdsServersToDeploymentOperationCompleted; private System.Threading.SendOrPostCallback GetCollectionOperationCompleted; @@ -75,6 +77,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { private System.Threading.SendOrPostCallback GetServersExistingInCollectionsOperationCompleted; + private System.Threading.SendOrPostCallback LogOffRdsUserOperationCompleted; + /// public RemoteDesktopServices() { this.Url = "http://localhost:9003/RemoteDesktopServices.asmx"; @@ -86,6 +90,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { /// public event EditRdsCollectionSettingsCompletedEventHandler EditRdsCollectionSettingsCompleted; + /// + public event GetRdsUserSessionsCompletedEventHandler GetRdsUserSessionsCompleted; + /// public event AddRdsServersToDeploymentCompletedEventHandler AddRdsServersToDeploymentCompleted; @@ -149,6 +156,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { /// public event GetServersExistingInCollectionsCompletedEventHandler GetServersExistingInCollectionsCompleted; + /// + public event LogOffRdsUserCompletedEventHandler LogOffRdsUserCompleted; + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] @@ -234,6 +244,48 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { } } + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetRdsUserSessions", 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 RdsUserSession[] GetRdsUserSessions(string collectionName) { + object[] results = this.Invoke("GetRdsUserSessions", new object[] { + collectionName}); + return ((RdsUserSession[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetRdsUserSessions(string collectionName, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetRdsUserSessions", new object[] { + collectionName}, callback, asyncState); + } + + /// + public RdsUserSession[] EndGetRdsUserSessions(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((RdsUserSession[])(results[0])); + } + + /// + public void GetRdsUserSessionsAsync(string collectionName) { + this.GetRdsUserSessionsAsync(collectionName, null); + } + + /// + public void GetRdsUserSessionsAsync(string collectionName, object userState) { + if ((this.GetRdsUserSessionsOperationCompleted == null)) { + this.GetRdsUserSessionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsUserSessionsOperationCompleted); + } + this.InvokeAsync("GetRdsUserSessions", new object[] { + collectionName}, this.GetRdsUserSessionsOperationCompleted, userState); + } + + private void OnGetRdsUserSessionsOperationCompleted(object arg) { + if ((this.GetRdsUserSessionsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetRdsUserSessionsCompleted(this, new GetRdsUserSessionsCompletedEventArgs(invokeArgs.Results, 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)] @@ -1157,6 +1209,49 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { } } + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/LogOffRdsUser", 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 LogOffRdsUser(string unifiedSessionId, string hostServer) { + this.Invoke("LogOffRdsUser", new object[] { + unifiedSessionId, + hostServer}); + } + + /// + public System.IAsyncResult BeginLogOffRdsUser(string unifiedSessionId, string hostServer, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("LogOffRdsUser", new object[] { + unifiedSessionId, + hostServer}, callback, asyncState); + } + + /// + public void EndLogOffRdsUser(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void LogOffRdsUserAsync(string unifiedSessionId, string hostServer) { + this.LogOffRdsUserAsync(unifiedSessionId, hostServer, null); + } + + /// + public void LogOffRdsUserAsync(string unifiedSessionId, string hostServer, object userState) { + if ((this.LogOffRdsUserOperationCompleted == null)) { + this.LogOffRdsUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLogOffRdsUserOperationCompleted); + } + this.InvokeAsync("LogOffRdsUser", new object[] { + unifiedSessionId, + hostServer}, this.LogOffRdsUserOperationCompleted, userState); + } + + private void OnLogOffRdsUserOperationCompleted(object arg) { + if ((this.LogOffRdsUserCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.LogOffRdsUserCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// public new void CancelAsync(object userState) { base.CancelAsync(userState); @@ -1193,6 +1288,32 @@ 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 GetRdsUserSessionsCompletedEventHandler(object sender, GetRdsUserSessionsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetRdsUserSessionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetRdsUserSessionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public RdsUserSession[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((RdsUserSession[])(this.results[0])); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void AddRdsServersToDeploymentCompletedEventHandler(object sender, AddRdsServersToDeploymentCompletedEventArgs e); @@ -1628,4 +1749,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { } } } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void LogOffRdsUserCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs index 1dd8b6e6..796a6448 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs @@ -92,6 +92,24 @@ namespace WebsitePanel.Server } } + [WebMethod, SoapHeader("settings")] + public List GetRdsUserSessions(string collectionName) + { + try + { + Log.WriteStart("'{0}' GetRdsUserSessions", ProviderSettings.ProviderName); + var result = RDSProvider.GetRdsUserSessions(collectionName); + Log.WriteEnd("'{0}' GetRdsUserSessions", ProviderSettings.ProviderName); + + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetRdsUserSessions", ProviderSettings.ProviderName), ex); + throw; + } + } + [WebMethod, SoapHeader("settings")] public bool AddRdsServersToDeployment(RdsServer[] servers) { @@ -443,5 +461,21 @@ namespace WebsitePanel.Server throw; } } + + [WebMethod, SoapHeader("settings")] + public void LogOffRdsUser(string unifiedSessionId, string hostServer) + { + try + { + Log.WriteStart("'{0}' LogOffRdsUser", ProviderSettings.ProviderName); + RDSProvider.LogOffRdsUser(unifiedSessionId, hostServer); + Log.WriteEnd("'{0}' LogOffRdsUser", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' LogOffRdsUser", ProviderSettings.ProviderName), ex); + throw; + } + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config index 29dde726..beadb444 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config @@ -150,4 +150,5 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config index 885e8b53..80078941 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config @@ -581,6 +581,7 @@ + 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 3d851e29..9e50d93c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5641,4 +5641,10 @@ RDS Collection settings not updated + + RDS User logging off error + + + GEtting RDS User sessions error + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSUserSessions.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSUserSessions.ascx.resx new file mode 100644 index 00000000..53c766e3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSUserSessions.ascx.resx @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Host Server + + + No user sessions. + + + Session State + + + User Name + + + Edit RDS Collection + + + RDS User Sessions + + + RDS User Sessions + + + if(!confirm('Are you sure you want to log off user?')) return false; else ShowProgressDialog('Logging off user...'); + + + Log Off + + + Log Off + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx new file mode 100644 index 00000000..cb81c5b5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx @@ -0,0 +1,74 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RDSUserSessions.ascx.cs" Inherits="WebsitePanel.Portal.RDS.RDSUserSessions" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ Register Src="UserControls/RDSCollectionTabs.ascx" TagName="CollectionTabs" TagPrefix="wsp" %> +<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %> +<%@ Register Src="../UserControls/ItemButtonPanel.ascx" TagName="ItemButtonPanel" TagPrefix="wsp" %> + + + + +
+
+
+
+
+
+
+ + + - + +
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+
+
+
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.cs new file mode 100644 index 00000000..24873e88 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.cs @@ -0,0 +1,81 @@ +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 RDSUserSessions : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + buttonPanel.ButtonSaveVisible = false; + + if (!IsPostBack) + { + var collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID); + litCollectionName.Text = collection.Name; + BindGrid(); + } + } + + protected void gvRDSCollections_RowCommand(object sender, GridViewCommandEventArgs e) + { + if (e.CommandName == "LogOff") + { + var arguments = e.CommandArgument.ToString().Split(';'); + string unifiedSessionId = arguments[0]; + string hostServer = arguments[1]; + + try + { + ES.Services.RDS.LogOffRdsUser(PanelRequest.ItemID, unifiedSessionId, hostServer); + BindGrid(); + + } + catch (Exception ex) + { + ShowErrorMessage("REMOTE_DESKTOP_SERVICES_LOG_OFF_USER", ex); + } + } + } + + protected void btnSave_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + { + return; + } + } + + protected void btnSaveExit_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + { + return; + } + + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "rds_collections", "SpaceID=" + PanelSecurity.PackageId)); + } + + private void BindGrid() + { + var userSessions = new List(); + + try + { + userSessions = ES.Services.RDS.GetRdsUserSessions(PanelRequest.CollectionID).ToList(); + } + catch(Exception ex) + { + ShowErrorMessage("REMOTE_DESKTOP_SERVICES_USER_SESSIONS", ex); + } + + gvRDSUserSessions.DataSource = userSessions; + gvRDSUserSessions.DataBind(); + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.designer.cs new file mode 100644 index 00000000..9f276bcc --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.designer.cs @@ -0,0 +1,105 @@ +//------------------------------------------------------------------------------ +// +// 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 RDSUserSessions { + + /// + /// 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; + + /// + /// secRdsUserSessions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secRdsUserSessions; + + /// + /// panelRdsUserSessions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel panelRdsUserSessions; + + /// + /// gvRDSUserSessions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvRDSUserSessions; + + /// + /// 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/App_LocalResources/RDSCollectionTabs.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionTabs.ascx.resx index 288b1145..afb4730a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionTabs.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionTabs.ascx.resx @@ -129,4 +129,7 @@ Settings + + User Sessions + \ No newline at end of file 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 06dc8446..35aa06a7 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") %> @@ -19,4 +19,12 @@ -
\ No newline at end of file +
+ + \ No newline at end of file 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 7c99c275..00fab605 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 @@ -24,6 +24,7 @@ namespace WebsitePanel.Portal.RDS.UserControls 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")); + tabsList.Add(CreateTab("rds_collection_user_sessions", "Tab.UserSessions")); int idx = 0; 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 0156e3bd..046875ad 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -330,6 +330,13 @@ RDSCollections.ascx + + RDSUserSessions.ascx + ASPXCodeBehind + + + RDSUserSessions.ascx + RDSCollectionApps.ascx ASPXCodeBehind @@ -4365,6 +4372,7 @@ + @@ -4386,6 +4394,7 @@ Designer + ResXFileCodeGenerator DomainLookupView.ascx.Designer.cs @@ -5702,7 +5711,9 @@ Designer - + + Designer + From ee828f281c5ec56a913871da33d8cac8f748441b Mon Sep 17 00:00:00 2001 From: Olov Karlsson Date: Thu, 29 Jan 2015 15:09:19 +0100 Subject: [PATCH 03/22] Fix for maxmailboxsize in IceWarp provider --- .../Sources/WebsitePanel.Providers.Mail.IceWarp/IceWarp.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Mail.IceWarp/IceWarp.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Mail.IceWarp/IceWarp.cs index f0538c23..caafd49c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Mail.IceWarp/IceWarp.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Mail.IceWarp/IceWarp.cs @@ -836,7 +836,7 @@ namespace WebsitePanel.Providers.Mail Enabled = Convert.ToInt32((object) accountObject.GetProperty("U_AccountDisabled")) == 0, ForwardingEnabled = !string.IsNullOrWhiteSpace(accountObject.GetProperty("U_ForwardTo")) || string.IsNullOrWhiteSpace(accountObject.GetProperty("U_RemoteAddress")) && Convert.ToBoolean((object) accountObject.GetProperty("U_UseRemoteAddress")), IsDomainAdmin = Convert.ToBoolean((object) accountObject.GetProperty("U_DomainAdmin")), - MaxMailboxSize = Convert.ToInt32((object) accountObject.GetProperty("U_MaxBoxSize"))/1024, + MaxMailboxSize = Convert.ToBoolean((object) accountObject.GetProperty("U_MaxBox")) ? Convert.ToInt32((object) accountObject.GetProperty("U_MaxBoxSize"))/1024 : 0, Password = accountObject.GetProperty("U_Password"), ResponderEnabled = Convert.ToInt32((object) accountObject.GetProperty("U_Respond")) > 0, QuotaUsed = Convert.ToInt64((object) accountObject.GetProperty("U_MailBoxSize")), @@ -923,7 +923,8 @@ namespace WebsitePanel.Providers.Mail accountObject.SetProperty("U_AccountDisabled", mailbox.IceWarpAccountState); accountObject.SetProperty("U_DomainAdmin", mailbox.IsDomainAdmin); accountObject.SetProperty("U_Password", mailbox.Password); - accountObject.SetProperty("U_MaxBoxSize", mailbox.MaxMailboxSize); + accountObject.SetProperty("U_MaxBoxSize", mailbox.MaxMailboxSize*1024); + accountObject.SetProperty("U_MaxBox", mailbox.MaxMailboxSize > 0 ? "1" : "0"); accountObject.SetProperty("U_MaxMessageSize", mailbox.MaxMessageSizeMegaByte*1024); accountObject.SetProperty("U_MegabyteSendLimit", mailbox.MegaByteSendLimit); accountObject.SetProperty("U_NumberSendLimit", mailbox.NumberSendLimit); From 4ad2f25056a0a0810d1a60e16f74ef86a818d77f Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 29 Jan 2015 12:22:35 -0500 Subject: [PATCH 04/22] Added tag build-2.1.0.548 for changeset 108a63cfa336 From 8cc58b79842b578b985d8ffcddb8de4b7bbef771 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 29 Jan 2015 19:54:43 -0500 Subject: [PATCH 05/22] Testing issue with installer --- .../Sources/Setup.SchedulerService/Product.wxs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel.Installer/Sources/Setup.SchedulerService/Product.wxs b/WebsitePanel.Installer/Sources/Setup.SchedulerService/Product.wxs index 42e79b27..60a0c1bc 100644 --- a/WebsitePanel.Installer/Sources/Setup.SchedulerService/Product.wxs +++ b/WebsitePanel.Installer/Sources/Setup.SchedulerService/Product.wxs @@ -103,7 +103,7 @@ LicenseAccepted = "1" - SKIPCONNECTIONSTRINGSTEP = "0" + SKIPCONNECTIONSTRINGSTEP = "1" SKIPCONNECTIONSTRINGSTEP = "1" From 5cd5c947f06596c3a174d91e9f18699c1e20caa3 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 29 Jan 2015 20:05:59 -0500 Subject: [PATCH 06/22] Added tag build-2.1.0.549 for changeset 1e0b459745da From 68375df8fc4d1e3d0c025fd7a9b85e14aecf03e6 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Fri, 30 Jan 2015 00:32:12 -0800 Subject: [PATCH 07/22] Full desktop connection icon --- .../RemoteDesktopServicesController.cs | 5 ++++ .../RemoteApplication.cs | 1 + .../Windows2012.cs | 9 ++++++ .../RDSCollectionApps.ascx.resx | 3 ++ .../RDS/UserControls/RDSCollectionApps.ascx | 2 ++ .../UserControls/RDSCollectionApps.ascx.cs | 28 +++++++++++++++++-- .../RDSCollectionApps.ascx.designer.cs | 9 ++++++ 7 files changed, 54 insertions(+), 3 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs index 87ea9dac..8a9f9136 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs @@ -1300,6 +1300,11 @@ namespace WebsitePanel.EnterpriseServer List remoteAppsToAdd = remoteApps.Where(x => !existingCollectionApps.Select(p => p.DisplayName).Contains(x.DisplayName)).ToList(); foreach (var app in remoteAppsToAdd) { + if (!string.IsNullOrEmpty(app.RequiredCommandLine)) + { + app.RequiredCommandLine = string.Format("/v:{0}", collection.Servers.First().FqdName); + } + AddRemoteApplicationToCollection(itemId, collection, app); } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RemoteApplication.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RemoteApplication.cs index f15a5fe1..300f8b47 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RemoteApplication.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RemoteApplication.cs @@ -35,5 +35,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices public string FilePath { get; set; } public string FileVirtualPath { get; set; } public bool ShowInWebAccess { get; set; } + public string RequiredCommandLine { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index 508b691c..a7380569 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -742,6 +742,12 @@ namespace WebsitePanel.Providers.RemoteDesktopServices cmd.Parameters.Add("FilePath", remoteApp.FilePath); cmd.Parameters.Add("ShowInWebAccess", remoteApp.ShowInWebAccess); + if (!string.IsNullOrEmpty(remoteApp.RequiredCommandLine)) + { + cmd.Parameters.Add("CommandLineSetting", "Require"); + cmd.Parameters.Add("RequiredCommandLine", remoteApp.RequiredCommandLine); + } + ExecuteShellCommand(runSpace, cmd, false); result = true; @@ -1157,6 +1163,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices ShowInWebAccess = Convert.ToBoolean(GetPSObjectProperty(psObject, "ShowInWebAccess")) }; + var requiredCommandLine = GetPSObjectProperty(psObject, "RequiredCommandLine"); + remoteApp.RequiredCommandLine = requiredCommandLine == null ? null : requiredCommandLine.ToString(); + return remoteApp; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionApps.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionApps.ascx.resx index 0adb8a73..85e03fdd 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionApps.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionApps.ascx.resx @@ -138,6 +138,9 @@ Delete + + Add Full Desktop Connection + Remote Application Name diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx index ecae4947..386d3a51 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx @@ -6,6 +6,7 @@
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs index 2bcf719d..defa1be5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs @@ -50,7 +50,7 @@ namespace WebsitePanel.Portal.RDS.UserControls } public void SetApps(RemoteApplication[] apps) - { + { BindApps(apps, false); } @@ -104,9 +104,25 @@ namespace WebsitePanel.Portal.RDS.UserControls List selectedApps = GetPopUpGridViewApps(); BindApps(selectedApps.ToArray(), true); - } + protected void btnFullDesktopConnection_Click(object sender, EventArgs e) + { + var newApps = new RemoteApplication[] + { + new RemoteApplication + { + DisplayName = "Session Host", + FilePath = "%SystemRoot%\\system32\\mstsc.exe", + Alias = "mstsc", + RequiredCommandLine = "/v:", + ShowInWebAccess = true + } + }; + + BindApps(newApps, true); + } + protected void BindPopupApps() { RdsCollection collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID); @@ -127,7 +143,7 @@ namespace WebsitePanel.Portal.RDS.UserControls } protected void BindApps(RemoteApplication[] newApps, bool preserveExisting) - { + { // get binded addresses List apps = new List(); if(preserveExisting) @@ -156,6 +172,11 @@ namespace WebsitePanel.Portal.RDS.UserControls } } + if (apps.Any(a => a.DisplayName.Equals("session host", StringComparison.CurrentCultureIgnoreCase))) + { + btnFullDesktopConnection.Enabled = false; + } + gvApps.DataSource = apps; gvApps.DataBind(); } @@ -174,6 +195,7 @@ namespace WebsitePanel.Portal.RDS.UserControls app.Alias = (string)gvApps.DataKeys[i][0]; app.DisplayName = ((Literal)row.FindControl("litDisplayName")).Text; app.FilePath = ((HiddenField)row.FindControl("hfFilePath")).Value; + app.RequiredCommandLine = ((HiddenField)row.FindControl("hfRequiredCommandLine")).Value; if (state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.designer.cs index 6c195540..7e892653 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.designer.cs @@ -39,6 +39,15 @@ namespace WebsitePanel.Portal.RDS.UserControls { /// protected global::System.Web.UI.WebControls.Button btnDelete; + /// + /// btnFullDesktopConnection control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnFullDesktopConnection; + /// /// gvApps control. /// From 1567ef9f15afed6499f7d2063f3e3896ebf02241 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Fri, 30 Jan 2015 00:33:50 -0800 Subject: [PATCH 08/22] Full desktop connection icon --- .../WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs index defa1be5..59402625 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs @@ -176,6 +176,10 @@ namespace WebsitePanel.Portal.RDS.UserControls { btnFullDesktopConnection.Enabled = false; } + else + { + btnFullDesktopConnection.Enabled = true; + } gvApps.DataSource = apps; gvApps.DataBind(); From 880c24168318ba18c92e1c489405af0f996ebbce Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Fri, 30 Jan 2015 16:28:04 +0700 Subject: [PATCH 09/22] fix comments of wsp-10299 Web Publishing not created in IIS 8.5 --- .../WebServers/WebServerController.cs | 17 +++++++++++++++++ .../WebsitePanel.Providers.Web.IIS70/IIs70.cs | 3 +++ 2 files changed, 20 insertions(+) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebServers/WebServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebServers/WebServerController.cs index 98f22ef1..266fdf3c 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebServers/WebServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebServers/WebServerController.cs @@ -3633,6 +3633,17 @@ namespace WebsitePanel.EnterpriseServer WebServer server = GetWebServer(item.ServiceId); // server.RevokeWebManagementAccess(item.SiteId, accountName); + + // Cleanup web site properties if the web management and web deploy user are the same + if (GetNonQualifiedAccountName(accountName) == item.WebDeployPublishingAccount) + { + item.WebDeployPublishingAccount = String.Empty; + item.WebDeploySitePublishingEnabled = false; + item.WebDeploySitePublishingProfile = String.Empty; + item.WebDeployPublishingPassword = String.Empty; + // Put changes into effect + PackageController.UpdatePackageItem(item); + } } catch (Exception ex) { @@ -3644,6 +3655,12 @@ namespace WebsitePanel.EnterpriseServer } } + protected static string GetNonQualifiedAccountName(string accountName) + { + int idx = accountName.LastIndexOf("\\"); + return (idx != -1) ? accountName.Substring(idx + 1) : accountName; + } + public static ResultObject ChangeWebManagementAccessPassword(int siteItemId, string accountPassword) { ResultObject result = new ResultObject { IsSuccess = true }; diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs index 163eb5c9..a4d5eff2 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs @@ -4133,6 +4133,9 @@ namespace WebsitePanel.Providers.Web // Restore setting back ServerSettings.ADEnabled = adEnabled; } + + // + RemoveDelegationRulesRestrictions(siteName, accountName); } private void ReadWebDeployPublishingAccessDetails(WebVirtualDirectory iisObject) From ac1f647ecd1c2dd3de160514bf9ef791aa724bb2 Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Fri, 30 Jan 2015 16:43:20 +0700 Subject: [PATCH 10/22] fix2 comments of wsp-10299 Web Publishing not created in IIS 8.5 --- .../DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs index be04563f..125c354c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs @@ -546,7 +546,7 @@ namespace WebsitePanel.Portal WDeployPublishingConfirmPasswordTextBox, WDeployPublishingAccountRequiredFieldValidator); - WDeployPublishingAccountTextBox.Text = AutoSuggestWmSvcAccontName(item, "_deploy"); + WDeployPublishingAccountTextBox.Text = AutoSuggestWmSvcAccontName(item, "_dploy"); // WDeployPublishingAccountRequiredFieldValidator.Enabled = true; // From a985049dcd3f42cfd5966a6c6639936dd627a2e8 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Fri, 30 Jan 2015 08:19:02 -0500 Subject: [PATCH 11/22] Backed out changeset: 1e0b459745da --- .../Sources/Setup.SchedulerService/Product.wxs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel.Installer/Sources/Setup.SchedulerService/Product.wxs b/WebsitePanel.Installer/Sources/Setup.SchedulerService/Product.wxs index 60a0c1bc..42e79b27 100644 --- a/WebsitePanel.Installer/Sources/Setup.SchedulerService/Product.wxs +++ b/WebsitePanel.Installer/Sources/Setup.SchedulerService/Product.wxs @@ -103,7 +103,7 @@ LicenseAccepted = "1" - SKIPCONNECTIONSTRINGSTEP = "1" + SKIPCONNECTIONSTRINGSTEP = "0" SKIPCONNECTIONSTRINGSTEP = "1" From 863ae2f6ef02c1732245e6d90e1b5867e9d16bab Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Fri, 30 Jan 2015 16:21:52 +0300 Subject: [PATCH 12/22] scheduler installer fix --- .../Sources/Setup.SchedulerService/Product.wxs | 2 +- .../WebsitePanel.SchedulerServiceInstaller/CustomAction.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/WebsitePanel.Installer/Sources/Setup.SchedulerService/Product.wxs b/WebsitePanel.Installer/Sources/Setup.SchedulerService/Product.wxs index 60a0c1bc..42e79b27 100644 --- a/WebsitePanel.Installer/Sources/Setup.SchedulerService/Product.wxs +++ b/WebsitePanel.Installer/Sources/Setup.SchedulerService/Product.wxs @@ -103,7 +103,7 @@ LicenseAccepted = "1" - SKIPCONNECTIONSTRINGSTEP = "1" + SKIPCONNECTIONSTRINGSTEP = "0" SKIPCONNECTIONSTRINGSTEP = "1" diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.SchedulerServiceInstaller/CustomAction.cs b/WebsitePanel.Installer/Sources/WebsitePanel.SchedulerServiceInstaller/CustomAction.cs index 01549e05..99e36879 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.SchedulerServiceInstaller/CustomAction.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.SchedulerServiceInstaller/CustomAction.cs @@ -53,6 +53,8 @@ namespace WebsitePanel.SchedulerServiceInstaller { string testConnectionString = session["AUTHENTICATIONTYPE"].Equals("Windows Authentication") ? GetConnectionString(session["SERVERNAME"], "master") : GetConnectionString(session["SERVERNAME"], "master", session["LOGIN"], session["PASSWORD"]); + testConnectionString = testConnectionString.Replace(CustomDataDelimiter, ";"); + if (CheckConnection(testConnectionString)) { session["CORRECTCONNECTION"] = "1"; From b181614baa1a8c1aee59d1880845d3f2653c6d16 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Fri, 30 Jan 2015 08:26:57 -0500 Subject: [PATCH 13/22] Added tag build-2.1.0.550 for changeset e39aeb51595b From d063e2ce2dfa56569e83f983bbeaa13e77046268 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Fri, 30 Jan 2015 06:43:13 -0800 Subject: [PATCH 14/22] UI changes --- .../RemoteDesktopServices/RdsUserSession.cs | 1 + .../RemoteDesktopServices/StartMenuApp.cs | 1 + .../Windows2012.cs | 4 +- .../RDSUserSessions.ascx.resx | 3 + .../WebsitePanel/RDS/RDSUserSessions.ascx | 97 ++++++++++--------- .../WebsitePanel/RDS/RDSUserSessions.ascx.cs | 30 +++++- .../RDS/RDSUserSessions.ascx.designer.cs | 18 ++++ .../RDSCollectionApps.ascx.resx | 3 - .../RDS/UserControls/RDSCollectionApps.ascx | 4 +- .../UserControls/RDSCollectionApps.ascx.cs | 64 ++++++------ .../RDSCollectionApps.ascx.designer.cs | 9 -- .../RDS/UserControls/RDSCollectionUsers.ascx | 6 +- 12 files changed, 139 insertions(+), 101 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsUserSession.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsUserSession.cs index 8b03a51b..8c3e9729 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsUserSession.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsUserSession.cs @@ -12,5 +12,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices public string UnifiedSessionId { get; set; } public string SessionState { get; set; } public string HostServer { get; set; } + public string DomainName { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/StartMenuApp.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/StartMenuApp.cs index b6195e49..afdee244 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/StartMenuApp.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/StartMenuApp.cs @@ -33,5 +33,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices public string DisplayName { get; set; } public string FilePath { get; set; } public string FileVirtualPath { get; set; } + public string RequiredCommandLine { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index a7380569..15cadff0 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -1738,9 +1738,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices Command cmd = new Command("Get-RDUserSession"); cmd.Parameters.Add("CollectionName", collectionName); cmd.Parameters.Add("ConnectionBroker", ConnectionBroker); - var userSessions = ExecuteShellCommand(runSpace, cmd, false, out errors); - - //var userSessions = ExecuteShellCommand(runSpace, scripts, out errors); + var userSessions = ExecuteShellCommand(runSpace, cmd, false, out errors); var properties = typeof(RdsUserSession).GetProperties(); foreach(var userSession in userSessions) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSUserSessions.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSUserSessions.ascx.resx index 53c766e3..e8f7f85d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSUserSessions.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSUserSessions.ascx.resx @@ -147,4 +147,7 @@ Log Off + + Refresh + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx index cb81c5b5..33aab7ff 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx @@ -22,51 +22,58 @@
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- -
+ + + +
+
+ +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.cs index 24873e88..79e37ea8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.cs @@ -1,4 +1,5 @@ -using System; +using AjaxControlToolkit; +using System; using System.Collections.Generic; using System.Linq; using System.Web; @@ -17,7 +18,7 @@ namespace WebsitePanel.Portal.RDS if (!IsPostBack) { var collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID); - litCollectionName.Text = collection.Name; + litCollectionName.Text = collection.DisplayName; BindGrid(); } } @@ -34,7 +35,7 @@ namespace WebsitePanel.Portal.RDS { ES.Services.RDS.LogOffRdsUser(PanelRequest.ItemID, unifiedSessionId, hostServer); BindGrid(); - + ((ModalPopupExtender)asyncTasks.FindControl("ModalPopupProperties")).Hide(); } catch (Exception ex) { @@ -49,6 +50,8 @@ namespace WebsitePanel.Portal.RDS { return; } + + BindGrid(); } protected void btnSaveExit_Click(object sender, EventArgs e) @@ -61,6 +64,17 @@ namespace WebsitePanel.Portal.RDS Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "rds_collections", "SpaceID=" + PanelSecurity.PackageId)); } + protected void btnRefresh_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + { + return; + } + + BindGrid(); + ((ModalPopupExtender)asyncTasks.FindControl("ModalPopupProperties")).Hide(); + } + private void BindGrid() { var userSessions = new List(); @@ -74,6 +88,16 @@ namespace WebsitePanel.Portal.RDS ShowErrorMessage("REMOTE_DESKTOP_SERVICES_USER_SESSIONS", ex); } + foreach(var userSession in userSessions) + { + var states = userSession.SessionState.Split('_'); + + if (states.Length == 2) + { + userSession.SessionState = states[1]; + } + } + gvRDSUserSessions.DataSource = userSessions; gvRDSUserSessions.DataBind(); } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.designer.cs index 9f276bcc..e9944d67 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.designer.cs @@ -66,6 +66,24 @@ namespace WebsitePanel.Portal.RDS { /// protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + /// + /// RDAppsUpdatePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel RDAppsUpdatePanel; + + /// + /// btnRefresh control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnRefresh; + /// /// secRdsUserSessions control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionApps.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionApps.ascx.resx index 85e03fdd..0adb8a73 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionApps.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionApps.ascx.resx @@ -138,9 +138,6 @@ Delete - - Add Full Desktop Connection - Remote Application Name diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx index 386d3a51..088d5153 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx @@ -5,8 +5,7 @@
- - +
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs index 59402625..403eea17 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs @@ -104,39 +104,45 @@ namespace WebsitePanel.Portal.RDS.UserControls List selectedApps = GetPopUpGridViewApps(); BindApps(selectedApps.ToArray(), true); - } - - protected void btnFullDesktopConnection_Click(object sender, EventArgs e) - { - var newApps = new RemoteApplication[] - { - new RemoteApplication - { - DisplayName = "Session Host", - FilePath = "%SystemRoot%\\system32\\mstsc.exe", - Alias = "mstsc", - RequiredCommandLine = "/v:", - ShowInWebAccess = true - } - }; - - BindApps(newApps, true); - } + } protected void BindPopupApps() { RdsCollection collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID); - StartMenuApp[] apps = ES.Services.RDS.GetAvailableRemoteApplications(PanelRequest.ItemID, collection.Name); + List apps = ES.Services.RDS.GetAvailableRemoteApplications(PanelRequest.ItemID, collection.Name).ToList(); + + var fullRemote = new StartMenuApp + { + DisplayName = "Session Host", + FilePath = "%SystemRoot%\\system32\\mstsc.exe", + RequiredCommandLine = string.Format("/v:{0}", collection.Servers.First().FqdName) + }; + + var displayNames = GetApps().Select(p => p.DisplayName); + apps = apps.Where(x => !displayNames.Contains(x.DisplayName)).ToList(); - apps = apps.Where(x => !GetApps().Select(p => p.DisplayName).Contains(x.DisplayName)).ToArray(); - Array.Sort(apps, CompareAccount); if (Direction == SortDirection.Ascending) { - Array.Reverse(apps); + apps = apps.OrderBy(a => a.DisplayName).ToList(); Direction = SortDirection.Descending; } else + { + apps = apps.OrderByDescending(a => a.DisplayName).ToList(); Direction = SortDirection.Ascending; + } + + if (!displayNames.Contains(fullRemote.DisplayName)) + { + if (apps.Count > 0) + { + apps.Insert(0, fullRemote); + } + else + { + apps.Add(fullRemote); + } + } gvPopupApps.DataSource = apps; gvPopupApps.DataBind(); @@ -170,16 +176,7 @@ namespace WebsitePanel.Portal.RDS.UserControls apps.Add(newApp); } - } - - if (apps.Any(a => a.DisplayName.Equals("session host", StringComparison.CurrentCultureIgnoreCase))) - { - btnFullDesktopConnection.Enabled = false; - } - else - { - btnFullDesktopConnection.Enabled = true; - } + } gvApps.DataSource = apps; gvApps.DataBind(); @@ -226,7 +223,8 @@ namespace WebsitePanel.Portal.RDS.UserControls { Alias = (string)gvPopupApps.DataKeys[i][0], DisplayName = ((Literal)row.FindControl("litName")).Text, - FilePath = ((HiddenField)row.FindControl("hfFilePathPopup")).Value + FilePath = ((HiddenField)row.FindControl("hfFilePathPopup")).Value, + RequiredCommandLine = ((HiddenField)row.FindControl("hfRequiredCommandLinePopup")).Value }); } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.designer.cs index 7e892653..6c195540 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.designer.cs @@ -39,15 +39,6 @@ namespace WebsitePanel.Portal.RDS.UserControls { /// protected global::System.Web.UI.WebControls.Button btnDelete; - /// - /// btnFullDesktopConnection control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button btnFullDesktopConnection; - /// /// gvApps control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx index b2dc9efc..8f2bbf36 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx @@ -21,7 +21,7 @@ - + @@ -75,14 +75,14 @@ - + - + From 50ac084abe7f8a142c3edcbb4521994ac2982347 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Fri, 30 Jan 2015 14:23:14 -0500 Subject: [PATCH 15/22] Added tag build-2.1.0.551 for changeset 36c0570876ce From cb6a7e5127d97669ff8d8148320e25d8770690f3 Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Sun, 1 Feb 2015 00:34:00 +0700 Subject: [PATCH 16/22] additional fix for wsp-10300 Default Global Mailbox Plan --- .../SettingsExchangeMailboxPlansPolicy.ascx.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs index 67fdd3fe..21988009 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs @@ -109,12 +109,9 @@ namespace WebsitePanel.Portal gvMailboxPlans.DataBind(); } - //check if organization has only one default domain or less - if (gvMailboxPlans.Rows.Count <= 1) - { - btnSetDefaultMailboxPlan.Enabled = false; - } - + // enable set default plan button if organization has two or more plans + btnSetDefaultMailboxPlan.Enabled = gvMailboxPlans.Rows.Count > 1; + btnUpdateMailboxPlan.Enabled = (string.IsNullOrEmpty(txtMailboxPlan.Text)) ? false : true; } From 7626731689abf25fc201d121b337e722fe5e742a Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sat, 31 Jan 2015 16:22:52 -0500 Subject: [PATCH 17/22] Added tag build-2.1.0.552 for changeset 244364877856 From bef5e63cb56af7c8b317c1010bb05e2b866baa6d Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sat, 31 Jan 2015 22:28:19 -0500 Subject: [PATCH 18/22] Added tag build-2.1.0.553 for changeset b256116ed0b1 From 5e20b8543877d8cb0d19e3053d69940808b1d874 Mon Sep 17 00:00:00 2001 From: Olov Karlsson Date: Sun, 1 Feb 2015 17:52:27 +0100 Subject: [PATCH 19/22] Fix for cannot add virtual directory --- WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs index a4d5eff2..4ecb9320 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs @@ -881,7 +881,7 @@ namespace WebsitePanel.Providers.Web #endregion #region PHP 5 script mappings - if (virtualDir.PhpInstalled.StartsWith(PHP_5)) + if (!string.IsNullOrEmpty(virtualDir.PhpInstalled) && virtualDir.PhpInstalled.StartsWith(PHP_5)) { if (PhpMode == Constants.PhpMode.FastCGI && virtualDir.PhpInstalled.Contains('|')) { From 069a9f70c740636d7371ecfe32f37fcc96b76f9a Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sun, 1 Feb 2015 12:25:30 -0500 Subject: [PATCH 20/22] Added tag build-2.1.0.554 for changeset da513cfcf110 From 1cf8b9bb7f4090e50df73805d6d37d4e61a37c2b Mon Sep 17 00:00:00 2001 From: Olov Karlsson Date: Sun, 1 Feb 2015 21:13:25 +0100 Subject: [PATCH 21/22] Fix for not deleting secondary DNS service items when deleting domain --- .../DnsServers/DnsServerController.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/DnsServers/DnsServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/DnsServers/DnsServerController.cs index 039c3473..d659f9aa 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/DnsServers/DnsServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/DnsServers/DnsServerController.cs @@ -272,6 +272,14 @@ namespace WebsitePanel.EnterpriseServer // delete service item PackageController.DeletePackageItem(zoneItemId); + + // Delete also all seconday service items + var zoneItems = PackageController.GetPackageItemsByType(zoneItem.PackageId, ResourceGroups.Dns, typeof (SecondaryDnsZone)); + + foreach (var item in zoneItems.Where(z => z.Name == zoneItem.Name)) + { + PackageController.DeletePackageItem(item.Id); + } } catch (Exception ex) { From a23bcc4efa5d19f2db0091dd5ef43c4210d49880 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sun, 1 Feb 2015 16:39:51 -0500 Subject: [PATCH 22/22] Added tag build-2.1.0.555 for changeset f8e1a7e89c9c