From 5717d66fb2a61c9f95ac8265c30b9c0bd55e9cdd Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 2 Sep 2012 07:34:08 +0400 Subject: [PATCH 1/4] Fixed: Exchange and Lync plans not listed properly with multiple hosted organizations. Plans now listed with hosted organizations they belong to --- .../ExchangeServerController.cs | 18 ++++++++++---- .../Code/HostedSolution/LyncController.cs | 24 ++++++++++--------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs index 5ea1853a..37b6c2ec 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs @@ -2537,7 +2537,10 @@ namespace WebsitePanel.EnterpriseServer UserInfo user = ObjectUtils.FillObjectFromDataReader(DataProvider.GetUserByExchangeOrganizationIdInternally(itemId)); - ExchangeServerController.GetExchangeMailboxPlansByUser(user, ref mailboxPlans); + if (user.Role == UserRole.User) + ExchangeServerController.GetExchangeMailboxPlansByUser(itemId, user, ref mailboxPlans); + else + ExchangeServerController.GetExchangeMailboxPlansByUser(0, user, ref mailboxPlans); return mailboxPlans; } @@ -2551,7 +2554,7 @@ namespace WebsitePanel.EnterpriseServer } } - private static void GetExchangeMailboxPlansByUser(UserInfo user, ref ListmailboxPlans) + private static void GetExchangeMailboxPlansByUser(int itemId, UserInfo user, ref ListmailboxPlans) { if ((user != null)) { @@ -2571,9 +2574,14 @@ namespace WebsitePanel.EnterpriseServer orgs = GetExchangeOrganizationsInternal(1, false); } - if ((orgs != null) &(orgs.Count > 0)) + int OrgId = -1; + if (itemId > 0) OrgId = itemId; + else if ((orgs != null) & (orgs.Count > 0)) OrgId = orgs[0].Id; + + + if (OrgId != -1) { - List Plans = ObjectUtils.CreateListFromDataReader(DataProvider.GetExchangeMailboxPlans(orgs[0].Id)); + List Plans = ObjectUtils.CreateListFromDataReader(DataProvider.GetExchangeMailboxPlans(OrgId)); foreach (ExchangeMailboxPlan p in Plans) { @@ -2583,7 +2591,7 @@ namespace WebsitePanel.EnterpriseServer UserInfo owner = UserController.GetUserInternally(user.OwnerId); - GetExchangeMailboxPlansByUser(owner, ref mailboxPlans); + GetExchangeMailboxPlansByUser(0, owner, ref mailboxPlans); } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs index d0526ed3..0c2a67df 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs @@ -542,15 +542,13 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution List plans = new List(); UserInfo user = ObjectUtils.FillObjectFromDataReader(DataProvider.GetUserByExchangeOrganizationIdInternally(itemId)); - - LyncController.GetLyncUserPlansByUser(user, ref plans); + + if (user.Role == UserRole.User) + LyncController.GetLyncUserPlansByUser(itemId, user, ref plans); + else + LyncController.GetLyncUserPlansByUser(0, user, ref plans); return plans; - - - - return ObjectUtils.CreateListFromDataReader( - DataProvider.GetLyncUserPlans(itemId)); } catch (Exception ex) { @@ -562,7 +560,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } } - private static void GetLyncUserPlansByUser(UserInfo user, ref List plans) + private static void GetLyncUserPlansByUser(int itemId, UserInfo user, ref List plans) { if ((user != null)) { @@ -582,9 +580,13 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution orgs = ExchangeServerController.GetExchangeOrganizations(1, false); } - if ((orgs != null) & (orgs.Count > 0)) + int OrgId = -1; + if (itemId > 0) OrgId = itemId; + else if ((orgs != null) & (orgs.Count > 0)) OrgId = orgs[0].Id; + + if (OrgId != -1) { - List Plans = ObjectUtils.CreateListFromDataReader(DataProvider.GetLyncUserPlans(orgs[0].Id)); + List Plans = ObjectUtils.CreateListFromDataReader(DataProvider.GetLyncUserPlans(OrgId)); foreach (LyncUserPlan p in Plans) { @@ -594,7 +596,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution UserInfo owner = UserController.GetUserInternally(user.OwnerId); - GetLyncUserPlansByUser(owner, ref plans); + GetLyncUserPlansByUser(0, owner, ref plans); } } From 6522c355715f083e2734ec4c73a5f81539f9aa48 Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 2 Sep 2012 07:39:50 +0400 Subject: [PATCH 2/4] Exclude these files to push back --- .../WebsitePanel.EnterpriseServer/Web.config | 56 --- .../WebsitePanel.EnterpriseServer.csproj | 450 ------------------ 2 files changed, 506 deletions(-) delete mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config delete mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config deleted file mode 100644 index 58da2d47..00000000 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ /dev/null @@ -1,56 +0,0 @@ - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj deleted file mode 100644 index 78e917fa..00000000 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj +++ /dev/null @@ -1,450 +0,0 @@ - - - - - Debug - AnyCPU - 9.0.21022 - 2.0 - {59C7623A-5181-48A5-880A-C9B82B48F589} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - WebsitePanel.EnterpriseServer - WebsitePanel.EnterpriseServer - - - 4.0 - - - v4.0 - - true - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - 618 - - - none - true - bin\ - TRACE - prompt - 4 - AllRules.ruleset - 618 - - - - False - ..\..\Lib\Ionic.Zip.Reduced.dll - - - False - ..\..\Lib\Microsoft.Web.Services3.dll - True - - - - - - - - - - - - - - - - - - - - False - ..\..\Bin\WebsitePanel.Providers.Base.dll - - - False - ..\..\Bin\WebsitePanel.Server.Client.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - - - - - VersionInfo.cs - - - - - - - - Code - - - - - - - - - - - - - - - - - - - - - Code - - - - - - - - - Code - - - - - - - Code - - - Code - - - - - - - - - - - - - - - - - - - - - - - Code - - - - Code - - - Code - - - - Code - - - - - Code - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - esLync.asmx - Component - - - esVirtualizationServerForPrivateCloud.asmx - Component - - - ASPXCodeBehind - Default.aspx - - - Default.aspx - - - ecServiceHandler.asmx - Component - - - ecStorefront.asmx - Component - - - ecStorehouse.asmx - Component - - - esApplicationsInstaller.asmx - Component - - - esAuditLog.asmx - Component - - - esAuthentication.asmx - Component - - - esBackup.asmx - Component - - - esBlackBerry.asmx - Component - - - esComments.asmx - Component - - - esCRM.asmx - Component - - - esDatabaseServers.asmx - Component - - - esExchangeServer.asmx - Component - - - esFiles.asmx - Component - - - esFtpServers.asmx - Component - - - esHostedSharePointServers.asmx - Component - - - esImport.asmx - Component - - - esMailServers.asmx - Component - - - esOCS.asmx - Component - - - esOperatingSystems.asmx - Component - - - esOrganizations.asmx - Component - - - esPackages.asmx - Component - - - esScheduler.asmx - Component - - - esServers.asmx - Component - - - esSharePointServers.asmx - Component - - - esStatisticsServers.asmx - Component - - - esSystem.asmx - Component - - - esTasks.asmx - Component - - - esUsers.asmx - Component - - - esVirtualizationServer.asmx - Component - - - esWebApplicationGallery.asmx - Component - - - esWebServers.asmx - Component - - - Global.asax - - - - - - {53D22D35-4013-415F-BA09-F67A0DBBB0C1} - WebsitePanel.Common.Utils - - - {C09CE910-F16B-48A1-B2CC-C99B8C1CF775} - WebsitePanel.EnterpriseServer.Base - - - {387FA0EF-3927-45FF-8F8F-BCCD735540C6} - WebsitePanel.Templates - - - {7112B144-C5EE-43C2-9441-569D75D13CB9} - WebsitePanel.Whois - - - - - - - - - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - True - False - 9005 - / - http://localhost:9005/ - False - False - - - False - - - - - - - \ No newline at end of file From e979807b7db480642871de22c8cccde54c0e9763 Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 2 Sep 2012 07:42:26 +0400 Subject: [PATCH 3/4] add --- .../WebsitePanel.EnterpriseServer/Web.config | 56 +++ .../WebsitePanel.EnterpriseServer.csproj | 449 ++++++++++++++++++ 2 files changed, 505 insertions(+) create mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config create mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config new file mode 100644 index 00000000..b78330c8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -0,0 +1,56 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj new file mode 100644 index 00000000..52285130 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj @@ -0,0 +1,449 @@ + + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {59C7623A-5181-48A5-880A-C9B82B48F589} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + WebsitePanel.EnterpriseServer + WebsitePanel.EnterpriseServer + + + 4.0 + + + v4.0 + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + 618 + + + none + true + bin\ + TRACE + prompt + 4 + AllRules.ruleset + 618 + + + + False + ..\..\Lib\Ionic.Zip.Reduced.dll + + + False + ..\..\Lib\Microsoft.Web.Services3.dll + True + + + + + + + + + + + + + + + + + + + + False + ..\..\Bin\WebsitePanel.Providers.Base.dll + + + False + ..\..\Bin\WebsitePanel.Server.Client.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + + + + + VersionInfo.cs + + + + + + + + Code + + + + + + + + + + + + + + + + + + + + + Code + + + + + + + + + Code + + + + + + + Code + + + Code + + + + + + + + + + + + + + + + + + + + + + + Code + + + + Code + + + Code + + + + Code + + + + + Code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + esLync.asmx + Component + + + esVirtualizationServerForPrivateCloud.asmx + Component + + + ASPXCodeBehind + Default.aspx + + + Default.aspx + + + ecServiceHandler.asmx + Component + + + ecStorefront.asmx + Component + + + ecStorehouse.asmx + Component + + + esApplicationsInstaller.asmx + Component + + + esAuditLog.asmx + Component + + + esAuthentication.asmx + Component + + + esBackup.asmx + Component + + + esBlackBerry.asmx + Component + + + esComments.asmx + Component + + + esCRM.asmx + Component + + + esDatabaseServers.asmx + Component + + + esExchangeServer.asmx + Component + + + esFiles.asmx + Component + + + esFtpServers.asmx + Component + + + esHostedSharePointServers.asmx + Component + + + esImport.asmx + Component + + + esMailServers.asmx + Component + + + esOCS.asmx + Component + + + esOperatingSystems.asmx + Component + + + esOrganizations.asmx + Component + + + esPackages.asmx + Component + + + esScheduler.asmx + Component + + + esServers.asmx + Component + + + esSharePointServers.asmx + Component + + + esStatisticsServers.asmx + Component + + + esSystem.asmx + Component + + + esTasks.asmx + Component + + + esUsers.asmx + Component + + + esVirtualizationServer.asmx + Component + + + esWebApplicationGallery.asmx + Component + + + esWebServers.asmx + Component + + + Global.asax + + + + + + {53D22D35-4013-415F-BA09-F67A0DBBB0C1} + WebsitePanel.Common.Utils + + + {C09CE910-F16B-48A1-B2CC-C99B8C1CF775} + WebsitePanel.EnterpriseServer.Base + + + {387FA0EF-3927-45FF-8F8F-BCCD735540C6} + WebsitePanel.Templates + + + {7112B144-C5EE-43C2-9441-569D75D13CB9} + WebsitePanel.Whois + + + + + + + + + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + True + False + 9002 + / + http://localhost:9002/ + False + False + + + False + + + + + + + \ No newline at end of file From 9422fa28461bd6e2f0865c5cc9d73cec0055bf37 Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 2 Sep 2012 07:53:07 +0400 Subject: [PATCH 4/4] exclude web.config from synchronizing --- .hgignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgignore b/.hgignore index 3020542c..cc936f53 100644 --- a/.hgignore +++ b/.hgignore @@ -20,3 +20,4 @@ WebsitePanel.Installer/Build WebsitePanel/Bin msbuild.log _ReSharper.* +web.config