From 2726090c4f8187c2e8e5099edbb0b035d2e7d79c Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Tue, 10 Feb 2015 06:41:00 -0800 Subject: [PATCH 1/6] Fix for Remote Application users --- .../RemoteDesktopServicesController.cs | 12 ++++++------ .../Windows2012.cs | 8 +++----- .../WebsitePanel/RDS/RDSEditApplicationUsers.ascx.cs | 4 ++-- .../RDS/UserControls/RDSCollectionUsers.ascx | 2 ++ .../RDS/UserControls/RDSCollectionUsers.ascx.cs | 4 +++- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs index 8d31d923..b9e2884f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs @@ -1055,15 +1055,15 @@ namespace WebsitePanel.EnterpriseServer var usersInDb = GetRdsCollectionUsers(collectionId); - var usersAccountNames = users.Select(x => x.AccountName).ToList(); + var accountNames = users.Select(x => x.AccountName).ToList(); //Set on server - rds.SetUsersInCollection(org.OrganizationId, collection.Name, users.Select(x => x.AccountName).ToArray()); + rds.SetUsersInCollection(org.OrganizationId, collection.Name, users.Select(x => x.SamAccountName).ToArray()); //Remove from db foreach (var userInDb in usersInDb) { - if (!usersAccountNames.Contains(userInDb.AccountName)) + if (!accountNames.Contains(userInDb.AccountName)) { DataProvider.RemoveRDSUserFromRDSCollection(collectionId, userInDb.AccountId); } @@ -1109,9 +1109,9 @@ namespace WebsitePanel.EnterpriseServer } var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); - var collection = GetRdsCollection(collectionId); - - result.AddRange(rds.GetApplicationUsers(collection.Name, remoteApp.Alias)); + var collection = ObjectUtils.FillObjectFromDataReader(DataProvider.GetRDSCollectionById(collectionId)); + var users = rds.GetApplicationUsers(collection.Name, remoteApp.Alias); + result.AddRange(users); return result; } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index 2a0bd0c7..2c892a1a 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -986,13 +986,11 @@ namespace WebsitePanel.Providers.RemoteDesktopServices //adding users to group foreach (var user in users) { - var userPath = GetUserPath(organizationId, user); + var samName = user.Split('\\').Last(); + var userPath = GetUserPath(organizationId, samName); if (ActiveDirectoryUtils.AdObjectExists(userPath)) - { - var userObject = ActiveDirectoryUtils.GetADObject(userPath); - var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(userObject, "sAMAccountName"); - + { if (!ActiveDirectoryUtils.IsUserInGroup(samName, usersGroupName)) { ActiveDirectoryUtils.AddObjectToGroup(userPath, GetUsersGroupPath(organizationId, collectionName)); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditApplicationUsers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditApplicationUsers.ascx.cs index 6190b880..eaa2d42f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditApplicationUsers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditApplicationUsers.ascx.cs @@ -50,7 +50,7 @@ namespace WebsitePanel.Portal.RDS litCollectionName.Text = collection.Name; txtApplicationName.Text = remoteApp.DisplayName; - var remoteAppUsers = organizationUsers.Where(x => applicationUsers.Contains(x.DomainUserName)); + var remoteAppUsers = organizationUsers.Where(x => applicationUsers.Select(a => a.Split('\\').Last().ToLower()).Contains(x.SamAccountName.Split('\\').Last().ToLower())); users.SetUsers(remoteAppUsers.ToArray()); } @@ -64,7 +64,7 @@ namespace WebsitePanel.Portal.RDS var applications = ES.Services.RDS.GetCollectionRemoteApplications(PanelRequest.ItemID, collection.Name); var remoteApp = applications.Where(x => x.Alias.Equals(PanelRequest.ApplicationID, StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault(); remoteApp.DisplayName = txtApplicationName.Text; - ES.Services.RDS.SetApplicationUsers(PanelRequest.ItemID, PanelRequest.CollectionID, remoteApp, users.GetUsers().Select(x => x.AccountName).ToArray()); + ES.Services.RDS.SetApplicationUsers(PanelRequest.ItemID, PanelRequest.CollectionID, remoteApp, users.GetUsers().Select(x => x.SamAccountName.Split('\\').Last()).ToArray()); } catch (Exception ex) { 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 8f2bbf36..4ba1e5c0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx @@ -25,6 +25,7 @@ + @@ -79,6 +80,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx.cs index 1ba8cefc..fdd2e6ce 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx.cs @@ -194,6 +194,7 @@ namespace WebsitePanel.Portal.RDS.UserControls OrganizationUser user = new OrganizationUser(); user.AccountName = (string)gvUsers.DataKeys[i][0]; user.DisplayName = ((Literal)row.FindControl("litAccount")).Text; + user.SamAccountName = ((HiddenField)row.FindControl("hdnSamAccountName")).Value; if (state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || @@ -219,7 +220,8 @@ namespace WebsitePanel.Portal.RDS.UserControls accounts.Add(new OrganizationUser { AccountName = (string)gvPopupAccounts.DataKeys[i][0], - DisplayName = ((Literal)row.FindControl("litDisplayName")).Text + DisplayName = ((Literal)row.FindControl("litDisplayName")).Text, + SamAccountName = ((HiddenField)row.FindControl("hdnSamName")).Value }); } } From ad2272c77f13bbbbcaf3dde2fe6b148d1c3d84d1 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 10 Feb 2015 17:37:01 -0500 Subject: [PATCH 2/6] Added tag build-2.1.0.574 for changeset 1a395981591d From a37a128bed17264bc8a080aa15a5124d4866a3cd Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 10 Feb 2015 18:14:33 -0500 Subject: [PATCH 3/6] Delete Extra Files --- .../Web.config.orig | 63 ------------------- .../WebsitePanel.WebPortal/Web.config.orig | 55 ---------------- 2 files changed, 118 deletions(-) delete mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config.orig delete mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/Web.config.orig diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config.orig b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config.orig deleted file mode 100644 index 9b0b5c9c..00000000 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config.orig +++ /dev/null @@ -1,63 +0,0 @@ - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/Web.config.orig b/WebsitePanel/Sources/WebsitePanel.WebPortal/Web.config.orig deleted file mode 100644 index 20d32caf..00000000 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/Web.config.orig +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From a5f62f2df0717edfab7a61441bbfc9a4c1505d0f Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 10 Feb 2015 18:27:44 -0500 Subject: [PATCH 4/6] Added tag build-2.1.0.575 for changeset 193ae3cdc974 From bccc3c25a78013eb99f25d9481635e9a426ab6f3 Mon Sep 17 00:00:00 2001 From: dev_amdtel Date: Wed, 11 Feb 2015 05:24:29 +0400 Subject: [PATCH 5/6] added project FixDefaultPublicFolderMailbox to build.xml --- WebsitePanel/build.xml | 59 +++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/WebsitePanel/build.xml b/WebsitePanel/build.xml index cf20fd3a..886973e5 100644 --- a/WebsitePanel/build.xml +++ b/WebsitePanel/build.xml @@ -37,8 +37,9 @@ $(TrunkFolder)\Sources\Tools\WebsitePanel.Import.Enterprise\bin\$(BuildConfiguration) $(TrunkFolder)\Sources\Tools\WebsitePanel.AWStats.Viewer $(TrunkFolder)\Sources\Tools\WSPTransportAgent + $(TrunkFolder)\Sources\Tools\WebsitePanel.FixDefaultPublicFolderMailbox\bin\$(BuildConfiguration) - $(BuildFolder)\Server + $(BuildFolder)\Server $(BuildFolder)\EnterpriseServer $(BuildFolder)\SchedulerService $(BuildFolder)\Portal @@ -51,8 +52,9 @@ $(BuildFolder)\WSPTransportAgent $(BuildFolder)\LocalizationToolkit $(BuildFolder)\Installer + $(BuildFolder)\FixDefaultPublicFolderMailbox - + @@ -61,7 +63,8 @@ - + + @@ -92,7 +95,8 @@ - + + @@ -110,8 +114,9 @@ + - + @@ -125,7 +130,8 @@ - + + @@ -345,8 +351,17 @@ - - + + + + + + + + + + + @@ -368,8 +383,9 @@ $(ToolsFolder)\Import.Enterprise $(ToolsFolder)\AWStats.Viewer $(ToolsFolder)\WSPTransportAgent - - + $(ToolsFolder)\FixDefaultPublicFolderMailbox + + @@ -492,9 +508,20 @@ - + - + + + + + + + + + + + + $(DeployFolder)\Update $(UpdateFolder)\Server @@ -502,7 +529,7 @@ $(UpdateFolder)\Portal - + @@ -697,6 +724,7 @@ + @@ -786,12 +814,13 @@ - + - + + From 0236f46bfdcadee03e735c14a3665b0a00e90ed9 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 10 Feb 2015 20:40:19 -0500 Subject: [PATCH 6/6] Added tag build-2.1.0.576 for changeset 00fed796adb4