From 98bab06e96db034029da47fe2a52d1ad724d57c3 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sat, 27 Oct 2012 19:43:47 -0400 Subject: [PATCH 001/107] Added tag build-2.0.0.142 for changeset 1f0ea8a82ca2 From 2a7d298dfc02e338fae69476d45ed1acdba0ab83 Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 28 Oct 2012 23:28:22 +0400 Subject: [PATCH 002/107] exchange 2013 provider id added --- .../WebsitePanel.EnterpriseServer/Web.config | 10 +++++++--- .../ProviderControls/Exchange_Settings.ascx.cs | 13 ++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 3766094f..97a76d2a 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,11 +5,15 @@ - + - - + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange_Settings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange_Settings.ascx.cs index f3ab2ee2..a5e829c2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange_Settings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange_Settings.ascx.cs @@ -42,7 +42,8 @@ namespace WebsitePanel.Portal.ProviderControls public const string ClientAccessData = "ClientAccessData"; public const int EXCHANGE2010_PROVIDER_ID = 32; - public const int EXCHANGE2010SP2_PROVIDER_ID = 90; + public const int EXCHANGE2010SP2_PROVIDER_ID = 90; + public const int EXCHANGE2013_PROVIDER_ID = 91; public string HubTransports { @@ -101,6 +102,16 @@ namespace WebsitePanel.Portal.ProviderControls locMailboxDatabase.Visible = false; break; + case EXCHANGE2013_PROVIDER_ID: + clusteredMailboxServer.Visible = false; + txtMailboxClusterName.Text = ""; + + storageGroup.Visible = false; + txtStorageGroup.Text = ""; + + locMailboxDatabase.Visible = false; + break; + default: storageGroup.Visible = true; From 41ab5f43462e7ef23145acece3650a9de251b64a Mon Sep 17 00:00:00 2001 From: robvde Date: Mon, 29 Oct 2012 08:30:11 +0400 Subject: [PATCH 003/107] Fixed: HostHeaders are not registered as domainpointer when importing --- .../Code/WebServers/WebServerController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs index 6df74480..5b29543a 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs @@ -3716,6 +3716,7 @@ Please ensure the space has been allocated {0} IP address as a dedicated one and DomainInfo newDomain = new DomainInfo(); newDomain.DomainName = b.Host.ToLower(); newDomain.PackageId = domain.PackageId; + newDomain.IsDomainPointer = true; int newDomainID = ServerController.AddDomain(newDomain, domain.IsInstantAlias, false); if (newDomainID > 0) @@ -3726,7 +3727,6 @@ Please ensure the space has been allocated {0} IP address as a dedicated one and newDomain.WebSiteId = siteId; newDomain.ZoneItemId = domain.ZoneItemId; newDomain.DomainItemId = domain.DomainId; - newDomain.IsDomainPointer = true; ServerController.UpdateDomain(newDomain); } } From 1d3c5a8a2982d4367b676b33284b3a68df88472d Mon Sep 17 00:00:00 2001 From: robvde Date: Mon, 29 Oct 2012 15:05:28 +0400 Subject: [PATCH 004/107] Undo 2013 preparation --- .../ProviderControls/Exchange_Settings.ascx.cs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange_Settings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange_Settings.ascx.cs index a5e829c2..7da1698d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange_Settings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange_Settings.ascx.cs @@ -43,7 +43,7 @@ namespace WebsitePanel.Portal.ProviderControls public const int EXCHANGE2010_PROVIDER_ID = 32; public const int EXCHANGE2010SP2_PROVIDER_ID = 90; - public const int EXCHANGE2013_PROVIDER_ID = 91; + public string HubTransports { @@ -102,17 +102,6 @@ namespace WebsitePanel.Portal.ProviderControls locMailboxDatabase.Visible = false; break; - case EXCHANGE2013_PROVIDER_ID: - clusteredMailboxServer.Visible = false; - txtMailboxClusterName.Text = ""; - - storageGroup.Visible = false; - txtStorageGroup.Text = ""; - - locMailboxDatabase.Visible = false; - break; - - default: storageGroup.Visible = true; txtStorageGroup.Text = settings["StorageGroup"]; From 837892e68993902a8280d4f096797557176f96d4 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Mon, 29 Oct 2012 11:43:37 -0400 Subject: [PATCH 005/107] Merge --- WebsitePanel.Installer/Sources/VersionInfo.cs | 2 +- .../WebsitePanel.Installer/Updater.exe | Bin 198144 -> 198144 bytes WebsitePanel/Sources/VersionInfo.cs | 2 +- WebsitePanel/Sources/VersionInfo.vb | 2 +- .../Code/WebServers/WebServerController.cs | 12 ++++++++++++ .../WebsitePanel.EnterpriseServer/Web.config | 10 +++------- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/WebsitePanel.Installer/Sources/VersionInfo.cs b/WebsitePanel.Installer/Sources/VersionInfo.cs index ee7d4a52..bc5f49ca 100644 --- a/WebsitePanel.Installer/Sources/VersionInfo.cs +++ b/WebsitePanel.Installer/Sources/VersionInfo.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.18010 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Installer/Updater.exe b/WebsitePanel.Installer/Sources/WebsitePanel.Installer/Updater.exe index c3d6446396c7eebf31d450780eacc4f943ea5666..7812a3351959a200ec9db5483fc79d69acf87508 100644 GIT binary patch delta 45 zcmZqZ;c4jMnb5)Pv9znPyS1BfYd6!u0s+Ir$*m85{&Z<@fDFDZZ B6te&T delta 45 zcmZqZ;c4jMnb5(^@id~byS1BfYd6!u0)gi-@p?+rqdn#|gt;yME#$mCrjTjL6ac37 B63hSq diff --git a/WebsitePanel/Sources/VersionInfo.cs b/WebsitePanel/Sources/VersionInfo.cs index ee7d4a52..bc5f49ca 100644 --- a/WebsitePanel/Sources/VersionInfo.cs +++ b/WebsitePanel/Sources/VersionInfo.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.18010 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/WebsitePanel/Sources/VersionInfo.vb b/WebsitePanel/Sources/VersionInfo.vb index ded96cbd..d2c94d8f 100644 --- a/WebsitePanel/Sources/VersionInfo.vb +++ b/WebsitePanel/Sources/VersionInfo.vb @@ -1,7 +1,7 @@ '------------------------------------------------------------------------------ ' ' This code was generated by a tool. -' Runtime Version:4.0.30319.17929 +' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs index 5b29543a..c80f4edb 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs @@ -29,6 +29,7 @@ using System; using System.IO; using System.Data; +using System.Linq; using System.Collections.Specialized; using System.Collections.Generic; using System.Text; @@ -1213,6 +1214,17 @@ namespace WebsitePanel.EnterpriseServer DNSServer dns = new DNSServer(); ServiceProviderProxy.Init(dns, zone.ServiceId); + DnsRecord[] domainRecords = dns.GetZoneRecords(zone.Name); + var duplicateRecords = (from zoneRecord in domainRecords + from resRecord in resourceRecords + where zoneRecord.RecordName == resRecord.RecordName + where zoneRecord.RecordType == resRecord.RecordType + select zoneRecord).ToArray(); + if (duplicateRecords != null && duplicateRecords.Count() > 0) + { + dns.DeleteZoneRecords(zone.Name, duplicateRecords); + } + // add new resource records dns.AddZoneRecords(zone.Name, resourceRecords.ToArray()); } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 97a76d2a..3766094f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,15 +5,11 @@ - + - - - + + From 1615095fc2322cbbd178ed7e9feb72ba83cc7431 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Mon, 29 Oct 2012 11:54:58 -0400 Subject: [PATCH 006/107] Added tag build-2.0.0.143 for changeset 2c29a2d24954 From dbab36dbd900433e71739f08531cd69edf00d521 Mon Sep 17 00:00:00 2001 From: robvde Date: Mon, 29 Oct 2012 20:55:52 +0400 Subject: [PATCH 007/107] fixed hostheader import: subdomain pointer gets assigned to parent instead of subdomain --- .../Code/WebServers/WebServerController.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs index 5b29543a..4cc1373f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs @@ -3760,19 +3760,21 @@ Please ensure the space has been allocated {0} IP address as a dedicated one and private static int FindDomainForHeader(string header, List domains) { int domainId = 0; - - while (header.IndexOf(".") != -1) + int counter = 0; + while ((header.IndexOf(".") != -1) & (counter < 2)) { - header = header.Substring(header.IndexOf(".") + 1); foreach (DomainInfo d in domains) { if ((header == d.DomainName.ToLower()) && (!d.IsDomainPointer)) { - domainId = d.DomainId; - break; + return d.DomainId; } } + + header = header.Substring(header.IndexOf(".") + 1); + counter++; + } return domainId; From 9dd9348dfb4778eb9626fe9283bbc6a7231256c4 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Mon, 29 Oct 2012 14:10:04 -0400 Subject: [PATCH 008/107] Added tag build-2.0.0.144 for changeset 934ebcbb6c51 From 7c85eb643f66ff9fba8d1979151fd45a4d8219c7 Mon Sep 17 00:00:00 2001 From: VoosW Date: Mon, 29 Oct 2012 19:35:27 +0100 Subject: [PATCH 009/107] change "Getdatabase" code for Exchange 2010SP2 so that it accepts a database group name of DAG\MailboxDatabase to turn off the load-balancing and instead use a fixed database. The default behaviour of load-balancing mailboxes between all Provsioning-Enabled mailbox databases of the DAG-Group is still present and functioning. --- .../Exchange2010SP2.cs | 94 ++++++++++++++----- 1 file changed, 71 insertions(+), 23 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010SP2.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010SP2.cs index 65d4dabf..230ac187 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010SP2.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010SP2.cs @@ -607,15 +607,42 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogStart("GetDatabase"); ExchangeLog.LogInfo("DAG: " + dagName); - //Get Dag Servers + // this part of code handles mailboxnames like in the old 2007 provider + // check if DAG is in reality DAG\mailboxdatabase + string dagNameDAG = string.Empty; + string dagNameMBX = string.Empty; + bool isFixedDatabase = false; + if (dagName.Contains("\\")) + { + // split the two parts and extract DAG-Name and mailboxdatabase-name + string[] parts = dagName.Split(new char[] { '\\' }, 2, StringSplitOptions.None); + dagNameDAG = parts[0]; + dagNameMBX = parts[1]; + // check that we realy have a database name + if (!String.IsNullOrEmpty(dagNameMBX)) + { + isFixedDatabase = true; + } + } + else + { + // there is no mailboxdatabase-name use the loadbalancing-code + dagNameDAG = dagName; + isFixedDatabase = false; + } + + //Get Dag Servers - with the name of the database availability group Collection dags = null; Command cmd = new Command("Get-DatabaseAvailabilityGroup"); - cmd.Parameters.Add("Identity", dagName); + cmd.Parameters.Add("Identity", dagNameDAG); dags = ExecuteShellCommand(runSpace, cmd); if (htBbalancer == null) htBbalancer = new Hashtable(); + // use fully qualified dagName for loadbalancer. Thus if there are two services and one of them + // contains only the DAG, the "fixed" database could also be used in loadbalancing. If you do not want this, + // set either IsExcludedFromProvisioning or IsSuspendedFromProvisioning - it is not evaluated for fixed databases if (htBbalancer[dagName] == null) htBbalancer.Add(dagName, 0); @@ -628,35 +655,56 @@ namespace WebsitePanel.Providers.HostedSolution { System.Collections.Generic.List lstDatabase = new System.Collections.Generic.List(); - foreach (object objServer in servers) + if (!isFixedDatabase) // "old" loadbalancing code + { + foreach (object objServer in servers) + { + Collection databases = null; + cmd = new Command("Get-MailboxDatabase"); + cmd.Parameters.Add("Server", ObjToString(objServer)); + databases = ExecuteShellCommand(runSpace, cmd); + + foreach (PSObject objDatabase in databases) + { + if (((bool)GetPSObjectProperty(objDatabase, "IsExcludedFromProvisioning") == false) && + ((bool)GetPSObjectProperty(objDatabase, "IsSuspendedFromProvisioning") == false)) + { + string db = ObjToString(GetPSObjectProperty(objDatabase, "Identity")); + + bool bAdd = true; + foreach (string s in lstDatabase) + { + if (s.ToLower() == db.ToLower()) + { + bAdd = false; + break; + } + } + + if (bAdd) + { + lstDatabase.Add(db); + ExchangeLog.LogInfo("AddDatabase: " + db); + } + } + } + } + } + else // new fixed database code { Collection databases = null; cmd = new Command("Get-MailboxDatabase"); - cmd.Parameters.Add("Server", ObjToString(objServer)); + cmd.Parameters.Add("Identity", dagNameMBX); databases = ExecuteShellCommand(runSpace, cmd); + // do not check "IsExcludedFromProvisioning" or "IsSuspended", just check if it is a member of the DAG foreach (PSObject objDatabase in databases) { - if (((bool)GetPSObjectProperty(objDatabase, "IsExcludedFromProvisioning") == false) && - ((bool)GetPSObjectProperty(objDatabase, "IsSuspendedFromProvisioning") == false)) + string dagSetting = ObjToString(GetPSObjectProperty(objDatabase, "MasterServerOrAvailabilityGroup")); + if (dagNameDAG.Equals(dagSetting, StringComparison.OrdinalIgnoreCase)) { - string db = ObjToString(GetPSObjectProperty(objDatabase, "Identity")); - - bool bAdd = true; - foreach (string s in lstDatabase) - { - if (s.ToLower() == db.ToLower()) - { - bAdd = false; - break; - } - } - - if (bAdd) - { - lstDatabase.Add(db); - ExchangeLog.LogInfo("AddDatabase: " + db); - } + lstDatabase.Add(dagNameMBX); + ExchangeLog.LogInfo("AddFixedDatabase: " + dagNameMBX); } } } From 14dfe450ff2f6a62cf3ddbebc097eef8aa426b3b Mon Sep 17 00:00:00 2001 From: robvde Date: Tue, 30 Oct 2012 09:11:35 +0400 Subject: [PATCH 010/107] Readded the organization user summary tab --- .../WebsitePanel.EnterpriseServer/Web.config | 14 +++++++++++--- .../ExchangeServer/UserControls/UserTabs.ascx.cs | 5 ++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 3766094f..27a5f82b 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,11 +5,19 @@ - + + - - + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserTabs.ascx.cs index 91bf372d..da968986 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserTabs.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserTabs.ascx.cs @@ -50,7 +50,10 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls { List tabsList = new List(); tabsList.Add(CreateTab("edit_user", "Tab.General")); - //tabsList.Add(CreateTab("organization_user_setup", "Tab.Setup")); + + string instructions = ES.Services.Organizations.GetOrganizationUserSummuryLetter(PanelRequest.ItemID, PanelRequest.AccountID, false, false, false); + if (!string.IsNullOrEmpty(instructions)) + tabsList.Add(CreateTab("organization_user_setup", "Tab.Setup")); // find selected menu item int idx = 0; From 344ea5e4bd1666bf5bf6901112e548b990dc08e5 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 30 Oct 2012 08:11:05 -0400 Subject: [PATCH 011/107] Merge --- .../WebsitePanel.EnterpriseServer/Web.config | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 27a5f82b..3766094f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,19 +5,11 @@ - - + - - - + + From 4b457fc8c6dd3a7e8865dd7a98f6e7b6edd0d2ac Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 30 Oct 2012 08:20:39 -0400 Subject: [PATCH 012/107] Added tag build-2.0.0.145 for changeset c0c9007136a5 From 90a746bc3c7fe52020b72a066041808834c9c95d Mon Sep 17 00:00:00 2001 From: robvde Date: Tue, 30 Oct 2012 22:30:22 +0400 Subject: [PATCH 013/107] Added: Added Lync to the Scheduled Enterprise HOsting report ReAdded: ability to send summary email when create an user account or a mailbox --- WebsitePanel/Database/update_db.sql | 10 +- .../Code/HostedSolution/LyncController.cs | 7 +- .../HostedSolution/OrganizationController.cs | 2 +- .../Code/HostedSolution/ReportController.cs | 125 ++++++++++++++++-- .../SchedulerTasks/HostedSolutionReport.cs | 10 +- .../WebsitePanel.EnterpriseServer/Web.config | 4 +- .../esLync.asmx.cs | 2 +- .../EnterpriseSolutionStatisticsReport.cs | 2 +- .../ExchangeMailboxStatistics.cs | 1 + .../ExchangeStatisticsReport.cs | 3 +- .../OrganizationStatisticsReport.cs | 4 +- .../OrganizationStatisticsRepotItem.cs | 13 ++ .../WebsitePanel.Providers.Base.csproj | 3 + .../ExchangeServer/ExchangeCreateMailbox.ascx | 10 +- .../ExchangeCreateMailbox.ascx.cs | 25 +++- .../ExchangeCreateMailbox.ascx.designer.cs | 18 +++ .../OrganizationCreateUser.ascx | 9 ++ .../OrganizationCreateUser.ascx.cs | 23 +++- .../OrganizationCreateUser.ascx.designer.cs | 18 +++ .../HostedSolutionReport.ascx.resx | 7 +- .../HostedSolutionReport.ascx | 5 + .../HostedSolutionReport.ascx.cs | 5 +- .../HostedSolutionReport.ascx.designer.cs | 12 +- 23 files changed, 278 insertions(+), 40 deletions(-) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 2482e5ff..4059e0db 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -6415,4 +6415,12 @@ exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @PackageID int, @Fil RETURN -GO \ No newline at end of file +GO + + + +IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTaskParameters] WHERE [ParameterID] = 'LYNC_REPORT') +BEGIN +INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_HOSTED_SOLUTION_REPORT', N'LYNC_REPORT', N'Boolean', N'true', 5) +END +GO diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs index dbbdb260..b7bf20f1 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs @@ -431,7 +431,12 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } - public static LyncUsersPagedResult GetLyncUsers(int itemId, string sortColumn, string sortDirection, int startRow, int count) + public static LyncUsersPagedResult GetLyncUsers(int itemId) + { + return GetLyncUsersPaged(itemId, string.Empty, string.Empty, 0, int.MaxValue); + } + + public static LyncUsersPagedResult GetLyncUsersPaged(int itemId, string sortColumn, string sortDirection, int startRow, int count) { LyncUsersPagedResult res = TaskManager.StartResultTask("LYNC", "GET_LYNC_USERS"); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index 3cf73181..d1904c88 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -517,7 +517,7 @@ namespace WebsitePanel.EnterpriseServer try { - LyncUsersPagedResult res = LyncController.GetLyncUsers(itemId, string.Empty, string.Empty, 0, int.MaxValue); + LyncUsersPagedResult res = LyncController.GetLyncUsers(itemId); if (res.IsSuccess) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs index 3692a9c6..fb322d30 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs @@ -123,8 +123,22 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution delegate(CRMOrganizationStatistics stats) { return stats.OrganizationID == org.OrganizationId; }); item.TotalCRMUsers = crmOrganizationStatistics.Count; + } + + if (report.LyncReport != null) + { + List lyncOrganizationStatistics = + report.LyncReport.Items.FindAll( + delegate(LyncUserStatistics stats) { return stats.OrganizationID == org.OrganizationId; }); + + foreach (LyncUserStatistics current in lyncOrganizationStatistics) + { + if (current.EnterpriseVoice) item.TotalLyncEVUsers++; + } + + item.TotalLyncUsers = lyncOrganizationStatistics.Count; } - + report.OrganizationReport.Items.Add(item); } @@ -308,7 +322,20 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution { TaskManager.WriteError(ex); } + } + + if (report.LyncReport != null) + { + try + { + PopulateLyncReportItems(org, report, topReseller); + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } } + } private static int GetExchangeServiceID(int packageId) @@ -316,6 +343,10 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution return PackageController.GetPackageServiceId(packageId, ResourceGroups.Exchange); } + private static int GetLyncServiceID(int packageId) + { + return PackageController.GetPackageServiceId(packageId, ResourceGroups.Lync); + } private static void PopulateSharePointItem(Organization org, EnterpriseSolutionStatisticsReport report, string topReseller) @@ -422,7 +453,13 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution { PopulateBaseItem(stats, org, topReseller); stats.MailboxType = mailbox.AccountType; + if (mailbox.AccountType == ExchangeAccountType.Mailbox) + { + ExchangeAccount a = ExchangeServerController.GetAccount(mailbox.ItemId, mailbox.AccountId); + stats.MailboxPlan = a.MailboxPlan; + } + stats.BlackberryEnabled = BlackBerryController.CheckBlackBerryUserExists(mailbox.AccountId); report.ExchangeReport.Items.Add(stats); } @@ -436,6 +473,74 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } + + + private static void PopulateLyncReportItems(Organization org, EnterpriseSolutionStatisticsReport report, string topReseller) + { + + //Check if lync organization + if (string.IsNullOrEmpty(org.LyncTenantId)) + return; + + LyncUser[] lyncUsers = null; + + try + { + LyncUsersPagedResult res = LyncController.GetLyncUsers(org.Id); + if (res.IsSuccess) lyncUsers = res.Value.PageUsers; + } + catch (Exception ex) + { + throw new ApplicationException( + string.Format("Could not get lync users for current organization {0}", org.Id), ex); + } + + + if (lyncUsers == null) + return; + + foreach (LyncUser lyncUser in lyncUsers) + { + try + { + LyncUserStatistics stats = new LyncUserStatistics(); + + try + { + stats.SipAddress = lyncUser.PrimaryEmailAddress; + if (string.IsNullOrEmpty(lyncUser.LineUri)) stats.PhoneNumber = string.Empty; else stats.PhoneNumber = lyncUser.LineUri; + + LyncUserPlan plan = LyncController.GetLyncUserPlan(org.Id, lyncUser.LyncUserPlanId); + stats.Conferencing = plan.Conferencing; + stats.EnterpriseVoice = plan.EnterpriseVoice; + stats.Federation = plan.Federation; + stats.InstantMessaing = plan.IM; + stats.MobileAccess = plan.Mobility; + stats.LyncUserPlan = plan.LyncUserPlanName; + + } + catch (Exception ex) + { + TaskManager.WriteError(ex, "Could not get lync statistics. AccountName: {0}", + lyncUser.DisplayName); + } + + + if (stats != null) + { + PopulateBaseItem(stats, org, topReseller); + report.LyncReport.Items.Add(stats); + } + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + } + + } + + private static void PopulateSpaceData(int packageId, EnterpriseSolutionStatisticsReport report, string topReseller) { List organizations; @@ -489,8 +594,8 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } } - - private static void GetUsersData(EnterpriseSolutionStatisticsReport report, int userId, bool generateExchangeReport, bool generateSharePointReport, bool generateCRMReport, bool generateOrganizationReport, string topReseller) + + private static void GetUsersData(EnterpriseSolutionStatisticsReport report, int userId, bool generateExchangeReport, bool generateSharePointReport, bool generateCRMReport, bool generateOrganizationReport, bool generateLyncReport, string topReseller) { List users; try @@ -514,6 +619,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution GetUsersData(report, user.UserId, generateExchangeReport, generateSharePointReport, generateCRMReport, generateOrganizationReport, + generateLyncReport, string.IsNullOrEmpty(topReseller) ? user.Username : topReseller); } } @@ -523,8 +629,8 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } } } - - public static EnterpriseSolutionStatisticsReport GetEnterpriseSolutionStatisticsReport(int userId, bool generateExchangeReport, bool generateSharePointReport, bool generateCRMReport, bool generateOrganizationReport) + + public static EnterpriseSolutionStatisticsReport GetEnterpriseSolutionStatisticsReport(int userId, bool generateExchangeReport, bool generateSharePointReport, bool generateCRMReport, bool generateOrganizationReport, bool generateLyncReport) { EnterpriseSolutionStatisticsReport report = new EnterpriseSolutionStatisticsReport(); @@ -534,17 +640,20 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution if (generateSharePointReport || generateOrganizationReport) report.SharePointReport = new SharePointStatisticsReport(); + if (generateLyncReport || generateOrganizationReport) + report.LyncReport = new LyncStatisticsReport(); + + if (generateCRMReport || generateOrganizationReport) report.CRMReport = new CRMStatisticsReport(); if (generateOrganizationReport) report.OrganizationReport = new OrganizationStatisticsReport(); - - + try { GetUsersData(report, userId, generateExchangeReport, generateSharePointReport, generateCRMReport, - generateOrganizationReport, null); + generateOrganizationReport, generateLyncReport, null); } catch(Exception ex) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/SchedulerTasks/HostedSolutionReport.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/SchedulerTasks/HostedSolutionReport.cs index 10322c79..b82436df 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/SchedulerTasks/HostedSolutionReport.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/SchedulerTasks/HostedSolutionReport.cs @@ -42,6 +42,7 @@ namespace WebsitePanel.EnterpriseServer private static readonly string EXCHANGE_REPORT = "EXCHANGE_REPORT"; private static readonly string ORGANIZATION_REPORT = "ORGANIZATION_REPORT"; private static readonly string SHAREPOINT_REPORT = "SHAREPOINT_REPORT"; + private static readonly string LYNC_REPORT = "LYNC_REPORT"; private static readonly string CRM_REPORT = "CRM_REPORT"; private static readonly string EMAIL = "EMAIL"; @@ -52,6 +53,7 @@ namespace WebsitePanel.EnterpriseServer { bool isExchange = Utils.ParseBool(TaskManager.TaskParameters[EXCHANGE_REPORT], false); bool isSharePoint = Utils.ParseBool(TaskManager.TaskParameters[SHAREPOINT_REPORT], false); + bool isLync = Utils.ParseBool(TaskManager.TaskParameters[LYNC_REPORT], false); bool isCRM = Utils.ParseBool(TaskManager.TaskParameters[CRM_REPORT], false); bool isOrganization = Utils.ParseBool(TaskManager.TaskParameters[ORGANIZATION_REPORT], false); @@ -61,13 +63,14 @@ namespace WebsitePanel.EnterpriseServer UserInfo user = PackageController.GetPackageOwner(TaskManager.PackageId); EnterpriseSolutionStatisticsReport report = ReportController.GetEnterpriseSolutionStatisticsReport(user.UserId, isExchange, isSharePoint, isCRM, - isOrganization); + isOrganization, isLync); SendMessage(user, email, isExchange && report.ExchangeReport != null ? report.ExchangeReport.ToCSV() : string.Empty, isSharePoint && report.SharePointReport != null ? report.SharePointReport.ToCSV() : string.Empty, isCRM && report.CRMReport != null ? report.CRMReport.ToCSV() : string.Empty, - isOrganization && report.OrganizationReport != null ? report.OrganizationReport.ToCSV() : string.Empty); + isOrganization && report.OrganizationReport != null ? report.OrganizationReport.ToCSV() : string.Empty, + isLync && report.LyncReport != null ? report.LyncReport.ToCSV() : string.Empty); } catch(Exception ex) { @@ -90,11 +93,12 @@ namespace WebsitePanel.EnterpriseServer } } - private void SendMessage(UserInfo user,string email, string exchange_csv, string sharepoint_csv, string crm_csv, string organization_csv) + private void SendMessage(UserInfo user,string email, string exchange_csv, string sharepoint_csv, string crm_csv, string organization_csv, string lync_csv) { List attacments = new List(); PrepareAttament("exchange.csv", exchange_csv, attacments); PrepareAttament("sharepoint.csv", sharepoint_csv, attacments); + PrepareAttament("lync.csv", lync_csv, attacments); PrepareAttament("crm.csv", crm_csv, attacments); PrepareAttament("organization.csv", organization_csv, attacments); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 27a5f82b..6c7d9d64 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -9,7 +9,7 @@ --> - + @@ -17,7 +17,7 @@ --> - + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs index 9996fb3d..16c4328b 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs @@ -59,7 +59,7 @@ namespace WebsitePanel.EnterpriseServer [WebMethod] public LyncUsersPagedResult GetLyncUsersPaged(int itemId, string sortColumn, string sortDirection, int startRow, int maximumRows) { - return LyncController.GetLyncUsers(itemId, sortColumn, sortDirection, startRow, maximumRows); + return LyncController.GetLyncUsersPaged(itemId, sortColumn, sortDirection, startRow, maximumRows); } [WebMethod] diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/EnterpriseSolutionStatisticsReport.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/EnterpriseSolutionStatisticsReport.cs index 707c0531..f69dd959 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/EnterpriseSolutionStatisticsReport.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/EnterpriseSolutionStatisticsReport.cs @@ -34,6 +34,6 @@ public SharePointStatisticsReport SharePointReport { get; set; } public CRMStatisticsReport CRMReport { get; set; } public OrganizationStatisticsReport OrganizationReport { get; set; } - + public LyncStatisticsReport LyncReport { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxStatistics.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxStatistics.cs index 7583893e..7b408e10 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxStatistics.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxStatistics.cs @@ -50,5 +50,6 @@ namespace WebsitePanel.Providers.HostedSolution public bool Enabled { get; set; } public ExchangeAccountType MailboxType { get; set; } public bool BlackberryEnabled { get; set; } + public string MailboxPlan { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeStatisticsReport.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeStatisticsReport.cs index 7366c029..111dbae4 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeStatisticsReport.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeStatisticsReport.cs @@ -67,6 +67,7 @@ namespace WebsitePanel.Providers.HostedSolution sb.AppendFormat("{0},", ToCsvString(item.Enabled, "Enabled", "Disabled")); sb.AppendFormat("{0},", ToCsvString(item.MailboxType)); sb.AppendFormat("{0}", ToCsvString(item.BlackberryEnabled)); + sb.AppendFormat("{0}", ToCsvString(item.MailboxPlan)); mainBuilder.Append(sb.ToString()); } return mainBuilder.ToString(); @@ -74,7 +75,7 @@ namespace WebsitePanel.Providers.HostedSolution private void AddCSVHeader(StringBuilder sb) { - sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Ogranization Created,Organization ID,Mailbox Display Name,Account Created,Primary E-mail Address,MAPI,OWA,ActiveSync,POP 3,IMAP,Mailbox Size (Mb),Max Mailbox Size (Mb),Last Logon,Enabled,Mailbox Type, BlackBerry"); + sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Organization Created,Organization ID,Mailbox Display Name,Account Created,Primary E-mail Address,MAPI,OWA,ActiveSync,POP 3,IMAP,Mailbox Size (Mb),Max Mailbox Size (Mb),Last Logon,Enabled,Mailbox Type, BlackBerry, Mailbox Plan"); } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsReport.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsReport.cs index 3d94d8be..a6ee3d78 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsReport.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsReport.cs @@ -57,6 +57,8 @@ namespace WebsitePanel.Providers.HostedSolution sb.AppendFormat("{0},", ToCsvString(item.TotalSharePointSiteCollections)); sb.AppendFormat("{0},", ToCsvString(item.TotalSharePointSiteCollectionsSize / 1024.0 / 1024.0)); sb.AppendFormat("{0}", ToCsvString(item.TotalCRMUsers)); + sb.AppendFormat("{0}", ToCsvString(item.TotalLyncUsers)); + sb.AppendFormat("{0}", ToCsvString(item.TotalLyncEVUsers)); mainBuilder.Append(sb.ToString()); } @@ -65,7 +67,7 @@ namespace WebsitePanel.Providers.HostedSolution private static void AddCSVHeader(StringBuilder sb) { - sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Ogranization Created,Organization ID,Total mailboxes,Total mailboxes size(Mb),Total Public Folders size(Mb),Total SharePoint site collections,Total SharePoint site collections size(Mb),Total CRM users"); + sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Ogranization Created,Organization ID,Total mailboxes,Total mailboxes size(Mb),Total Public Folders size(Mb),Total SharePoint site collections,Total SharePoint site collections size(Mb),Total CRM users,Total Lync users,Total Lync EV users"); } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsRepotItem.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsRepotItem.cs index d7009b80..b240c79f 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsRepotItem.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsRepotItem.cs @@ -66,5 +66,18 @@ set; } + public int TotalLyncUsers + { + get; + set; + } + + public int TotalLyncEVUsers + { + 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 e13eb0be..f65c7c25 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -88,6 +88,9 @@ + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx index 62e671f9..b2deb2cf 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx @@ -147,7 +147,15 @@ - + + + + + +
+ +
+
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxPlanSelector mailboxPlanSelector; + /// + /// chkSendInstructions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkSendInstructions; + + /// + /// sendInstructionEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.EmailControl sendInstructionEmail; + /// /// btnCreate control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx index 187d5a08..4c8ea62f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx @@ -91,6 +91,15 @@ + + + + + + +
+ +
protected global::WebsitePanel.Portal.PasswordControl password; + /// + /// chkSendInstructions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkSendInstructions; + + /// + /// sendInstructionEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.EmailControl sendInstructionEmail; + /// /// btnCreate control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/HostedSolutionReport.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/HostedSolutionReport.ascx.resx index f7088cc4..211bf742 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/HostedSolutionReport.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/HostedSolutionReport.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 CRM Report @@ -123,6 +123,9 @@ Exchange Report + + Lync Report + Organization Report diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx index 58374f7b..4dd58eaa 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx @@ -19,6 +19,11 @@ + + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.cs index 56ae7708..d458ebce 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.cs @@ -37,6 +37,7 @@ namespace WebsitePanel.Portal.ScheduleTaskControls private static readonly string EXCHANGE_REPORT = "EXCHANGE_REPORT"; private static readonly string ORGANIZATION_REPORT = "ORGANIZATION_REPORT"; private static readonly string SHAREPOINT_REPORT = "SHAREPOINT_REPORT"; + private static readonly string LYNC_REPORT = "LYNC_REPORT"; private static readonly string CRM_REPORT = "CRM_REPORT"; private static readonly string EMAIL = "EMAIL"; @@ -51,6 +52,7 @@ namespace WebsitePanel.Portal.ScheduleTaskControls base.SetParameters(parameters); SetParameter(cbExchange, EXCHANGE_REPORT); SetParameter(cbSharePoint, SHAREPOINT_REPORT); + SetParameter(cbLync, LYNC_REPORT); SetParameter(cbCRM, CRM_REPORT); SetParameter(cbOrganization, ORGANIZATION_REPORT); SetParameter(txtMail, EMAIL); @@ -61,12 +63,13 @@ namespace WebsitePanel.Portal.ScheduleTaskControls { ScheduleTaskParameterInfo exchange = GetParameter(cbExchange, EXCHANGE_REPORT); ScheduleTaskParameterInfo sharepoint = GetParameter(cbSharePoint, SHAREPOINT_REPORT); + ScheduleTaskParameterInfo lync = GetParameter(cbLync, LYNC_REPORT); ScheduleTaskParameterInfo crm = GetParameter(cbCRM, CRM_REPORT); ScheduleTaskParameterInfo organization = GetParameter(cbOrganization, ORGANIZATION_REPORT); ScheduleTaskParameterInfo email = GetParameter(txtMail, EMAIL); - return new ScheduleTaskParameterInfo[5] { exchange, sharepoint, crm , organization, email}; + return new ScheduleTaskParameterInfo[6] { exchange, sharepoint, lync, crm , organization, email}; } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.designer.cs index 7ecf5644..f2f81ab4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.1433 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -49,6 +48,15 @@ namespace WebsitePanel.Portal.ScheduleTaskControls { /// protected global::System.Web.UI.WebControls.CheckBox cbSharePoint; + /// + /// cbLync control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbLync; + /// /// cbCRM control. /// From c6d40aedb84cf20b714716bd2a8ead0f17d5cf75 Mon Sep 17 00:00:00 2001 From: robvde Date: Tue, 30 Oct 2012 22:40:03 +0400 Subject: [PATCH 014/107] New files for lync reporting --- .../LyncOrganizationStatistics.cs | 72 +++++++++++++++++ .../HostedSolution/LyncStatisticsReport.cs | 78 +++++++++++++++++++ .../HostedSolution/LyncUserStatistics.cs | 49 ++++++++++++ 3 files changed, 199 insertions(+) create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncOrganizationStatistics.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncStatisticsReport.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUserStatistics.cs diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncOrganizationStatistics.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncOrganizationStatistics.cs new file mode 100644 index 00000000..9b747767 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncOrganizationStatistics.cs @@ -0,0 +1,72 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.HostedSolution +{ + public class LyncOrganizationStatistics + { + private int allocatedLyncUsers; + private int createdLyncUsers; + + private int allocatedLyncEVUsers; + private int createdLyncEVUsers; + + + public int AllocatedLyncUsers + { + get { return this.allocatedLyncUsers; } + set { this.allocatedLyncUsers = value; } + } + + public int CreatedLyncUsers + { + get { return this.createdLyncUsers; } + set { this.createdLyncUsers = value; } + } + + + public int AllocatedLyncEVUsers + { + get { return this.allocatedLyncEVUsers; } + set { this.allocatedLyncEVUsers = value; } + } + + public int CreatedLyncEVUsers + { + get { return this.createdLyncEVUsers; } + set { this.createdLyncEVUsers = value; } + } + + + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncStatisticsReport.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncStatisticsReport.cs new file mode 100644 index 00000000..f62e4def --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncStatisticsReport.cs @@ -0,0 +1,78 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System.Text; + +namespace WebsitePanel.Providers.HostedSolution +{ + public class LyncStatisticsReport : BaseReport + { + public override string ToCSV() + { + StringBuilder mainBuilder = new StringBuilder(); + StringBuilder sb = null; + AddCSVHeader(mainBuilder); + foreach (LyncUserStatistics item in Items) + { + sb = new StringBuilder(); + sb.Append("\n"); + sb.AppendFormat("{0},", ToCsvString(item.TopResellerName)); + sb.AppendFormat("{0},", ToCsvString(item.ResellerName)); + sb.AppendFormat("{0},", ToCsvString(item.CustomerName)); + sb.AppendFormat("{0},", ToCsvString(item.CustomerCreated)); + sb.AppendFormat("{0},", ToCsvString(item.HostingSpace)); + sb.AppendFormat("{0},", ToCsvString(item.HostingSpaceCreated)); + sb.AppendFormat("{0},", ToCsvString(item.OrganizationName)); + sb.AppendFormat("{0},", ToCsvString(item.OrganizationCreated)); + sb.AppendFormat("{0},", ToCsvString(item.OrganizationID)); + + sb.AppendFormat("{0},", ToCsvString(item.DisplayName)); + sb.AppendFormat("{0},", ToCsvString(item.AccountCreated)); + + sb.AppendFormat("{0},", ToCsvString(item.SipAddress)); + sb.AppendFormat("{0},", ToCsvString(item.PhoneNumber)); + sb.AppendFormat("{0},", ToCsvString(item.Conferencing)); + sb.AppendFormat("{0},", ToCsvString(item.EnterpriseVoice)); + sb.AppendFormat("{0},", ToCsvString(item.Federation)); + sb.AppendFormat("{0},", ToCsvString(item.InstantMessaing)); + sb.AppendFormat("{0},", ToCsvString(item.MobileAccess)); + sb.AppendFormat("{0},", ToCsvString(item.LyncUserPlan)); + + mainBuilder.Append(sb.ToString()); + } + + return mainBuilder.ToString(); + + } + + private static void AddCSVHeader(StringBuilder sb) + { + sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Organization Created,Organization ID,Display Name,Account Created,SipAddress,PhoneNumber,Conferencing,EnterpriseVoice,Federation,InstantMessaging,MobileAccess"); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUserStatistics.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUserStatistics.cs new file mode 100644 index 00000000..2604f3b7 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUserStatistics.cs @@ -0,0 +1,49 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace WebsitePanel.Providers.HostedSolution +{ + public class LyncUserStatistics : BaseStatistics + { + public string DisplayName { get; set; } + public DateTime AccountCreated { get; set; } + public string SipAddress { get; set; } + public bool InstantMessaing{ get; set; } + public bool MobileAccess { get; set; } + public bool Federation { get; set; } + public bool Conferencing { get; set; } + public bool EnterpriseVoice { get; set; } + public string EVPolicy { get; set; } + public string PhoneNumber { get; set; } + public string LyncUserPlan { get; set; } + } +} From daa87697937f542f5809e6e9d735b077c718c4a6 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 30 Oct 2012 15:39:28 -0400 Subject: [PATCH 015/107] Merge --- .../WebsitePanel.EnterpriseServer/Web.config | 14 ++------- .../ExchangeCreateMailbox.ascx.designer.cs | 28 +++++++++++++++++ .../OrganizationCreateUser.ascx.designer.cs | 28 +++++++++++++++++ .../HostedSolutionReport.ascx.designer.cs | 30 ++++++++++++++++++- 4 files changed, 88 insertions(+), 12 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 6c7d9d64..3766094f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,19 +5,11 @@ - - + - - - + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs index 9f748012..f58e8241 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs @@ -1,3 +1,31 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.designer.cs index c2a99a7c..c789b42f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.designer.cs @@ -1,3 +1,31 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.designer.cs index f2f81ab4..926f9f18 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.designer.cs @@ -1,4 +1,32 @@ -//------------------------------------------------------------------------------ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // From 21021eb089534ee1092ce0c307b8b87a33cf8d2d Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 30 Oct 2012 15:50:21 -0400 Subject: [PATCH 016/107] Added tag build-2.0.0.146 for changeset 363922c70d7d From 0033c11d69b2c3f65b817dc9f4151dd07a51443c Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 30 Oct 2012 15:54:25 -0400 Subject: [PATCH 017/107] Added tag build-2.0.0.147 for changeset e961bfc5154d From 645fa48d1ce0212ec20ce96b47dca81d120116cf Mon Sep 17 00:00:00 2001 From: robvde Date: Wed, 31 Oct 2012 10:22:51 +0400 Subject: [PATCH 018/107] Fixed: When webhosting netbios settings are empty, an attempt is made to configure a domain account. --- .../Code/WebServers/WebServerController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs index ca625b5c..d16da4d3 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs @@ -2490,7 +2490,7 @@ namespace WebsitePanel.EnterpriseServer WebServer server = GetWebServer(item.ServiceId); StringDictionary webSettings = ServerController.GetServiceSettings(item.ServiceId); - if (webSettings["WmSvc.NETBIOS"] != null) + if (!String.IsNullOrEmpty(webSettings["WmSvc.NETBIOS"])) { accountName = webSettings["WmSvc.NETBIOS"].ToString() + "\\" + accountName; } @@ -3258,7 +3258,7 @@ namespace WebsitePanel.EnterpriseServer WebServer server = GetWebServer(item.ServiceId); StringDictionary webSettings = ServerController.GetServiceSettings(item.ServiceId); - if (webSettings["WmSvc.NETBIOS"] != null) + if (!String.IsNullOrEmpty(webSettings["WmSvc.NETBIOS"])) { accountName = webSettings["WmSvc.NETBIOS"].ToString() + "\\" + accountName; } From 0cf9fb13dc5157f22c7278b96d931ea4ce71b62f Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 31 Oct 2012 09:07:15 -0400 Subject: [PATCH 019/107] Added tag build-2.0.0.148 for changeset 89ac927262c0 From 343539c25e577059687dd4b94a410916534c4273 Mon Sep 17 00:00:00 2001 From: robvde Date: Thu, 1 Nov 2012 09:41:10 +0400 Subject: [PATCH 020/107] Fixed: IP switch configuration made IPV6 aware Fixed: Message raised when public shared ip address is not configured when creating or switching to a site with a shared ip adddres and dns enabled. --- .../Common/BusinessErrorCodes.cs | 1 + .../Code/WebServers/WebServerController.cs | 57 +++++++++++++------ .../WebsitePanel.EnterpriseServer/Web.config | 13 ++++- .../WebsitePanel_SharedResources.ascx.resx | 3 + 4 files changed, 55 insertions(+), 19 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs index f6f8dfd8..ebe1183c 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs @@ -115,6 +115,7 @@ namespace WebsitePanel.EnterpriseServer public const int ERROR_WEB_SITE_SHARED_IP_ADDRESS_NOT_SPECIFIED = -608; public const int ERROR_WEB_SHARED_SSL_QUOTA_LIMIT = -609; public const int ERROR_GLOBALDNS_FOR_DEDICATEDIP = -610; + public const int ERROR_PUBLICSHAREDIP_FOR_SHAREDIP = -611; #endregion #region Mail diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs index d16da4d3..7c71cc05 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs @@ -172,15 +172,20 @@ namespace WebsitePanel.EnterpriseServer return AddWebSite(packageId, hostName, domainId, ipAddressId, false, true); } - private static Regex regIP = new Regex( - @"(?2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?2[0-4]\d|25" - + @"[0-5]|[01]?\d\d?)\.(?2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?" - + @"2[0-4]\d|25[0-5]|[01]?\d\d?)", - RegexOptions.IgnoreCase - | RegexOptions.CultureInvariant - | RegexOptions.IgnorePatternWhitespace - | RegexOptions.Compiled - ); + + private static bool IsValidIPAdddress(string addr) + { + System.Net.IPAddress ip; + if (System.Net.IPAddress.TryParse(addr, out ip)) + { + return ((ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6) | + (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)); + } + else + { + return false; + } + } public static int AddWebSite(int packageId, string hostName, int domainId, int packageAddressId, bool addInstantAlias, bool ignoreGlobalDNSRecords) @@ -270,14 +275,23 @@ namespace WebsitePanel.EnterpriseServer if (dedicatedIp) { - foreach (GlobalDnsRecord d in dnsRecords) + foreach (GlobalDnsRecord d in dnsRecords) { - if (!string.IsNullOrEmpty(d.ExternalIP)) - { - if (regIP.IsMatch(d.ExternalIP)) return BusinessErrorCodes.ERROR_GLOBALDNS_FOR_DEDICATEDIP; - } + if (!string.IsNullOrEmpty(d.ExternalIP)) + { + if (!IsValidIPAdddress(d.ExternalIP)) return BusinessErrorCodes.ERROR_GLOBALDNS_FOR_DEDICATEDIP; + } } - } + } + else + { + if (domain.ZoneItemId > 0) + { + StringDictionary settings = ServerController.GetServiceSettings(serviceId); + if (string.IsNullOrEmpty(settings["PublicSharedIP"])) + return BusinessErrorCodes.ERROR_PUBLICSHAREDIP_FOR_SHAREDIP; + } + } // prepare site bindings List bindings = new List(); @@ -681,7 +695,7 @@ namespace WebsitePanel.EnterpriseServer { if (!string.IsNullOrEmpty(d.ExternalIP)) { - if (regIP.IsMatch(d.ExternalIP)) return BusinessErrorCodes.ERROR_GLOBALDNS_FOR_DEDICATEDIP; + if (!IsValidIPAdddress(d.ExternalIP)) return BusinessErrorCodes.ERROR_GLOBALDNS_FOR_DEDICATEDIP; } } @@ -839,6 +853,8 @@ namespace WebsitePanel.EnterpriseServer if (siteItem == null) return BusinessErrorCodes.ERROR_WEB_SITE_PACKAGE_ITEM_NOT_FOUND; + + // place log record TaskManager.StartTask("WEB_SITE", "SWITCH_TO_SHARED_IP", siteItem.Name); TaskManager.ItemId = siteItemId; @@ -853,6 +869,15 @@ namespace WebsitePanel.EnterpriseServer if (ZoneInfo == null) throw new Exception("Parent zone not found"); + + if (ZoneInfo.ZoneItemId > 0) + { + StringDictionary settings = ServerController.GetServiceSettings(siteItem.ServiceId); + if (string.IsNullOrEmpty(settings["PublicSharedIP"])) + return BusinessErrorCodes.ERROR_PUBLICSHAREDIP_FOR_SHAREDIP; + + } + //cleanup certificates List certificates = GetCertificatesForSite(siteItemId); foreach (SSLCertificate c in certificates) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 3766094f..9f46e263 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,12 +5,19 @@ - + + - - + + 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 c7c849f9..9df134f2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -1059,6 +1059,9 @@ Invalid Global DNS entries in platform server configuration for dedicated IP address usage. Contact you platform administrator + + Invalid public shared ip address in platform server configuration for shared IP address usage. Contact you platform administrator + Specified mail domain already exists on the service From 8f694e075682266b12087f8cf4a59556b303d814 Mon Sep 17 00:00:00 2001 From: robvde Date: Thu, 1 Nov 2012 10:29:42 +0400 Subject: [PATCH 021/107] Fixed; HostedHeader mode disabled creates wrong bindings, dns records when creating instant alias --- .../Code/Servers/ServerController.cs | 18 +++++- .../Code/WebServers/WebServerController.cs | 57 ++++++++++++++++--- 2 files changed, 63 insertions(+), 12 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Servers/ServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Servers/ServerController.cs index 3b856795..d4836378 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Servers/ServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Servers/ServerController.cs @@ -2495,10 +2495,20 @@ namespace WebsitePanel.EnterpriseServer instantAlias = GetDomainItem(instantAliasId); } + string parentZone = domain.ZoneName; + if (string.IsNullOrEmpty(parentZone)) + { + DomainInfo parentDomain = GetDomain(domain.DomainId); + parentZone = parentDomain.DomainName; + } + + if (domain.WebSiteId > 0) { WebServerController.AddWebSitePointer(domain.WebSiteId, - (domain.DomainName.Replace("." + domain.ZoneName, "") == domain.ZoneName) ? "" : domain.DomainName.Replace("." + domain.ZoneName, ""), + ((domain.DomainName.Replace("." + parentZone, "") == parentZone) | + (domain.DomainName == parentZone)) + ? "" : domain.DomainName.Replace("." + parentZone, ""), instantAlias.DomainId); } @@ -2507,12 +2517,14 @@ namespace WebsitePanel.EnterpriseServer List domains = GetDomainsByDomainItemId(domain.DomainId); foreach (DomainInfo d in domains) { + if (d.WebSiteId > 0) { WebServerController.AddWebSitePointer(d.WebSiteId, - (d.DomainName.Replace("." + domain.ZoneName, "") == domain.ZoneName) ? "" : d.DomainName.Replace("." + domain.ZoneName, ""), + ((d.DomainName.Replace("." + parentZone, "") == parentZone) | + (d.DomainName == parentZone)) + ? "" : d.DomainName.Replace("." + parentZone, ""), instantAlias.DomainId); - } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs index 7c71cc05..1590849d 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs @@ -709,7 +709,7 @@ namespace WebsitePanel.EnterpriseServer // remove all web site pointers DomainInfo domain = ServerController.GetDomain(siteItem.Name); - DomainInfo ZoneInfo = ServerController.GetDomain(domain.ZoneName); + DomainInfo ZoneInfo = ServerController.GetDomain(domain.DomainItemId); if (ZoneInfo == null) throw new Exception("Parent zone not found"); @@ -775,18 +775,38 @@ namespace WebsitePanel.EnterpriseServer // associate IP with web site ServerController.AddItemIPAddress(siteItemId, ipAddressId); - + + + string parentZone = domain.ZoneName; + if (string.IsNullOrEmpty(parentZone)) + { + DomainInfo parentDomain = ServerController.GetDomain(domain.DomainItemId); + parentZone = parentDomain.DomainName; + } + AddWebSitePointer(siteItemId, - (domain.DomainName.Replace("." + domain.ZoneName, "") == domain.ZoneName) ? "": domain.DomainName.Replace("." + domain.ZoneName,"") + ((domain.DomainName.Replace("." + parentZone, "") == parentZone) | + (domain.DomainName == parentZone)) + ? "" : domain.DomainName.Replace("." + parentZone, "") , ZoneInfo.DomainId, true, true, true); foreach (DomainInfo pointer in pointers) { - ZoneInfo = ServerController.GetDomain(pointer.ZoneName); + string pointerParentZone = pointer.ZoneName; + if (string.IsNullOrEmpty(pointerParentZone)) + { + DomainInfo parentDomain = ServerController.GetDomain(pointer.DomainItemId); + pointerParentZone = parentDomain.DomainName; + } + + + ZoneInfo = ServerController.GetDomain(pointerParentZone); AddWebSitePointer(siteItemId, - (pointer.DomainName.Replace("." + pointer.ZoneName, "") == pointer.ZoneName) ? "" : pointer.DomainName.Replace("." + pointer.ZoneName, "") + ((pointer.DomainName.Replace("." + pointerParentZone, "") == pointerParentZone) | + (pointer.DomainName == pointerParentZone)) + ? "" : pointer.DomainName.Replace("." + pointerParentZone, "") , ZoneInfo.DomainId, true, true, true); } @@ -864,7 +884,7 @@ namespace WebsitePanel.EnterpriseServer IPAddressInfo ip; DomainInfo domain = ServerController.GetDomain(siteItem.Name); - DomainInfo ZoneInfo = ServerController.GetDomain(domain.ZoneName); + DomainInfo ZoneInfo = ServerController.GetDomain(domain.DomainItemId); if (ZoneInfo == null) throw new Exception("Parent zone not found"); @@ -956,16 +976,35 @@ namespace WebsitePanel.EnterpriseServer siteItem.SiteIPAddressId = 0; PackageController.UpdatePackageItem(siteItem); + string parentZone = domain.ZoneName; + if (string.IsNullOrEmpty(parentZone)) + { + DomainInfo parentDomain = ServerController.GetDomain(domain.DomainItemId); + parentZone = parentDomain.DomainName; + } + AddWebSitePointer(siteItemId, - (domain.DomainName.Replace("." + domain.ZoneName, "") == domain.ZoneName) ? "" : domain.DomainName.Replace("." + domain.ZoneName, "") + ((domain.DomainName.Replace("." + parentZone, "") == parentZone) | + (domain.DomainName == parentZone)) + ? "" : domain.DomainName.Replace("." + parentZone, "") , ZoneInfo.DomainId, true, true, true); foreach (DomainInfo pointer in pointers) { - ZoneInfo = ServerController.GetDomain(pointer.ZoneName); + string pointerParentZone = pointer.ZoneName; + if (string.IsNullOrEmpty(pointerParentZone)) + { + DomainInfo parentDomain = ServerController.GetDomain(pointer.DomainItemId); + pointerParentZone = parentDomain.DomainName; + } + + + ZoneInfo = ServerController.GetDomain(pointerParentZone); AddWebSitePointer(siteItemId, - (pointer.DomainName.Replace("." + pointer.ZoneName, "") == pointer.ZoneName) ? "" : pointer.DomainName.Replace("." + pointer.ZoneName, "") + ((pointer.DomainName.Replace("." + pointerParentZone, "") == pointerParentZone) | + (pointer.DomainName == pointerParentZone)) + ? "" : pointer.DomainName.Replace("." + pointerParentZone, "") , ZoneInfo.DomainId, true, true, true); } From 11f21b1a1599b1e0413a2e4dfab6c32f04944b39 Mon Sep 17 00:00:00 2001 From: robvde Date: Thu, 1 Nov 2012 10:55:46 +0400 Subject: [PATCH 022/107] Fixed: Domain Select COntrol: HideInstantAliases will not show instant aliases --- .../WebsitePanel/DomainsSelectDomainControl.ascx.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx.cs index 5678f285..cc723f6a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx.cs @@ -148,7 +148,8 @@ namespace WebsitePanel.Portal } } } - else if (HideInstantAlias && domain.IsInstantAlias) + + if (HideInstantAlias && domain.IsInstantAlias) continue; else if (HideMailDomains && domain.MailDomainId > 0) continue; From 74dc494734dded6a0b5337d412da807f6cca3a3d Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 1 Nov 2012 08:27:44 -0400 Subject: [PATCH 023/107] Merge --- .../WebsitePanel.EnterpriseServer/Web.config | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 9f46e263..3766094f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,19 +5,12 @@ - - + + + - - From 2004476550f61ce3af854313ebc03ebdb0c57d59 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 1 Nov 2012 08:37:35 -0400 Subject: [PATCH 024/107] Added tag build-2.0.0.149 for changeset e324125e3451 From 892c5307d55b7fc048ecb8c3e1c4029488250092 Mon Sep 17 00:00:00 2001 From: robvde Date: Fri, 2 Nov 2012 12:32:31 +0400 Subject: [PATCH 025/107] Added the ability to hide quotas Domain Aliases hidden from hosting plans Domain Aliases quota verification disabled --- WebsitePanel/Database/update_db.sql | 15 +++++++++++++++ .../Code/Servers/ServerController.cs | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 4059e0db..2b2e2222 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -559,6 +559,17 @@ GO UPDATE [dbo].[ResourceGroups] SET ShowGroup=1 GO +IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='Quotas' AND COLS.name='ShowGroup') +BEGIN +ALTER TABLE [dbo].[Quotas] ADD [HideQuota] [bit] NULL +END +GO + +UPDATE [dbo].[Quotas] SET [HideQuota] = 1 WHERE [QuotaName] = N'OS.DomainPointers' +GO + + + /****** Object: Table [dbo].[ExchangeAccounts] Extend Exchange Accounts with SubscriberNumber ******/ IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='Users' AND COLS.name='SubscriberNumber') @@ -3925,6 +3936,7 @@ SELECT dbo.GetPackageAllocatedQuota(@PackageID, Q.QuotaID) AS ParentQuotaValue FROM Quotas AS Q LEFT OUTER JOIN HostingPlanQuotas AS HPQ ON Q.QuotaID = HPQ.QuotaID AND HPQ.PlanID = @PlanID +WHERE Q.HideQuota IS NULL OR Q.HideQuota = 0 ORDER BY Q.QuotaOrder RETURN GO @@ -6424,3 +6436,6 @@ BEGIN INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_HOSTED_SOLUTION_REPORT', N'LYNC_REPORT', N'Boolean', N'true', 5) END GO + + + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Servers/ServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Servers/ServerController.cs index d4836378..b1cd15f0 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Servers/ServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Servers/ServerController.cs @@ -1847,8 +1847,8 @@ namespace WebsitePanel.EnterpriseServer else if (isDomainPointer) { // domain pointer - if (PackageController.GetPackageQuota(packageId, Quotas.OS_DOMAINPOINTERS).QuotaExhausted) - return BusinessErrorCodes.ERROR_DOMAIN_QUOTA_LIMIT; + //if (PackageController.GetPackageQuota(packageId, Quotas.OS_DOMAINPOINTERS).QuotaExhausted) + //return BusinessErrorCodes.ERROR_DOMAIN_QUOTA_LIMIT; } else { From 9188c649794440e0671630d5c705227bf8f2ed2b Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Fri, 2 Nov 2012 08:19:33 -0400 Subject: [PATCH 026/107] Added tag build-2.0.0.150 for changeset f57a16601d33 From bc8c122d8128f3ef036ce2765e1f69b5e3eeeba0 Mon Sep 17 00:00:00 2001 From: VoosW Date: Fri, 2 Nov 2012 20:18:32 +0100 Subject: [PATCH 027/107] Adapted Enterprise Importer for 2.0: samAccountName is now needed for more (all) kinds of accounts, make sure that it is imported correctly --- .../ApplicationForm.cs | 1 + .../WebsitePanel.Import.Enterprise/Global.cs | 7 +++++ .../OrganizationImporter.cs | 27 +++++++++++++------ 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/ApplicationForm.cs b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/ApplicationForm.cs index 1e1984c2..fb403a0a 100644 --- a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/ApplicationForm.cs +++ b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/ApplicationForm.cs @@ -100,6 +100,7 @@ namespace WebsitePanel.Import.Enterprise Global.TempDomain = serviceSettings["TempDomain"]; ServerInfo serverInfo = ServerController.GetServerById(serviceInfo.ServerId); Global.ADRootDomain = serverInfo.ADRootDomain; + Global.NetBiosDomain = ActiveDirectoryUtils.GetNETBIOSDomainName(Global.ADRootDomain); } private void OnBrowseOU(object sender, EventArgs e) diff --git a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/Global.cs b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/Global.cs index 0b279f17..1e5a928d 100644 --- a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/Global.cs +++ b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/Global.cs @@ -58,6 +58,13 @@ namespace WebsitePanel.Import.Enterprise set { aDRootDomain = value; } } + private static string netBiosDomain; + public static string NetBiosDomain + { + get { return netBiosDomain; } + set { netBiosDomain = value; } + } + public static PackageInfo Space; public static string TempDomain; diff --git a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/OrganizationImporter.cs b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/OrganizationImporter.cs index 7b3ff1bb..21b1c5f5 100644 --- a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/OrganizationImporter.cs +++ b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/OrganizationImporter.cs @@ -757,15 +757,19 @@ namespace WebsitePanel.Import.Enterprise if (EmailAddressExists(email)) return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; - - if (AccountExists(accountName)) throw new Exception(string.Format("Account {0} already exists", accountName)); string displayName = (string)entry.Properties["displayName"].Value; + string samName = (string)entry.Properties["sAMAccountName"].Value; + // this should really NEVER happen - an AD account without sAMAccountName?! + if (string.IsNullOrEmpty(samName)) + throw new Exception("SAMAccountName is not specified"); + // add Netbios-Domainname before samAccountName - format in the database + samName = Global.NetBiosDomain + "\\" + samName; - int userId = AddOrganizationUser(itemId, accountName, displayName, email, string.Empty); + int userId = AddOrganizationUser(itemId, accountName, displayName, email, samName, string.Empty); AddAccountEmailAddress(userId, email); //account type @@ -796,7 +800,7 @@ namespace WebsitePanel.Import.Enterprise return userId; } - UpdateExchangeAccount(userId, accountName, accountType, displayName, email, false, string.Empty, string.Empty, string.Empty); + UpdateExchangeAccount(userId, accountName, accountType, displayName, email, false, string.Empty, samName, string.Empty); string defaultEmail = (string)entry.Properties["extensionAttribute3"].Value; @@ -847,7 +851,7 @@ namespace WebsitePanel.Import.Enterprise if (email != null && email.ToLower().StartsWith("smtp:")) email = email.Substring(5); - + // no sAMAccountName for contacts - so String.Empty is OK int accountId = AddAccount(itemId, ExchangeAccountType.Contact, accountName, displayName, email, false, 0, string.Empty, null); Log.WriteEnd("Contact imported"); @@ -886,7 +890,14 @@ namespace WebsitePanel.Import.Enterprise if (EmailAddressExists(email)) return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; - int accountId = AddAccount(itemId, ExchangeAccountType.DistributionList, accountName, displayName, email, false, 0, string.Empty, null); + string samName = (string)entry.Properties["sAMAccountName"].Value; + // this should really NEVER happen - an AD group without sAMAccountName?! + if (string.IsNullOrEmpty(samName)) + throw new Exception("SAMAccountName is not specified"); + // add Netbios-Domainname before samAccountName - format in the database + samName = Global.NetBiosDomain + "\\" + samName; + + int accountId = AddAccount(itemId, ExchangeAccountType.DistributionList, accountName, displayName, email, false, 0, samName, null); AddAccountEmailAddress(accountId, email); string defaultEmail = (string)entry.Properties["extensionAttribute3"].Value; @@ -938,10 +949,10 @@ namespace WebsitePanel.Import.Enterprise mailboxManagerActions.ToString(), samAccountName, CryptoUtils.Encrypt(accountPassword),0, string.Empty); } - private static int AddOrganizationUser(int itemId, string accountName, string displayName, string email, string accountPassword) + private static int AddOrganizationUser(int itemId, string accountName, string displayName, string email, string samAccountName, string accountPassword) { return DataProvider.AddExchangeAccount(itemId, (int)ExchangeAccountType.User, accountName, displayName, email, false, string.Empty, - string.Empty, CryptoUtils.Encrypt(accountPassword),0 , string.Empty); + samAccountName, CryptoUtils.Encrypt(accountPassword), 0 , string.Empty); } From d367078cc6f6f2a60c0e41aa46330be3c8e26c9b Mon Sep 17 00:00:00 2001 From: VoosW Date: Tue, 6 Nov 2012 18:39:48 +0100 Subject: [PATCH 028/107] change GetItemIdByOrganizationId to reflect change of column length in underlying table --- WebsitePanel/Database/update_db.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 2b2e2222..8d25b4dc 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -6439,3 +6439,19 @@ GO +ALTER PROCEDURE [dbo].[GetItemIdByOrganizationId] + @OrganizationId nvarchar(128) +AS +BEGIN + SET NOCOUNT ON; + + SELECT + ItemID + FROM + dbo.ExchangeOrganizations + WHERE + OrganizationId = @OrganizationId +END +GO + + From 71a68cccdca0fada45aad0f58dacd0db853fc958 Mon Sep 17 00:00:00 2001 From: VoosW Date: Tue, 6 Nov 2012 18:59:11 +0100 Subject: [PATCH 029/107] also adapt intall_db.sql to reflect changed column length --- WebsitePanel/Database/install_db.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel/Database/install_db.sql b/WebsitePanel/Database/install_db.sql index 8eb8ed16..25b32209 100644 --- a/WebsitePanel/Database/install_db.sql +++ b/WebsitePanel/Database/install_db.sql @@ -6220,7 +6220,7 @@ GO CREATE PROCEDURE [dbo].[GetItemIdByOrganizationId] - @OrganizationId nvarchar(10) + @OrganizationId nvarchar(128) AS BEGIN SET NOCOUNT ON; From 6c60977de5e37897236a1ce6c9fa160149fea80d Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 6 Nov 2012 14:14:46 -0500 Subject: [PATCH 030/107] Added tag build-2.0.0.151 for changeset 52a719006602 From 867e6a96f2cbd8b5c994a2f415db59d49c1c2e58 Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 11 Nov 2012 22:44:43 +0400 Subject: [PATCH 031/107] Update: Lync: Support for multiple sipdomains per tenant. Fixed: Hosted Organizations: user principal name updated when settings primary email address. User principal name will not change when changing the primary email address. SIP address is based on EmailAddress --- .../WebsitePanel.EnterpriseServer/Web.config | 14 ++++- .../HostedSolution/ActiveDirectoryUtils.cs | 21 +++++++ .../Exchange2007.cs | 2 +- .../Lync2010.cs | 60 ++++++++++++++++--- 4 files changed, 86 insertions(+), 11 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 3766094f..6c7d9d64 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,11 +5,19 @@ - + + - - + + + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs index 3c460dbb..ac11cdef 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs @@ -159,6 +159,14 @@ namespace WebsitePanel.Providers.HostedSolution collection.Value = value; } + public static void SetADObjectPropertyValue(DirectoryEntry oDE, string name, string[] values) + { + PropertyValueCollection collection = oDE.Properties[name]; + collection.Value = values; + } + + + public static void SetADObjectPropertyValue(DirectoryEntry oDE, string name, Guid value) { PropertyValueCollection collection = oDE.Properties[name]; @@ -177,6 +185,19 @@ namespace WebsitePanel.Providers.HostedSolution return entry.Properties.Contains(name) ? entry.Properties[name][0] : null; } + public static string[] GetADObjectPropertyMultiValue(DirectoryEntry entry, string name) + { + if (!entry.Properties.Contains(name)) + return null; + + List returnList = new List(); + for (int i = 0; i < entry.Properties[name].Count; i++) + returnList.Add(entry.Properties[name][i].ToString()); + + return returnList.ToArray(); + } + + public static string GetADObjectStringProperty(DirectoryEntry entry, string name) { object ret = GetADObjectProperty(entry, name); diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs index 8f2f63e1..a338e30c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs @@ -2591,7 +2591,7 @@ namespace WebsitePanel.Providers.HostedSolution Command cmd = new Command("Set-Mailbox"); cmd.Parameters.Add("Identity", accountName); cmd.Parameters.Add("PrimarySmtpAddress", primaryEmail); - cmd.Parameters.Add("UserPrincipalName", primaryEmail); + //cmd.Parameters.Add("UserPrincipalName", primaryEmail); cmd.Parameters.Add("WindowsEmailAddress", primaryEmail); ExecuteShellCommand(runSpace, cmd); diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs index 33c56efe..944788a5 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs @@ -288,11 +288,14 @@ namespace WebsitePanel.Providers.HostedSolution Guid tenantId = (Guid)GetPSObjectProperty(result[0], "TenantId"); // create sip domain - DeleteSipDomain(runSpace, sipDomain); - - //clear the msRTCSIP-Domains, TenantID, ObjectID string path = AddADPrefix(GetOrganizationPath(organizationId)); DirectoryEntry ou = ActiveDirectoryUtils.GetADObject(path); + string[] sipDs = (string[])ActiveDirectoryUtils.GetADObjectPropertyMultiValue(ou, "msRTCSIP-Domains"); + + foreach (string sipD in sipDs) + DeleteSipDomain(runSpace, sipD); + + //clear the msRTCSIP-Domains, TenantID, ObjectID ActiveDirectoryUtils.ClearADObjectPropertyValue(ou, "msRTCSIP-Domains"); ActiveDirectoryUtils.ClearADObjectPropertyValue(ou, "msRTCSIP-TenantId"); ActiveDirectoryUtils.ClearADObjectPropertyValue(ou, "msRTCSIP-ObjectId"); @@ -383,11 +386,56 @@ namespace WebsitePanel.Providers.HostedSolution { tenantId = (Guid)GetPSObjectProperty(result[0], "TenantId"); + string[] tmp = userUpn.Split('@'); + if (tmp.Length < 2) return false; + + // Get SipDomains and verify existence + bool bSipDomainExists = false; + cmd = new Command("Get-CsSipDomain"); + Collection sipDomains = ExecuteShellCommand(runSpace, cmd, false); + + foreach (PSObject domain in sipDomains) + { + string d = (string)GetPSObjectProperty(domain, "Name"); + if (d.ToLower() == tmp[1].ToLower()) + { + bSipDomainExists = true; + break; + } + } + + string path = string.Empty; + + if (!bSipDomainExists) + { + // Create Sip Domain + cmd = new Command("New-CsSipDomain"); + cmd.Parameters.Add("Identity", tmp[1].ToLower()); + ExecuteShellCommand(runSpace, cmd, false); + + transaction.RegisterNewSipDomain(tmp[1].ToLower()); + + + path = AddADPrefix(GetOrganizationPath(organizationId)); + DirectoryEntry ou = ActiveDirectoryUtils.GetADObject(path); + string[] sipDs = (string[])ActiveDirectoryUtils.GetADObjectPropertyMultiValue(ou, "msRTCSIP-Domains"); + List listSipDs = new List(); + listSipDs.AddRange(sipDs); + listSipDs.Add(tmp[1]); + + ActiveDirectoryUtils.SetADObjectPropertyValue(ou, "msRTCSIP-Domains", listSipDs.ToArray()); + ou.CommitChanges(); + + //Create simpleurls + CreateSimpleUrl(runSpace, tmp[1].ToLower(), tenantId); + transaction.RegisterNewSimpleUrl(tmp[1].ToLower(), tenantId.ToString()); + } + //enable for lync cmd = new Command("Enable-CsUser"); cmd.Parameters.Add("Identity", userUpn); cmd.Parameters.Add("RegistrarPool", PoolFQDN); - cmd.Parameters.Add("SipAddressType", "UserPrincipalName"); + cmd.Parameters.Add("SipAddressType", "EmailAddress"); ExecuteShellCommand(runSpace, cmd); transaction.RegisterNewCsUser(userUpn); @@ -397,13 +445,11 @@ namespace WebsitePanel.Providers.HostedSolution cmd.Parameters.Add("Identity", userUpn); result = ExecuteShellCommand(runSpace, cmd); - - string path = AddADPrefix(GetResultObjectDN(result)); + path = AddADPrefix(GetResultObjectDN(result)); DirectoryEntry user = ActiveDirectoryUtils.GetADObject(path); ActiveDirectoryUtils.SetADObjectPropertyValue(user, "msRTCSIP-GroupingID", tenantId); ActiveDirectoryUtils.SetADObjectPropertyValue(user, "msRTCSIP-TenantId", tenantId); - string[] tmp = userUpn.Split('@'); if (tmp.Length > 0) { string Url = SimpleUrlRoot + tmp[1]; From 2b12a1050bc851eb9ce07cb16efc3ade4fe0f30b Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sun, 11 Nov 2012 19:45:08 -0500 Subject: [PATCH 032/107] Merge --- .../WebsitePanel.EnterpriseServer/Web.config | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 6c7d9d64..3766094f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,19 +5,11 @@ - - + - - - + + From 1bb0633ad343267fab44bd4a414ce9f982f7c39e Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sun, 11 Nov 2012 19:51:34 -0500 Subject: [PATCH 033/107] Added tag build-2.0.0.152 for changeset 4d0ce52490f8 From 228219f5c34cba687be441c8ae5ef289628389e3 Mon Sep 17 00:00:00 2001 From: robvde Date: Mon, 12 Nov 2012 08:26:26 +0400 Subject: [PATCH 034/107] Fixed: Enterprise Organization Report did not show Lync user count --- .../Code/HostedSolution/ReportController.cs | 27 ++++++++++--------- .../HostedSolution/LyncStatisticsReport.cs | 3 +-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs index fb322d30..5d9861fb 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs @@ -310,18 +310,6 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution { TaskManager.WriteError(ex); } - } - - if (report.OrganizationReport != null) - { - try - { - PopulateOrganizationStatisticsReport(org, report, topReseller); - } - catch(Exception ex) - { - TaskManager.WriteError(ex); - } } if (report.LyncReport != null) @@ -335,6 +323,19 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution TaskManager.WriteError(ex); } } + + if (report.OrganizationReport != null) + { + try + { + PopulateOrganizationStatisticsReport(org, report, topReseller); + } + catch(Exception ex) + { + TaskManager.WriteError(ex); + } + } + } @@ -517,7 +518,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution stats.InstantMessaing = plan.IM; stats.MobileAccess = plan.Mobility; stats.LyncUserPlan = plan.LyncUserPlanName; - + stats.DisplayName = lyncUser.DisplayName; } catch (Exception ex) { diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncStatisticsReport.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncStatisticsReport.cs index f62e4def..104cb4a5 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncStatisticsReport.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncStatisticsReport.cs @@ -52,7 +52,6 @@ namespace WebsitePanel.Providers.HostedSolution sb.AppendFormat("{0},", ToCsvString(item.OrganizationID)); sb.AppendFormat("{0},", ToCsvString(item.DisplayName)); - sb.AppendFormat("{0},", ToCsvString(item.AccountCreated)); sb.AppendFormat("{0},", ToCsvString(item.SipAddress)); sb.AppendFormat("{0},", ToCsvString(item.PhoneNumber)); @@ -72,7 +71,7 @@ namespace WebsitePanel.Providers.HostedSolution private static void AddCSVHeader(StringBuilder sb) { - sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Organization Created,Organization ID,Display Name,Account Created,SipAddress,PhoneNumber,Conferencing,EnterpriseVoice,Federation,InstantMessaging,MobileAccess"); + sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Organization Created,Organization ID,Display Name,SipAddress,PhoneNumber,Conferencing,EnterpriseVoice,Federation,InstantMessaging,MobileAccess"); } } } From cc106329a68b997128db57ce354465d199c8f49c Mon Sep 17 00:00:00 2001 From: robvde Date: Mon, 12 Nov 2012 08:50:25 +0400 Subject: [PATCH 035/107] FIXED wsp-10028 Domain Search is yielding incorrect results --- WebsitePanel/Database/update_db.sql | 140 ++++++++++++++++++ .../WebsitePanel.EnterpriseServer/Web.config | 14 +- 2 files changed, 151 insertions(+), 3 deletions(-) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 8d25b4dc..4b2adf86 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -6455,3 +6455,143 @@ END GO + + + + +ALTER PROCEDURE [dbo].[SearchServiceItemsPaged] +( + @ActorID int, + @UserID int, + @ItemTypeID int, + @FilterValue nvarchar(50) = '', + @SortColumn nvarchar(50), + @StartRow int, + @MaximumRows int +) +AS + + +-- check rights +IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0 +RAISERROR('You are not allowed to access this account', 16, 1) + +-- build query and run it to the temporary table +DECLARE @sql nvarchar(2000) + +IF @ItemTypeID <> 13 +BEGIN + SET @sql = ' + DECLARE @EndRow int + SET @EndRow = @StartRow + @MaximumRows + DECLARE @Items TABLE + ( + ItemPosition int IDENTITY(1,1), + ItemID int + ) + INSERT INTO @Items (ItemID) + SELECT + SI.ItemID + FROM ServiceItems AS SI + INNER JOIN Packages AS P ON P.PackageID = SI.PackageID + INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID + WHERE + dbo.CheckUserParent(@UserID, P.UserID) = 1 + AND SI.ItemTypeID = @ItemTypeID + ' + + IF @FilterValue <> '' + SET @sql = @sql + ' AND SI.ItemName LIKE @FilterValue ' + + IF @SortColumn = '' OR @SortColumn IS NULL + SET @SortColumn = 'ItemName' + + SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' ' + + SET @sql = @sql + ' SELECT COUNT(ItemID) FROM @Items; + SELECT + + SI.ItemID, + SI.ItemName, + + P.PackageID, + P.PackageName, + P.StatusID, + P.PurchaseDate, + + -- user + P.UserID, + U.Username, + U.FirstName, + U.LastName, + U.FullName, + U.RoleID, + U.Email + FROM @Items AS I + INNER JOIN ServiceItems AS SI ON I.ItemID = SI.ItemID + INNER JOIN Packages AS P ON SI.PackageID = P.PackageID + INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID + WHERE I.ItemPosition BETWEEN @StartRow AND @EndRow' +END +ELSE +BEGIN + + SET @SortColumn = REPLACE(@SortColumn, 'ItemName', 'DomainName') + + SET @sql = ' + DECLARE @EndRow int + SET @EndRow = @StartRow + @MaximumRows + DECLARE @Items TABLE + ( + ItemPosition int IDENTITY(1,1), + ItemID int + ) + INSERT INTO @Items (ItemID) + SELECT + D.DomainID + FROM Domains AS D + INNER JOIN Packages AS P ON P.PackageID = D.PackageID + INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID + WHERE + dbo.CheckUserParent(@UserID, P.UserID) = 1 + ' + + IF @FilterValue <> '' + SET @sql = @sql + ' AND D.DomainName LIKE @FilterValue ' + + IF @SortColumn = '' OR @SortColumn IS NULL + SET @SortColumn = 'DomainName' + + SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' ' + + SET @sql = @sql + ' SELECT COUNT(ItemID) FROM @Items; + SELECT + + D.DomainID AS ItemID, + D.DomainName AS ItemName, + + P.PackageID, + P.PackageName, + P.StatusID, + P.PurchaseDate, + + -- user + P.UserID, + U.Username, + U.FirstName, + U.LastName, + U.FullName, + U.RoleID, + U.Email + FROM @Items AS I + INNER JOIN Domains AS D ON I.ItemID = D.DomainID + INNER JOIN Packages AS P ON D.PackageID = P.PackageID + INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID + WHERE I.ItemPosition BETWEEN @StartRow AND @EndRow AND D.IsDomainPointer=0' +END + +exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @UserID int, @FilterValue nvarchar(50), @ItemTypeID int, @ActorID int', +@StartRow, @MaximumRows, @UserID, @FilterValue, @ItemTypeID, @ActorID + +RETURN +GO \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 3766094f..6c7d9d64 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,11 +5,19 @@ - + + - - + + + From db7bba2ea140cc9f1f317dd5bdc621f2808a0316 Mon Sep 17 00:00:00 2001 From: robvde Date: Mon, 12 Nov 2012 13:20:20 +0400 Subject: [PATCH 036/107] Revived the ability to add a mail pointer when creating a new domain --- .../Sources/WebsitePanel.EnterpriseServer/Web.config | 4 ++-- .../DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 6c7d9d64..27a5f82b 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -9,7 +9,7 @@ --> - + @@ -17,7 +17,7 @@ --> - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs index 4a2dab6d..9fe39c8f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs @@ -106,7 +106,7 @@ namespace WebsitePanel.Portal WebSitesList.DataBind(); } - if ((type == DomainType.DomainPointer || (type == DomainType.Domain && cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaAllocatedValue == 0)) && !IsPostBack) + if ((type == DomainType.DomainPointer || (type == DomainType.Domain && !cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaExhausted)) && !IsPostBack) { // bind mail domains MailDomainsList.DataSource = ES.Services.MailServers.GetMailDomains(PanelSecurity.PackageId, false); @@ -135,7 +135,7 @@ namespace WebsitePanel.Portal WebSitesList.Enabled = PointWebSite.Checked; // point mail domain - PointMailDomainPanel.Visible = (type == DomainType.DomainPointer || (type == DomainType.Domain && cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaAllocatedValue == 0)) + PointMailDomainPanel.Visible = (type == DomainType.DomainPointer || (type == DomainType.Domain && !cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaExhausted)) && cntx.Groups.ContainsKey(ResourceGroups.Mail) && MailDomainsList.Items.Count > 0; MailDomainsList.Enabled = PointMailDomain.Checked; @@ -212,7 +212,7 @@ namespace WebsitePanel.Portal pointWebSiteId = Utils.ParseInt(WebSitesList.SelectedValue, 0); } - if (type == DomainType.DomainPointer || (type == DomainType.Domain && cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaAllocatedValue == 0)) + if (type == DomainType.DomainPointer || (type == DomainType.Domain && !cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaExhausted)) { if (PointMailDomain.Checked && MailDomainsList.Items.Count > 0) pointMailDomainId = Utils.ParseInt(MailDomainsList.SelectedValue, 0); From 651f129e67935670dcda203b2aec99dbd0fabd8f Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Mon, 12 Nov 2012 07:31:38 -0500 Subject: [PATCH 037/107] Merge --- .../WebsitePanel.EnterpriseServer/Web.config | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 27a5f82b..3766094f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,19 +5,11 @@ - - + - - - + + From 25f5664b8c38076cf93a4d8648354f3994eb35bd Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Mon, 12 Nov 2012 07:38:02 -0500 Subject: [PATCH 038/107] Added tag build-2.0.0.153 for changeset 1b36399c5c0f From 14d2507925905d3e7f6124d75a661938bfdb1ecb Mon Sep 17 00:00:00 2001 From: robvde Date: Mon, 12 Nov 2012 18:21:18 +0400 Subject: [PATCH 039/107] Fixed: Enterprise Reporting : Set initial values for Lync --- .../Code/HostedSolution/ReportController.cs | 3 +++ WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs index 5d9861fb..8f3d5235 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs @@ -125,6 +125,9 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution item.TotalCRMUsers = crmOrganizationStatistics.Count; } + item.TotalLyncUsers = 0; + item.TotalLyncEVUsers = 0; + if (report.LyncReport != null) { List lyncOrganizationStatistics = diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 27a5f82b..6c7d9d64 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -9,7 +9,7 @@ --> - + @@ -17,7 +17,7 @@ --> - + From 1d7656ed1b67e8a0f8b4c8019a16c8c5dcdac17f Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Mon, 12 Nov 2012 09:50:54 -0500 Subject: [PATCH 040/107] Merge --- .../WebsitePanel.EnterpriseServer/Web.config | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 6c7d9d64..3766094f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,19 +5,11 @@ - - + - - - + + From 57ab6aa19ed7c4e05ad8cfb26494acd3dd606c07 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Mon, 12 Nov 2012 10:05:37 -0500 Subject: [PATCH 041/107] Added tag build-2.0.0.154 for changeset afaac034d4b6 From e5a5bae7647da437122aeee96c719b69b283e185 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Mon, 12 Nov 2012 10:11:11 -0500 Subject: [PATCH 042/107] Added tag build-2.0.0.155 for changeset cd5d71169c79 From 3b6ee6427c78850c2a2e132477b227aa0ec5330a Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Mon, 12 Nov 2012 18:32:19 -0500 Subject: [PATCH 043/107] Undo some changes having to do with UPN when changing Primary Exchange Email Address. Changed Lync address to be based On UPN. --- .../WebsitePanel.Providers.HostedSolution/Exchange2007.cs | 2 +- .../Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs index a338e30c..8f2f63e1 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs @@ -2591,7 +2591,7 @@ namespace WebsitePanel.Providers.HostedSolution Command cmd = new Command("Set-Mailbox"); cmd.Parameters.Add("Identity", accountName); cmd.Parameters.Add("PrimarySmtpAddress", primaryEmail); - //cmd.Parameters.Add("UserPrincipalName", primaryEmail); + cmd.Parameters.Add("UserPrincipalName", primaryEmail); cmd.Parameters.Add("WindowsEmailAddress", primaryEmail); ExecuteShellCommand(runSpace, cmd); diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs index 944788a5..ed619edb 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs @@ -435,7 +435,7 @@ namespace WebsitePanel.Providers.HostedSolution cmd = new Command("Enable-CsUser"); cmd.Parameters.Add("Identity", userUpn); cmd.Parameters.Add("RegistrarPool", PoolFQDN); - cmd.Parameters.Add("SipAddressType", "EmailAddress"); + cmd.Parameters.Add("SipAddressType", "UserPrincipalName"); ExecuteShellCommand(runSpace, cmd); transaction.RegisterNewCsUser(userUpn); From 9e639141e157da0ddd5857b48eca1e2fce61bf60 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Mon, 12 Nov 2012 18:50:43 -0500 Subject: [PATCH 044/107] Added tag build-2.0.0.156 for changeset 534ccb0978ac From 20ea2117d0e80aeed32bcc5c8cf155df7c999601 Mon Sep 17 00:00:00 2001 From: robvde Date: Tue, 13 Nov 2012 08:03:20 +0400 Subject: [PATCH 045/107] Fixed: Add Mail Pointer shows website pointers as well --- .../WebsitePanel.EnterpriseServer/Web.config | 14 ++++++++-- .../WebsitePanel/MailDomainsAddPointer.ascx | 2 +- .../MailDomainsAddPointer.ascx.designer.cs | 28 ------------------- 3 files changed, 12 insertions(+), 32 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 3766094f..27a5f82b 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,11 +5,19 @@ - + + - - + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailDomainsAddPointer.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailDomainsAddPointer.ascx index 18ba579f..1f57cb0f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailDomainsAddPointer.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailDomainsAddPointer.ascx @@ -6,7 +6,7 @@ + HideMailDomains="true" HideDomainsSubDomains="false" HideInstantAlias="false" HideDomainPointers="true"/> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailDomainsAddPointer.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailDomainsAddPointer.ascx.designer.cs index e7b645bd..bd4995e9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailDomainsAddPointer.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailDomainsAddPointer.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. From e09496e4d3faa3d81d31e53cd340e5978170c640 Mon Sep 17 00:00:00 2001 From: robvde Date: Tue, 13 Nov 2012 08:33:00 +0400 Subject: [PATCH 046/107] Fixed: Hide integrated ou provisioning when no hosted organizations are enabled within hosting plan --- WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config | 4 ++-- .../DesktopModules/WebsitePanel/UserCreateSpace.ascx | 2 +- .../DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 27a5f82b..6c7d9d64 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -9,7 +9,7 @@ --> - + @@ -17,7 +17,7 @@ --> - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx index 52e6606c..366ff2ec 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx @@ -99,7 +99,7 @@ - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs index bfec236e..6b02e1ec 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs @@ -86,6 +86,7 @@ namespace WebsitePanel.Portal bool webEnabled = false; bool ftpEnabled = false; bool mailEnabled = false; + bool integratedOUEnabled = false; // load hosting context if (planId > 0) @@ -111,6 +112,7 @@ namespace WebsitePanel.Portal ftpEnabled = cntx.Groups.ContainsKey(ResourceGroups.Ftp); mailEnabled = cntx.Groups.ContainsKey(ResourceGroups.Mail); + integratedOUEnabled = cntx.Groups.ContainsKey(ResourceGroups.HostedOrganizations); } } @@ -129,7 +131,7 @@ namespace WebsitePanel.Portal ftpAccountName.Visible = (rbFtpAccountName.SelectedIndex == 1); - chkIntegratedOUProvisioning.Visible = chkCreateResources.Visible; + chkIntegratedOUProvisioning.Checked = chkIntegratedOUProvisioning.Visible = (chkCreateResources.Visible && integratedOUEnabled); } private void CreateHostingSpace() From cf427c984d6e59aa20647e7d3191840474fee240 Mon Sep 17 00:00:00 2001 From: robvde Date: Tue, 13 Nov 2012 08:49:30 +0400 Subject: [PATCH 047/107] Lync decoupled from exchange --- .../Common/BusinessErrorCodes.cs | 1 + .../HostedSolution/OrganizationController.cs | 9 ++++- .../WebsitePanel_SharedResources.ascx.resx | 3 ++ .../WebsitePanel/Lync/LyncCreateUser.ascx | 2 +- .../Lync/LyncCreateUser.ascx.designer.cs | 40 +------------------ 5 files changed, 14 insertions(+), 41 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs index ebe1183c..9bad6958 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs @@ -324,6 +324,7 @@ namespace WebsitePanel.EnterpriseServer public const int ERROR_USERS_RESOURCE_QUOTA_LIMIT = -2707; public const int CURRENT_USER_IS_CRM_USER = -2708; public const int CURRENT_USER_IS_OCS_USER = -2709; + public const int CURRENT_USER_IS_LYNC_USER = -2710; #endregion diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index d1904c88..d61b08a8 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -1500,8 +1500,15 @@ namespace WebsitePanel.EnterpriseServer if (DataProvider.CheckOCSUserExists(accountId)) { - return BusinessErrorCodes.CURRENT_USER_IS_OCS_USER; ; + return BusinessErrorCodes.CURRENT_USER_IS_OCS_USER; } + + if (DataProvider.CheckLyncUserExists(accountId)) + { + return BusinessErrorCodes.CURRENT_USER_IS_LYNC_USER; + } + + // load organization Organization org = GetOrganization(itemId); if (org == null) 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 9df134f2..fc7a3c5b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -3176,6 +3176,9 @@ Cannot delete user account as it is used in OCS. + + Cannot delete user account as it is used in Lync. + B2B Primary Zones Allowed diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx index cea3d2cd..4d36dcf4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx @@ -28,7 +28,7 @@ - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.designer.cs index c1083b65..71f2d828 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.designer.cs @@ -1,33 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // @@ -148,14 +119,5 @@ namespace WebsitePanel.Portal.Lync { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button btnCreate; - - /// - /// FormComments control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize FormComments; } } From a504b61610fdfaefc54c49b782577954a7e5e41c Mon Sep 17 00:00:00 2001 From: robvde Date: Tue, 13 Nov 2012 09:01:04 +0400 Subject: [PATCH 048/107] Fixed: Output OrganizationStatisticsREport Wrongly formatted --- .../HostedSolution/OrganizationStatisticsReport.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsReport.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsReport.cs index a6ee3d78..c9f85f26 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsReport.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsReport.cs @@ -56,8 +56,8 @@ namespace WebsitePanel.Providers.HostedSolution sb.AppendFormat("{0},", ToCsvString(item.TotalPublicFoldersSize / 1024.0 / 1024.0)); sb.AppendFormat("{0},", ToCsvString(item.TotalSharePointSiteCollections)); sb.AppendFormat("{0},", ToCsvString(item.TotalSharePointSiteCollectionsSize / 1024.0 / 1024.0)); - sb.AppendFormat("{0}", ToCsvString(item.TotalCRMUsers)); - sb.AppendFormat("{0}", ToCsvString(item.TotalLyncUsers)); + sb.AppendFormat("{0},", ToCsvString(item.TotalCRMUsers)); + sb.AppendFormat("{0},", ToCsvString(item.TotalLyncUsers)); sb.AppendFormat("{0}", ToCsvString(item.TotalLyncEVUsers)); mainBuilder.Append(sb.ToString()); From a1eedc60a87937b0211a22d0105a127effd174ec Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 13 Nov 2012 07:36:36 -0500 Subject: [PATCH 049/107] Merge --- .../WebsitePanel.EnterpriseServer/Web.config | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 6c7d9d64..3766094f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,19 +5,11 @@ - - + - - - + + From f33eae6fa839f0fbfc79d27d86c07388955c9100 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 13 Nov 2012 07:38:38 -0500 Subject: [PATCH 050/107] Fix Copyright --- .../Lync/LyncCreateUser.ascx.designer.cs | 30 ++++++++++++++++++- .../MailDomainsAddPointer.ascx.designer.cs | 28 +++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.designer.cs index 71f2d828..af2c5bee 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.designer.cs @@ -1,4 +1,32 @@ -//------------------------------------------------------------------------------ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailDomainsAddPointer.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailDomainsAddPointer.ascx.designer.cs index bd4995e9..e7b645bd 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailDomainsAddPointer.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailDomainsAddPointer.ascx.designer.cs @@ -1,3 +1,31 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + //------------------------------------------------------------------------------ // // This code was generated by a tool. From a9c2793fefd9e73fb93aea4adcac2b200ea8ae5d Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 13 Nov 2012 07:44:30 -0500 Subject: [PATCH 051/107] Added tag build-2.0.0.157 for changeset a226d2818051 From 31f9268239d381816db5dc557829872bfde289e0 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 13 Nov 2012 07:48:17 -0500 Subject: [PATCH 052/107] Added tag build-2.0.0.158 for changeset 9f83a480ad53 From a13a0cd9ce1dc983a4465d919c9e2d42b47954cd Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 14 Nov 2012 20:37:44 -0500 Subject: [PATCH 053/107] Add logic for Accepted Domains to appear under users if exchange is disabled. --- .../UserControls/App_LocalResources/Menu.ascx.resx | 3 +++ .../ExchangeServer/UserControls/Menu.ascx.cs | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx index ea488c1d..0f2f1e19 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx @@ -127,6 +127,9 @@ Distribution Lists + Domains + + Accepted Domains diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs index d0817799..1b7569c5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs @@ -138,10 +138,11 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls exchangeGroup.MenuItems.Add(CreateMenuItem("MailboxPlans", "mailboxplans")); if (!hideItems) - if (Utils.CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) - exchangeGroup.MenuItems.Add(CreateMenuItem("DomainNames", "domains")); + if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx)) + exchangeGroup.MenuItems.Add(CreateMenuItem("ExchangeDomainNames", "domains")); if (!hideItems) + if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx)) exchangeGroup.MenuItems.Add(CreateMenuItem("StorageUsage", "storage_usage")); if (exchangeGroup.MenuItems.Count > 0) @@ -164,8 +165,12 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls if (!hideItems) { MenuGroup organizationGroup = new MenuGroup(GetLocalizedString("Text.OrganizationGroup"), imagePath + "company24.png"); - //if (CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) - // organizationGroup.MenuItems.Add(CreateMenuItem("DomainNames", "domains")); + + if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx) == false) + { + if (CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) + organizationGroup.MenuItems.Add(CreateMenuItem("DomainNames", "domains")); + } if (Utils.CheckQouta(Quotas.ORGANIZATION_USERS, cntx)) organizationGroup.MenuItems.Add(CreateMenuItem("Users", "users")); From 016382b739706b67674f1880bde34e7d65e98843 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 14 Nov 2012 20:43:19 -0500 Subject: [PATCH 054/107] Fix Typo --- .../WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs index 1b7569c5..5eb229a8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs @@ -168,7 +168,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx) == false) { - if (CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) + if (Utils.CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) organizationGroup.MenuItems.Add(CreateMenuItem("DomainNames", "domains")); } if (Utils.CheckQouta(Quotas.ORGANIZATION_USERS, cntx)) From a1d581f69cb08c23de4de1fb65b7febd2f9f8d05 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 14 Nov 2012 20:50:24 -0500 Subject: [PATCH 055/107] Added tag build-2.0.0.160 for changeset 38d6711e7142 From 3725799d3d9d086888497acab0a098e1473c7271 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 14 Nov 2012 21:26:20 -0500 Subject: [PATCH 056/107] Add new Page for OrganizationDomainNames and remove exchange related items. --- .../App_Data/WebsitePanel_Modules.config | 3 +- .../OrganizationDomainNames.ascx | 76 +++++++++ .../OrganizationDomainNames.ascx.cs | 148 ++++++++++++++++++ .../OrganizationDomainNames.ascx.designer.cs | 142 +++++++++++++++++ .../ExchangeServer/UserControls/Menu.ascx.cs | 4 +- .../WebsitePanel.Portal.Modules.csproj | 8 + 6 files changed, 378 insertions(+), 3 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.designer.cs diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config index e8d06e78..83adebdf 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config @@ -481,7 +481,8 @@ - + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx new file mode 100644 index 00000000..c7081776 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx @@ -0,0 +1,76 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationDomainNames.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.ExchangeDomainNames" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+
+ +
+
+ +
+
+
+
+ + +
+
+ + +
+ +
+ + + + + + + + <%# Eval("DomainName") %> + + + + + +
+ /> +
+
+
+ + +   + + +
+
+
+
+ +
+ +
+ +     + + + +
+
+
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.cs new file mode 100644 index 00000000..0d745b07 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.cs @@ -0,0 +1,148 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Portal.ExchangeServer +{ + public partial class OrganizationDomainNames : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindStats(); + + // bind domain names + BindDomainNames(); + } + + + } + + private void BindStats() + { + // set quotas + OrganizationStatistics stats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID); + OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID); + domainsQuota.QuotaUsedValue = stats.CreatedDomains; + domainsQuota.QuotaValue = stats.AllocatedDomains; + if (stats.AllocatedDomains != -1) domainsQuota.QuotaAvailable = tenantStats.AllocatedDomains - tenantStats.CreatedDomains; + } + + public string GetDomainRecordsEditUrl(string domainId) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "domain_records", + "DomainID=" + domainId, + "ItemID=" + PanelRequest.ItemID); + } + + private void BindDomainNames() + { + OrganizationDomainName[] list = ES.Services.Organizations.GetOrganizationDomains(PanelRequest.ItemID); + + gvDomains.DataSource = list; + gvDomains.DataBind(); + + //check if organization has only one default domain + if (gvDomains.Rows.Count == 1) + { + btnSetDefaultDomain.Enabled = false; + } + } + + public string IsChecked(bool val) + { + return val ? "checked" : ""; + } + + protected void btnAddDomain_Click(object sender, EventArgs e) + { + btnSetDefaultDomain.Enabled = true; + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "add_domain", + "SpaceID=" + PanelSecurity.PackageId)); + } + + protected void gvDomains_RowCommand(object sender, GridViewCommandEventArgs e) + { + if (e.CommandName == "DeleteItem") + { + // delete domain + int domainId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + try + { + int result = ES.Services.Organizations.DeleteOrganizationDomain(PanelRequest.ItemID, domainId); + if (result < 0) + { + messageBox.ShowResultMessage(result); + return; + } + + // rebind domains + BindDomainNames(); + + BindStats(); + } + catch (Exception ex) + { + ShowErrorMessage("EXCHANGE_DELETE_DOMAIN", ex); + } + } + } + + protected void btnSetDefaultDomain_Click(object sender, EventArgs e) + { + // get domain + int domainId = Utils.ParseInt(Request.Form["DefaultDomain"], 0); + + try + { + int result = ES.Services.Organizations.SetOrganizationDefaultDomain(PanelRequest.ItemID, domainId); + if (result < 0) + { + messageBox.ShowResultMessage(result); + if (BusinessErrorCodes.ERROR_USER_ACCOUNT_DEMO == result) + BindDomainNames(); + return; + } + + // rebind domains + BindDomainNames(); + } + catch (Exception ex) + { + ShowErrorMessage("EXCHANGE_SET_DEFAULT_DOMAIN", ex); + } + } + + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.designer.cs new file mode 100644 index 00000000..7bad4113 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.designer.cs @@ -0,0 +1,142 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +//------------------------------------------------------------------------------ +// +// 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.ExchangeServer { + + + public partial class ExchangeDomainNames { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// 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; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// btnAddDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddDomain; + + /// + /// gvDomains control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvDomains; + + /// + /// btnSetDefaultDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSetDefaultDomain; + + /// + /// locQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locQuota; + + /// + /// domainsQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaViewer domainsQuota; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs index 5eb229a8..95ae8dab 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs @@ -168,8 +168,8 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx) == false) { - if (Utils.CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) - organizationGroup.MenuItems.Add(CreateMenuItem("DomainNames", "domains")); + if (CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) + organizationGroup.MenuItems.Add(CreateMenuItem("DomainNames", "org_domains")); } if (Utils.CheckQouta(Quotas.ORGANIZATION_USERS, cntx)) organizationGroup.MenuItems.Add(CreateMenuItem("Users", "users")); 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 2044722b..29c3e6df 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -202,6 +202,13 @@ + + OrganizationDomainNames.ascx + ASPXCodeBehind + + + OrganizationDomainNames.ascx + ExchangeAddMailboxPlan.ascx ASPXCodeBehind @@ -3790,6 +3797,7 @@ + From 8e5be929a2e48be9169eab17453c42946e167efd Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 14 Nov 2012 21:31:17 -0500 Subject: [PATCH 057/107] Fix Typo --- .../OrganizationDomainNames.ascx | 2 +- .../OrganizationDomainNames.ascx.designer.cs | 30 +------------------ 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx index c7081776..388c12be 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationDomainNames.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.ExchangeDomainNames" %> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationDomainNames.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationDomainNames" %> <%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> <%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> <%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.designer.cs index 7bad4113..34be1084 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -38,7 +10,7 @@ namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeDomainNames { + public partial class OrganizationDomainNames { /// /// asyncTasks control. From acfc81b635eb4d3850d06e1fbbf92a25c1295748 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 14 Nov 2012 21:32:13 -0500 Subject: [PATCH 058/107] Add Copyright --- .../OrganizationDomainNames.ascx.designer.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.designer.cs index 34be1084..6e8feaab 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.designer.cs @@ -1,3 +1,31 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + //------------------------------------------------------------------------------ // // This code was generated by a tool. From 28ab20c83d081b9f176858479aae359a21d2eb02 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 14 Nov 2012 21:35:27 -0500 Subject: [PATCH 059/107] Fix Typo --- .../WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs index 95ae8dab..9f3475ae 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs @@ -168,7 +168,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx) == false) { - if (CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) + if (Utils.CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) organizationGroup.MenuItems.Add(CreateMenuItem("DomainNames", "org_domains")); } if (Utils.CheckQouta(Quotas.ORGANIZATION_USERS, cntx)) From 0d32f933c83282385e1e427bf48a166d92d108d8 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 14 Nov 2012 21:40:21 -0500 Subject: [PATCH 060/107] Added tag build-2.0.0.163 for changeset 4331bf6e6646 From 92dafecbb9c8bd12568f9cee836957f645bd990d Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 14 Nov 2012 21:50:00 -0500 Subject: [PATCH 061/107] Add OrganizationDomainNames Resource File --- .../OrganizationDomainNames.ascx.resx | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationDomainNames.ascx.resx diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationDomainNames.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationDomainNames.ascx.resx new file mode 100644 index 00000000..8775c057 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationDomainNames.ascx.resx @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Add New Domain + + + Set Default Domain + + + if(!confirm('Are you sure you want to delete selected domain?')) return false; else ShowProgressDialog('Deleting Domain...'); + + + Delete + + + Delete Domain Name + + + No domains have been added yet. To add a new domain click "Add New Domain" button. + + + Default Domain + + + Domain Name + + + <p>Each organization can have several domain names. These domain names are used as part of the primary e-mail address (UPN) of the new accounts. Exchange-enabled organizations use domain name when creating e-mail addresses for mailboxes, and distribution lists. Domain name is also used when creating new site collection in SharePoint.</p> +<p>Default domain name is selected by default when creating a new e-mail address. You can always change default domain name and it will not affect existing accounts.</p> +<p>For each domain name a corresponding DNS Zone is created. You can edit DNS zone records by clicking domain name link. If you are unsure about the structure of DNS zone, please do not modify zone records.</p> + + + Total Domain Names Used: + + + Domain Names + + + Domain Names + + + Domain Type + + + Change Type + + + Change + + \ No newline at end of file From f83e9d3f6278d50c867a11f73c6b0c2298e676e7 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 14 Nov 2012 21:55:35 -0500 Subject: [PATCH 062/107] Added tag build-2.0.0.164 for changeset 1d4a66812cc9 From b35f4133bb0f8d7aff2705d2df72d2fa215f3d58 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 14 Nov 2012 22:14:54 -0500 Subject: [PATCH 063/107] Add Seperate Organization Domain Add Page --- .../App_Data/WebsitePanel_Modules.config | 1 + .../OrganizationAddDomainName.ascx.resx | 138 +++++++++++++++++ .../OrganizationAddDomainName.ascx | 44 ++++++ .../OrganizationAddDomainName.ascx.cs | 121 +++++++++++++++ ...OrganizationAddDomainName.ascx.designer.cs | 142 ++++++++++++++++++ .../OrganizationDomainNames.ascx.cs | 2 +- 6 files changed, 447 insertions(+), 1 deletion(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationAddDomainName.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx.designer.cs diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config index 83adebdf..73475696 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config @@ -482,6 +482,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationAddDomainName.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationAddDomainName.ascx.resx new file mode 100644 index 00000000..1b687b23 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationAddDomainName.ascx.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Cancel + + + Select a domain name, e.g. "mydomain.com" or "sub.mydomain.com" + + + Add Domain Name + + + Domain Names + + + Please enter correct domain name, e.g. "mydomain.com" or "sub.mydomain.com" + + + * + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx new file mode 100644 index 00000000..dd55b0ef --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx @@ -0,0 +1,44 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationAddDomainName.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationAddDomainName" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+
+ +
+
+ +
+
+
+
+ + +
+
+ + + + + + +
+ +
+
+
+ + + +
+
+
+ +
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx.cs new file mode 100644 index 00000000..e5046171 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx.cs @@ -0,0 +1,121 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Data; +using System.Text; +using System.Collections.Generic; + +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Portal.ExchangeServer +{ + public partial class OrganizationAddDomainName : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + DomainInfo[] domains = ES.Services.Servers.GetMyDomains(PanelSecurity.PackageId); + + Organization[] orgs = ES.Services.Organizations.GetOrganizations(PanelSecurity.PackageId, false); + + List list = new List(); + + foreach (Organization o in orgs) + { + OrganizationDomainName[] tmpList = ES.Services.Organizations.GetOrganizationDomains(o.Id); + + foreach (OrganizationDomainName name in tmpList) list.Add(name); + } + + foreach (DomainInfo d in domains) + { + if (!d.IsDomainPointer) + { + bool bAdd = true; + foreach (OrganizationDomainName acceptedDomain in list) + { + if (d.DomainName.ToLower() == acceptedDomain.DomainName.ToLower()) + { + bAdd = false; + break; + } + + } + if (bAdd) ddlDomains.Items.Add(d.DomainName.ToLower()); + } + } + + if (ddlDomains.Items.Count == 0) + { + ddlDomains.Visible= btnAdd.Enabled = false; + } + + + + } + + protected void btnAdd_Click(object sender, EventArgs e) + { + AddDomain(); + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "org_domains", "SpaceID=" + PanelSecurity.PackageId)); + + } + + + private void AddDomain() + { + if (!Page.IsValid) + return; + + try + { + + int result = ES.Services.Organizations.AddOrganizationDomain(PanelRequest.ItemID, + ddlDomains.SelectedValue.Trim()); + + if (result < 0) + { + messageBox.ShowResultMessage(result); + return; + } + + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "org_domains", + "SpaceID=" + PanelSecurity.PackageId)); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("EXCHANGE_ADD_DOMAIN", ex); + } + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx.designer.cs new file mode 100644 index 00000000..8f1f82e4 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx.designer.cs @@ -0,0 +1,142 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +//------------------------------------------------------------------------------ +// +// 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.ExchangeServer { + + + public partial class OrganizationAddDomainName { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// 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; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// locDomainName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDomainName; + + /// + /// ddlDomains control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlDomains; + + /// + /// btnAdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAdd; + + /// + /// ValidationSummary1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary1; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.cs index 0d745b07..1fd56a34 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.cs @@ -87,7 +87,7 @@ namespace WebsitePanel.Portal.ExchangeServer protected void btnAddDomain_Click(object sender, EventArgs e) { btnSetDefaultDomain.Enabled = true; - Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "add_domain", + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "org_add_domain", "SpaceID=" + PanelSecurity.PackageId)); } From eaadc57e991a888bf5b58b00218080f68d2fd504 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 14 Nov 2012 22:20:48 -0500 Subject: [PATCH 064/107] Added tag build-2.0.0.165 for changeset c079da151b6c From 5ce6441fb1c8cc3db6c792a2cf0732af3dca6f8a Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 14 Nov 2012 22:47:17 -0500 Subject: [PATCH 065/107] Update Project File --- .../WebsitePanel.Portal.Modules.csproj | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 29c3e6df..c513660b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -202,6 +202,13 @@ + + OrganizationAddDomainName.ascx + ASPXCodeBehind + + + OrganizationAddDomainName.ascx + OrganizationDomainNames.ascx ASPXCodeBehind @@ -3797,6 +3804,7 @@ + @@ -4953,6 +4961,12 @@ + + Designer + + + Designer + Designer From b710607b1c3095f145139b5403213dc921d01c34 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 14 Nov 2012 22:52:22 -0500 Subject: [PATCH 066/107] Added tag build-2.0.0.166 for changeset 6ec9c134f7c4 From dd47c3b02a0202f18782c67ea78fd5aa30f8ad2d Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 19:12:51 -0500 Subject: [PATCH 067/107] FIXED Wsp-10046 Changed Exchange Domain to Internal Relay if Organization has 0 Allocated Mailbox --- .../Code/HostedSolution/OrganizationController.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index d61b08a8..829a4fa0 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -1123,6 +1123,12 @@ namespace WebsitePanel.EnterpriseServer if (!string.IsNullOrEmpty(org.GlobalAddressList)) { ExchangeServerController.AddAuthoritativeDomain(itemId, domain.DomainId); + + if (orgStats.AllocatedMailboxes == 0) + { + ExchangeAcceptedDomainType newDomainType = ExchangeAcceptedDomainType.InternalRelay; + ChangeOrganizationDomainType(itemId, domain.DomainId, newDomainType); + } } if (org.IsOCSOrganization) From 312d3b7d224d687eb7951441596f7c9e523f931d Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 19:19:18 -0500 Subject: [PATCH 068/107] Added tag build-2.0.0.167 for changeset 06ca63c5d82e From 4d9026ad375075cb23f27313000b0058fd05a54c Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 19:30:12 -0500 Subject: [PATCH 069/107] Adjust wsp-10046 --- .../Code/HostedSolution/OrganizationController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index 829a4fa0..36fc9bc4 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -1124,7 +1124,7 @@ namespace WebsitePanel.EnterpriseServer { ExchangeServerController.AddAuthoritativeDomain(itemId, domain.DomainId); - if (orgStats.AllocatedMailboxes == 0) + if (orgStats.AllocatedMailboxes > -1) { ExchangeAcceptedDomainType newDomainType = ExchangeAcceptedDomainType.InternalRelay; ChangeOrganizationDomainType(itemId, domain.DomainId, newDomainType); From ab42be81cfe70e6c3abcd3c18f4a4e383157bade Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 19:32:13 -0500 Subject: [PATCH 070/107] Further Adjust wsp-10046 --- .../Code/HostedSolution/OrganizationController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index 36fc9bc4..b9dde7d9 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -1124,7 +1124,7 @@ namespace WebsitePanel.EnterpriseServer { ExchangeServerController.AddAuthoritativeDomain(itemId, domain.DomainId); - if (orgStats.AllocatedMailboxes > -1) + if ((orgStats.AllocatedMailboxes > -1) == false) { ExchangeAcceptedDomainType newDomainType = ExchangeAcceptedDomainType.InternalRelay; ChangeOrganizationDomainType(itemId, domain.DomainId, newDomainType); From d6fc14facd1bb6798bcb30a39c8ec54bddd0281e Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 19:39:02 -0500 Subject: [PATCH 071/107] Added tag build-2.0.0.168 for changeset 07e9e2bbed7a From cbb100a95d90030371de13747f00da1ac480ec14 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 19:56:31 -0500 Subject: [PATCH 072/107] Further Adjust wsp-10046 --- .../Code/HostedSolution/OrganizationController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index b9dde7d9..2880d4f5 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -1124,7 +1124,7 @@ namespace WebsitePanel.EnterpriseServer { ExchangeServerController.AddAuthoritativeDomain(itemId, domain.DomainId); - if ((orgStats.AllocatedMailboxes > -1) == false) + if (orgStats.AllocatedMailboxes == -1) { ExchangeAcceptedDomainType newDomainType = ExchangeAcceptedDomainType.InternalRelay; ChangeOrganizationDomainType(itemId, domain.DomainId, newDomainType); From f0da9d3decc51d15ff70f9afe6966bd2f24a3605 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 20:02:33 -0500 Subject: [PATCH 073/107] Added tag build-2.0.0.169 for changeset fb31dbfad73a From 1629e390f396055bb20889c2d6ecff221625f570 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 20:25:32 -0500 Subject: [PATCH 074/107] wsp-10046 implement correct organizational stats for exchange as mailbox stats is not included in organizationcontroller --- .../Code/HostedSolution/OrganizationController.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index 2880d4f5..ab2ed217 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -1123,8 +1123,10 @@ namespace WebsitePanel.EnterpriseServer if (!string.IsNullOrEmpty(org.GlobalAddressList)) { ExchangeServerController.AddAuthoritativeDomain(itemId, domain.DomainId); - - if (orgStats.AllocatedMailboxes == -1) + + OrganizationStatistics orgStatsExchange = ExchangeServerController.GetOrganizationStatistics(itemId); + + if (orgStatsExchange.AllocatedMailboxes == -1) { ExchangeAcceptedDomainType newDomainType = ExchangeAcceptedDomainType.InternalRelay; ChangeOrganizationDomainType(itemId, domain.DomainId, newDomainType); From d8f761ff1d3e1557685a53c76626bb7844e8059b Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 20:30:40 -0500 Subject: [PATCH 075/107] Added tag build-2.0.0.170 for changeset 69ab346d5711 From f60912ee44d4163735bbbdf0470e90fda2144ed3 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 21:04:39 -0500 Subject: [PATCH 076/107] Retest wsp-10046 --- .../Code/HostedSolution/OrganizationController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index ab2ed217..783081a1 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -1126,7 +1126,7 @@ namespace WebsitePanel.EnterpriseServer OrganizationStatistics orgStatsExchange = ExchangeServerController.GetOrganizationStatistics(itemId); - if (orgStatsExchange.AllocatedMailboxes == -1) + if ((orgStatsExchange.AllocatedMailboxes > -1) == false) { ExchangeAcceptedDomainType newDomainType = ExchangeAcceptedDomainType.InternalRelay; ChangeOrganizationDomainType(itemId, domain.DomainId, newDomainType); From 50b0f73525e6c1595c523d33dc11f47860deab6b Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 21:12:51 -0500 Subject: [PATCH 077/107] Added tag build-2.0.0.171 for changeset e2f40d7e3496 From 2ad89f330a71555aef749b827856c6f57a03894e Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 21:18:46 -0500 Subject: [PATCH 078/107] Retest wsp-10046 --- .../Code/HostedSolution/OrganizationController.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index 783081a1..f72f9e06 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -1123,14 +1123,14 @@ namespace WebsitePanel.EnterpriseServer if (!string.IsNullOrEmpty(org.GlobalAddressList)) { ExchangeServerController.AddAuthoritativeDomain(itemId, domain.DomainId); + } - OrganizationStatistics orgStatsExchange = ExchangeServerController.GetOrganizationStatistics(itemId); + OrganizationStatistics orgStatsExchange = ExchangeServerController.GetOrganizationStatistics(itemId); - if ((orgStatsExchange.AllocatedMailboxes > -1) == false) - { - ExchangeAcceptedDomainType newDomainType = ExchangeAcceptedDomainType.InternalRelay; - ChangeOrganizationDomainType(itemId, domain.DomainId, newDomainType); - } + if (orgStatsExchange.AllocatedMailboxes == -1) + { + ExchangeAcceptedDomainType newDomainType = ExchangeAcceptedDomainType.InternalRelay; + ChangeOrganizationDomainType(itemId, domain.DomainId, newDomainType); } if (org.IsOCSOrganization) From ab842a386547115977fe0f28e2d0b6eb3c387868 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 21:24:06 -0500 Subject: [PATCH 079/107] Added tag build-2.0.0.172 for changeset 92372747c8e9 From 3675d570ad68b57361adb29cdde335b533578ffb Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 21:37:05 -0500 Subject: [PATCH 080/107] Re-test 10046 --- .../Code/HostedSolution/OrganizationController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index f72f9e06..5ff28737 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -1127,7 +1127,7 @@ namespace WebsitePanel.EnterpriseServer OrganizationStatistics orgStatsExchange = ExchangeServerController.GetOrganizationStatistics(itemId); - if (orgStatsExchange.AllocatedMailboxes == -1) + if ((orgStatsExchange.AllocatedMailboxes != -1) == false) { ExchangeAcceptedDomainType newDomainType = ExchangeAcceptedDomainType.InternalRelay; ChangeOrganizationDomainType(itemId, domain.DomainId, newDomainType); From 4fe88b7154c152b1ad21960f2c4297297d71757b Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 21:42:55 -0500 Subject: [PATCH 081/107] Added tag build-2.0.0.173 for changeset 45aa0758b281 From 04652c91228df68b3c26c47a0aa05d5e3f29508d Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 21:50:31 -0500 Subject: [PATCH 082/107] wsp-10046 another test --- .../Code/HostedSolution/OrganizationController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index 5ff28737..9650c570 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -1127,7 +1127,7 @@ namespace WebsitePanel.EnterpriseServer OrganizationStatistics orgStatsExchange = ExchangeServerController.GetOrganizationStatistics(itemId); - if ((orgStatsExchange.AllocatedMailboxes != -1) == false) + if (orgStatsExchange.AllocatedMailboxes == 0) { ExchangeAcceptedDomainType newDomainType = ExchangeAcceptedDomainType.InternalRelay; ChangeOrganizationDomainType(itemId, domain.DomainId, newDomainType); From 4e975e850c043c72c7dea9c77326c54658b03bcc Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 21:55:25 -0500 Subject: [PATCH 083/107] Added tag build-2.0.0.174 for changeset 032a78880bc1 From 49d4e3d4355237035bcc6c895cdb5058aa6f92dd Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 22:11:27 -0500 Subject: [PATCH 084/107] wsp-10046 re-test --- .../Code/HostedSolution/OrganizationController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index 9650c570..00662bce 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -1130,7 +1130,7 @@ namespace WebsitePanel.EnterpriseServer if (orgStatsExchange.AllocatedMailboxes == 0) { ExchangeAcceptedDomainType newDomainType = ExchangeAcceptedDomainType.InternalRelay; - ChangeOrganizationDomainType(itemId, domain.DomainId, newDomainType); + ChangeOrganizationDomainType(org.ServiceId, domain.DomainId, newDomainType); } if (org.IsOCSOrganization) From e5156eb0cdf75fc71a320eff40fb8029ac8230d0 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 15 Nov 2012 22:17:24 -0500 Subject: [PATCH 085/107] Added tag build-2.0.0.175 for changeset 76cce0324140 From 51c9c74a2fe26c46ae56604c5732857f8f4f5fd2 Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 18 Nov 2012 11:46:18 +0400 Subject: [PATCH 086/107] Fixed: When changing primary email address, upn is changed as well. UPN is not changes anymore When deleting user: leaf object error. Fixed: object delete methods extended with delete Tree Lync Global Plans cannot be deleted, fixed --- .../WebsitePanel.EnterpriseServer/Web.config | 15 ++++++++++++--- .../HostedSolution/ActiveDirectoryUtils.cs | 3 ++- .../Exchange2007.cs | 2 +- .../SettingsLyncUserPlansPolicy.ascx.cs | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 3766094f..c48ebaf1 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,12 +5,21 @@ - + + - - + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs index ac11cdef..5e608f88 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs @@ -113,7 +113,8 @@ namespace WebsitePanel.Providers.HostedSolution DirectoryEntry parent = entry.Parent; if (parent != null) { - parent.Children.Remove(entry); + //parent.Children.Remove(entry); + entry.DeleteTree(); parent.CommitChanges(); } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs index 8f2f63e1..a338e30c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs @@ -2591,7 +2591,7 @@ namespace WebsitePanel.Providers.HostedSolution Command cmd = new Command("Set-Mailbox"); cmd.Parameters.Add("Identity", accountName); cmd.Parameters.Add("PrimarySmtpAddress", primaryEmail); - cmd.Parameters.Add("UserPrincipalName", primaryEmail); + //cmd.Parameters.Add("UserPrincipalName", primaryEmail); cmd.Parameters.Add("WindowsEmailAddress", primaryEmail); ExecuteShellCommand(runSpace, cmd); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.cs index 76d92469..51fbf72a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.cs @@ -219,7 +219,7 @@ namespace WebsitePanel.Portal } - result = ES.Services.ExchangeServer.DeleteExchangeMailboxPlan(orgs[0].Id, planId); + result = ES.Services.Lync.DeleteLyncUserPlan(orgs[0].Id, planId); if (result < 0) { messageBox.ShowResultMessage(result); From 8fdd24c19f4bde06679fb9379af571973fd8ad92 Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 18 Nov 2012 12:04:54 +0400 Subject: [PATCH 087/107] Fixed: Exchange Account quota usage not correctly represented --- WebsitePanel/Database/update_db.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 4b2adf86..0c140dc1 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -1813,7 +1813,9 @@ AS SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID - WHERE pt.ParentPackageID = @PackageID AND ea.MailboxPlanId IS NOT NULL) + WHERE pt.ParentPackageID = @PackageID + AND ea.AccountType IN (1) + AND ea.MailboxPlanId IS NOT NULL) ELSE IF @QuotaID = 77 -- Exchange2007.DiskSpace SET @Result = (SELECT SUM(B.MailboxSizeMB) FROM ExchangeAccounts AS ea INNER JOIN ExchangeMailboxPlans AS B ON ea.MailboxPlanId = B.MailboxPlanId From 2483c1d4963e48b382a8216f23d045230c1668cf Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sun, 18 Nov 2012 03:39:42 -0500 Subject: [PATCH 088/107] Merge --- .../WebsitePanel.EnterpriseServer/Web.config | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index c48ebaf1..3766094f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,21 +5,12 @@ - - + + + - - - - From a7c40ff361abde361a9e738068365e2a31707a06 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sun, 18 Nov 2012 03:50:19 -0500 Subject: [PATCH 089/107] Added tag build-2.0.0.176 for changeset 25d02b03a759 From 647a6cedd241dc7b6424d85c817b0b08e4211f23 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sun, 18 Nov 2012 03:54:15 -0500 Subject: [PATCH 090/107] Added tag build-2.0.0.177 for changeset fdd7fb7ed5a9 From 1c7d232f7cbb0b9a4194a5c87d9bd4098a45a3e6 Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 18 Nov 2012 13:46:58 +0400 Subject: [PATCH 091/107] Fixed: When a domain is assigned to an email domain as an alias, you are still able to create and assign email accounts under that domain --- .../WebsitePanel.EnterpriseServer/Web.config | 4 +-- .../DomainsSelectDomainControl.ascx.cs | 34 +++++++++++++++++++ .../WebsitePanel/MailEditAddress.ascx | 2 +- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index c48ebaf1..893524ff 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -9,7 +9,7 @@ --> - + @@ -17,7 +17,7 @@ --> - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx.cs index cc723f6a..7c52e8f0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx.cs @@ -62,6 +62,13 @@ namespace WebsitePanel.Portal set { ViewState["HideMailDomains"] = value; } } + public bool HideMailDomainPointers + { + get { return (ViewState["HideMailDomainPointers"] != null) ? (bool)ViewState["HideMailDomainPointers"] : false; } + set { ViewState["HideMailDomainPointers"] = value; } + } + + public bool HideDomainPointers { get { return (ViewState["HideDomainPointers"] != null) ? (bool)ViewState["HideDomainPointers"] : false; } @@ -111,6 +118,7 @@ namespace WebsitePanel.Portal WebSite[] sites = null; Hashtable htSites = new Hashtable(); + Hashtable htMailDomainPointers = new Hashtable(); if (HideWebSites) { sites = ES.Services.WebServers.GetWebSites(PackageId, false); @@ -127,6 +135,25 @@ namespace WebsitePanel.Portal } } + if (HideMailDomainPointers) + { + Providers.Mail.MailDomain[] mailDomains = ES.Services.MailServers.GetMailDomains(PackageId, false); + + foreach (Providers.Mail.MailDomain mailDomain in mailDomains) + { + DomainInfo[] pointers = ES.Services.MailServers.GetMailDomainPointers(mailDomain.Id); + if (pointers != null) + { + foreach (DomainInfo p in pointers) + { + if (htMailDomainPointers[p.DomainName.ToLower()] == null) htMailDomainPointers.Add(p.DomainName.ToLower(), 1); + + } + } + } + } + + ddlDomains.Items.Clear(); // add "select" item @@ -148,6 +175,13 @@ namespace WebsitePanel.Portal } } } + + + if (HideMailDomainPointers) + { + if (htMailDomainPointers[domain.DomainName.ToLower()] != null) continue; + } + if (HideInstantAlias && domain.IsInstantAlias) continue; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailEditAddress.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailEditAddress.ascx index bb808b7a..6037cbc1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailEditAddress.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailEditAddress.ascx @@ -9,7 +9,7 @@  @  - + From fb0b5b71028d92de04713338d72128bc828b23a7 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sun, 18 Nov 2012 10:46:47 -0500 Subject: [PATCH 092/107] Added tag build-2.0.0.178 for changeset 499deb2ba5d8 From 7fe2490e0aada073e9334b5cb081d7312b57b7ae Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sun, 18 Nov 2012 10:53:10 -0500 Subject: [PATCH 093/107] wsp-10024 Change IntegratedOUEnabled variable to be set true based on Domain Quota --- .../DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs index 6b02e1ec..5e92633c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs @@ -112,7 +112,11 @@ namespace WebsitePanel.Portal ftpEnabled = cntx.Groups.ContainsKey(ResourceGroups.Ftp); mailEnabled = cntx.Groups.ContainsKey(ResourceGroups.Mail); - integratedOUEnabled = cntx.Groups.ContainsKey(ResourceGroups.HostedOrganizations); + + if (Utils.CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) + { + integratedOUEnabled = true; + } } } From 1a606444e189250150e3add020e90410e3931570 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sun, 18 Nov 2012 10:59:55 -0500 Subject: [PATCH 094/107] Added tag build-2.0.0.179 for changeset 9b4fabf5d175 From e47cf9af734958464af4554eabd7f9aff70541a5 Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 18 Nov 2012 20:51:01 +0400 Subject: [PATCH 095/107] Fixed: update_db.sql: HideQuota existence verification --- WebsitePanel/Database/update_db.sql | 2 +- .../WebsitePanel.EnterpriseServer/Web.config | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 0c140dc1..aba5730d 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -559,7 +559,7 @@ GO UPDATE [dbo].[ResourceGroups] SET ShowGroup=1 GO -IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='Quotas' AND COLS.name='ShowGroup') +IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='Quotas' AND COLS.name='HideQuota') BEGIN ALTER TABLE [dbo].[Quotas] ADD [HideQuota] [bit] NULL END diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 3766094f..c48ebaf1 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,12 +5,21 @@ - + + - - + + + + From acb9dcec62f2ff702f2406e26de4c0f49372e6dd Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sun, 18 Nov 2012 11:53:27 -0500 Subject: [PATCH 096/107] Merge --- .../WebsitePanel.EnterpriseServer/Web.config | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index c48ebaf1..3766094f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,21 +5,12 @@ - - + + + - - - - From 5b393863a8f308690f6914b1a183cfff8c563263 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sun, 18 Nov 2012 12:03:33 -0500 Subject: [PATCH 097/107] Added tag build-2.0.0.180 for changeset c5b9f02498bb From 06ea9b8e34506a0ef43d8e02fdb0bdbdca16656c Mon Sep 17 00:00:00 2001 From: robvde Date: Mon, 19 Nov 2012 17:53:16 +0400 Subject: [PATCH 098/107] UserPrincipalName added to the collection of user info --- .../HostedSolution/OrganizationUser.cs | 6 +++++ .../OrganizationProvider.cs | 1 + .../OrganizationUserGeneralSettings.ascx.resx | 3 +++ .../OrganizationUserGeneralSettings.ascx | 6 +++++ .../OrganizationUserGeneralSettings.ascx.cs | 1 + ...zationUserGeneralSettings.ascx.designer.cs | 27 ++++++++++++------- 6 files changed, 35 insertions(+), 9 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs index d3e2b62c..4502328f 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs @@ -64,6 +64,7 @@ namespace WebsitePanel.Providers.HostedSolution private string country; private string notes; private string domainUserName; + private string userPrincipalName; private bool disabled; private bool locked; @@ -305,6 +306,11 @@ namespace WebsitePanel.Providers.HostedSolution set { subscriberNumber = value; } } + public string UserPrincipalName + { + get { return userPrincipalName; } + set { userPrincipalName = value; } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs index 9b78cd77..147bfdd1 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs @@ -529,6 +529,7 @@ namespace WebsitePanel.Providers.HostedSolution retUser.DomainUserName = GetDomainName(ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.SAMAccountName)); retUser.DistinguishedName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.DistinguishedName); retUser.Locked = (bool)entry.InvokeGet(ADAttributes.AccountLocked); + retUser.UserPrincipalName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.UserPrincipalName); HostedSolutionLog.LogEnd("GetUserGeneralSettingsInternal"); return retUser; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx index 7e4229e9..6946695e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx @@ -236,4 +236,7 @@ * + + Login Name: + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx index 407ab8c2..4ee2563c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx @@ -41,6 +41,11 @@ + + + + + +
@@ -95,6 +100,7 @@
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + /// + /// locUserPrincipalName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locUserPrincipalName; + + /// + /// lblUserPrincipalName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblUserPrincipalName; + /// /// locDisplayName control. /// @@ -668,14 +686,5 @@ namespace WebsitePanel.Portal.HostedSolution { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary1; - - /// - /// FormComments control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize FormComments; } } From 3ceddd038c78e26e0f720b9a2aa0039cce91a83a Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Mon, 19 Nov 2012 09:53:32 -0500 Subject: [PATCH 099/107] Merge --- ...zationUserGeneralSettings.ascx.designer.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs index d29e91a9..2295ee44 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs @@ -1,3 +1,31 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + //------------------------------------------------------------------------------ // // This code was generated by a tool. From 46ba6599a0808dca6d41326625601b4b11dc2c41 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Mon, 19 Nov 2012 10:04:09 -0500 Subject: [PATCH 100/107] Added tag build-2.0.0.181 for changeset 913bf59d730b From 65ab6722fd348756dde3584a7f248f30fc17ac66 Mon Sep 17 00:00:00 2001 From: robvde Date: Tue, 20 Nov 2012 21:10:51 +0400 Subject: [PATCH 101/107] Plumbling put in place to set Lync SipAddress and LineUri --- .../LyncProxy.cs | 85 +- .../Code/HostedSolution/LyncController.cs | 61 +- .../WebsitePanel.EnterpriseServer/Web.config | 14 +- .../esLync.asmx.cs | 7 + .../HostedSolution/ILyncServer.cs | 1 + .../Lync2010.cs | 40 + .../LyncServerProxy.cs | 787 +++++++++--------- .../WebsitePanel.Server/LyncServer.asmx.cs | 18 + WebsitePanel/Sources/generate_es_proxies.bat | 8 +- .../Sources/generate_server_proxies.bat | 8 +- 10 files changed, 597 insertions(+), 432 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs index 3e960f56..b21b13d1 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs @@ -29,7 +29,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.6387 +// Runtime Version:2.0.50727.6400 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -51,8 +51,6 @@ namespace WebsitePanel.EnterpriseServer { using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Providers.ResultObjects; - - /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] @@ -85,6 +83,8 @@ namespace WebsitePanel.EnterpriseServer { private System.Threading.SendOrPostCallback GetLyncUserGeneralSettingsOperationCompleted; + private System.Threading.SendOrPostCallback SetLyncUserGeneralSettingsOperationCompleted; + private System.Threading.SendOrPostCallback SetUserLyncPlanOperationCompleted; private System.Threading.SendOrPostCallback GetFederationDomainsOperationCompleted; @@ -134,6 +134,9 @@ namespace WebsitePanel.EnterpriseServer { /// public event GetLyncUserGeneralSettingsCompletedEventHandler GetLyncUserGeneralSettingsCompleted; + /// + public event SetLyncUserGeneralSettingsCompletedEventHandler SetLyncUserGeneralSettingsCompleted; + /// public event SetUserLyncPlanCompletedEventHandler SetUserLyncPlanCompleted; @@ -680,6 +683,56 @@ namespace WebsitePanel.EnterpriseServer { } } + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetLyncUserGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool SetLyncUserGeneralSettings(int itemId, int accountId, string sipAddress, string lineUri) { + object[] results = this.Invoke("SetLyncUserGeneralSettings", new object[] { + itemId, + accountId, + sipAddress, + lineUri}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginSetLyncUserGeneralSettings(int itemId, int accountId, string sipAddress, string lineUri, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetLyncUserGeneralSettings", new object[] { + itemId, + accountId, + sipAddress, + lineUri}, callback, asyncState); + } + + /// + public bool EndSetLyncUserGeneralSettings(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void SetLyncUserGeneralSettingsAsync(int itemId, int accountId, string sipAddress, string lineUri) { + this.SetLyncUserGeneralSettingsAsync(itemId, accountId, sipAddress, lineUri, null); + } + + /// + public void SetLyncUserGeneralSettingsAsync(int itemId, int accountId, string sipAddress, string lineUri, object userState) { + if ((this.SetLyncUserGeneralSettingsOperationCompleted == null)) { + this.SetLyncUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetLyncUserGeneralSettingsOperationCompleted); + } + this.InvokeAsync("SetLyncUserGeneralSettings", new object[] { + itemId, + accountId, + sipAddress, + lineUri}, this.SetLyncUserGeneralSettingsOperationCompleted, userState); + } + + private void OnSetLyncUserGeneralSettingsOperationCompleted(object arg) { + if ((this.SetLyncUserGeneralSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetLyncUserGeneralSettingsCompleted(this, new SetLyncUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetUserLyncPlan", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public LyncUserResult SetUserLyncPlan(int itemId, int accountId, int lyncUserPlanId) { @@ -1177,6 +1230,32 @@ namespace WebsitePanel.EnterpriseServer { } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void SetLyncUserGeneralSettingsCompletedEventHandler(object sender, SetLyncUserGeneralSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetLyncUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SetLyncUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public bool Result { + get { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetUserLyncPlanCompletedEventHandler(object sender, SetUserLyncPlanCompletedEventArgs e); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs index b7bf20f1..f7184468 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs @@ -228,7 +228,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution LyncUserPlan plan = GetLyncUserPlan(itemId, lyncUserPlanId); - if (!lync.CreateUser(org.OrganizationId, user.PrimaryEmailAddress, plan)) + if (!lync.CreateUser(org.OrganizationId, user.UserPrincipalName, plan)) { TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ADD_LYNC_USER); return res; @@ -318,7 +318,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution usr = OrganizationController.GetAccount(itemId, accountId); if (usr != null) - user = lync.GetLyncUserGeneralSettings(org.OrganizationId, usr.PrimaryEmailAddress); + user = lync.GetLyncUserGeneralSettings(org.OrganizationId, usr.UserPrincipalName); if (user != null) { @@ -341,6 +341,59 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } + public static bool SetLyncUserGeneralSettings(int itemId, int accountId, string sipAddress, string lineUri) + { + TaskManager.StartTask("LYNC", "SET_LYNC_USER_GENERAL_SETTINGS"); + + LyncUser user = null; + bool ret = true; + + try + { + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + { + throw new ApplicationException( + string.Format("Organization is null. ItemId={0}", itemId)); + } + + int lyncServiceId = GetLyncServiceID(org.PackageId); + LyncServer lync = GetLyncServer(lyncServiceId, org.ServiceId); + + OrganizationUser usr; + usr = OrganizationController.GetAccount(itemId, accountId); + + if (usr != null) + user = lync.GetLyncUserGeneralSettings(org.OrganizationId, usr.UserPrincipalName); + + if (user != null) + { + LyncUserPlan plan = ObjectUtils.FillObjectFromDataReader(DataProvider.GetLyncUserPlanByAccountId(accountId)); + + if (plan != null) + { + user.LyncUserPlanId = plan.LyncUserPlanId; + user.LyncUserPlanName = plan.LyncUserPlanName; + } + + user.PrimaryUri = sipAddress; + user.LineUri = lineUri; + + lync.SetLyncUserGeneralSettings(org.OrganizationId, usr.UserPrincipalName, user); + } + } + catch (Exception ex) + { + ret = false; + throw TaskManager.WriteError(ex); + } + TaskManager.CompleteTask(); + return ret; + + } + + + public static int DeleteOrganization(int itemId) { // check account @@ -403,7 +456,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution OrganizationUser user; user = OrganizationController.GetAccount(itemId, accountId); - if (!lync.SetLyncUserPlan(org.OrganizationId, user.PrimaryEmailAddress, plan)) + if (!lync.SetLyncUserPlan(org.OrganizationId, user.UserPrincipalName, plan)) { TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ADD_LYNC_USER); return res; @@ -518,7 +571,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution user = OrganizationController.GetAccount(itemId, accountId); if (user != null) - lync.DeleteUser(user.PrimaryEmailAddress); + lync.DeleteUser(user.UserPrincipalName); } catch (Exception ex) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 3766094f..6c7d9d64 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,11 +5,19 @@ - + + - - + + + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs index 16c4328b..311b66f9 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs @@ -119,6 +119,13 @@ namespace WebsitePanel.EnterpriseServer return LyncController.GetLyncUserGeneralSettings(itemId, accountId); } + [WebMethod] + public bool SetLyncUserGeneralSettings(int itemId, int accountId, string sipAddress, string lineUri) + { + return LyncController.SetLyncUserGeneralSettings(itemId, accountId, sipAddress, lineUri); + } + + [WebMethod] public LyncUserResult SetUserLyncPlan(int itemId, int accountId, int lyncUserPlanId) { diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs index ef1047a0..16d7e005 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs @@ -39,6 +39,7 @@ namespace WebsitePanel.Providers.HostedSolution bool CreateUser(string organizationId, string userUpn, LyncUserPlan plan); LyncUser GetLyncUserGeneralSettings(string organizationId, string userUpn); + bool SetLyncUserGeneralSettings(string organizationId, string userUpn, LyncUser lyncUser); bool SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan); bool DeleteUser(string userUpn); diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs index ed619edb..f058c759 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs @@ -127,6 +127,12 @@ namespace WebsitePanel.Providers.HostedSolution return GetLyncUserGeneralSettingsInternal(organizationId, userUpn); } + public bool SetLyncUserGeneralSettings(string organizationId, string userUpn, LyncUser lyncUser) + { + return SetLyncUserGeneralSettingsInternal(organizationId, userUpn, lyncUser); + } + + public bool SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan) { return SetLyncUserPlanInternal(organizationId, userUpn, plan, null); @@ -524,6 +530,40 @@ namespace WebsitePanel.Providers.HostedSolution return lyncUser; } + private bool SetLyncUserGeneralSettingsInternal(string organizationId, string userUpn, LyncUser lyncUser) + { + HostedSolutionLog.LogStart("SetLyncUserGeneralSettingsInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + HostedSolutionLog.DebugInfo("userUpn: {0}", userUpn); + + bool ret = true; + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Set-CsUser"); + cmd.Parameters.Add("Identity", userUpn); + if (!string.IsNullOrEmpty(lyncUser.PrimaryUri)) cmd.Parameters.Add("SipAddress", lyncUser.PrimaryUri); + if (!string.IsNullOrEmpty(lyncUser.PrimaryUri)) cmd.Parameters.Add("LineUri", lyncUser.LineUri); + + ExecuteShellCommand(runSpace, cmd, false); + } + catch (Exception ex) + { + ret = false; + HostedSolutionLog.LogError("SetLyncUserGeneralSettingsInternal", ex); + throw; + } + finally + { + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("SetLyncUserGeneralSettingsInternal"); + return ret; + } + + private bool SetLyncUserPlanInternal(string organizationId, string userUpn, LyncUserPlan plan, Runspace runSpace) { diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs index 846a78f8..299ccff6 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs @@ -26,11 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.5456 +// Runtime Version:2.0.50727.6400 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -38,91 +37,93 @@ //------------------------------------------------------------------------------ // -// This source code was auto-generated by wsdl, Version=2.0.50727.42. +// This source code was auto-generated by wsdl, Version=2.0.50727.3038. // + using WebsitePanel.Providers.HostedSolution; -namespace WebsitePanel.Providers.Lync -{ +namespace WebsitePanel.Providers.Lync { using System.Xml.Serialization; using System.Web.Services; using System.ComponentModel; using System.Web.Services.Protocols; using System; using System.Diagnostics; - - + + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name = "LyncServerSoap", Namespace = "http://smbsaas/websitepanel/server/")] - public partial class LyncServer : Microsoft.Web.Services3.WebServicesClientProtocol - { - + [System.Web.Services.WebServiceBindingAttribute(Name="LyncServerSoap", Namespace="http://smbsaas/websitepanel/server/")] + public partial class LyncServer : Microsoft.Web.Services3.WebServicesClientProtocol { + public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue; - + private System.Threading.SendOrPostCallback CreateOrganizationOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteOrganizationOperationCompleted; - + private System.Threading.SendOrPostCallback CreateUserOperationCompleted; - + private System.Threading.SendOrPostCallback GetLyncUserGeneralSettingsOperationCompleted; - + + private System.Threading.SendOrPostCallback SetLyncUserGeneralSettingsOperationCompleted; + private System.Threading.SendOrPostCallback SetLyncUserPlanOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteUserOperationCompleted; - + private System.Threading.SendOrPostCallback GetFederationDomainsOperationCompleted; - + private System.Threading.SendOrPostCallback AddFederationDomainOperationCompleted; - + private System.Threading.SendOrPostCallback RemoveFederationDomainOperationCompleted; - + private System.Threading.SendOrPostCallback ReloadConfigurationOperationCompleted; - + /// - public LyncServer() - { + public LyncServer() { this.Url = "http://localhost:9003/LyncServer.asmx"; } - + /// public event CreateOrganizationCompletedEventHandler CreateOrganizationCompleted; - + /// public event DeleteOrganizationCompletedEventHandler DeleteOrganizationCompleted; - + /// public event CreateUserCompletedEventHandler CreateUserCompleted; - + /// public event GetLyncUserGeneralSettingsCompletedEventHandler GetLyncUserGeneralSettingsCompleted; - + + /// + public event SetLyncUserGeneralSettingsCompletedEventHandler SetLyncUserGeneralSettingsCompleted; + /// public event SetLyncUserPlanCompletedEventHandler SetLyncUserPlanCompleted; - + /// public event DeleteUserCompletedEventHandler DeleteUserCompleted; - + /// public event GetFederationDomainsCompletedEventHandler GetFederationDomainsCompleted; - + /// public event AddFederationDomainCompletedEventHandler AddFederationDomainCompleted; - + /// public event RemoveFederationDomainCompletedEventHandler RemoveFederationDomainCompleted; - + /// public event ReloadConfigurationCompletedEventHandler ReloadConfigurationCompleted; - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateOrganization", 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 string CreateOrganization(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateOrganization", 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 string CreateOrganization(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) { object[] results = this.Invoke("CreateOrganization", new object[] { organizationId, sipDomain, @@ -133,10 +134,9 @@ namespace WebsitePanel.Providers.Lync enabledEnterpriseVoice}); return ((string)(results[0])); } - + /// - public System.IAsyncResult BeginCreateOrganization(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCreateOrganization(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateOrganization", new object[] { organizationId, sipDomain, @@ -146,25 +146,21 @@ namespace WebsitePanel.Providers.Lync enabledFederation, enabledEnterpriseVoice}, callback, asyncState); } - + /// - public string EndCreateOrganization(System.IAsyncResult asyncResult) - { + public string EndCreateOrganization(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } - + /// - public void CreateOrganizationAsync(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) - { + public void CreateOrganizationAsync(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) { this.CreateOrganizationAsync(organizationId, sipDomain, enableConferencing, enableConferencingVideo, maxConferenceSize, enabledFederation, enabledEnterpriseVoice, null); } - + /// - public void CreateOrganizationAsync(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice, object userState) - { - if ((this.CreateOrganizationOperationCompleted == null)) - { + public void CreateOrganizationAsync(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice, object userState) { + if ((this.CreateOrganizationOperationCompleted == null)) { this.CreateOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationOperationCompleted); } this.InvokeAsync("CreateOrganization", new object[] { @@ -176,108 +172,92 @@ namespace WebsitePanel.Providers.Lync enabledFederation, enabledEnterpriseVoice}, this.CreateOrganizationOperationCompleted, userState); } - - private void OnCreateOrganizationOperationCompleted(object arg) - { - if ((this.CreateOrganizationCompleted != null)) - { + + private void OnCreateOrganizationOperationCompleted(object arg) { + if ((this.CreateOrganizationCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateOrganizationCompleted(this, new CreateOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteOrganization", 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 bool DeleteOrganization(string organizationId, string sipDomain) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteOrganization", 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 bool DeleteOrganization(string organizationId, string sipDomain) { object[] results = this.Invoke("DeleteOrganization", new object[] { organizationId, sipDomain}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginDeleteOrganization(string organizationId, string sipDomain, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDeleteOrganization(string organizationId, string sipDomain, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteOrganization", new object[] { organizationId, sipDomain}, callback, asyncState); } - + /// - public bool EndDeleteOrganization(System.IAsyncResult asyncResult) - { + public bool EndDeleteOrganization(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void DeleteOrganizationAsync(string organizationId, string sipDomain) - { + public void DeleteOrganizationAsync(string organizationId, string sipDomain) { this.DeleteOrganizationAsync(organizationId, sipDomain, null); } - + /// - public void DeleteOrganizationAsync(string organizationId, string sipDomain, object userState) - { - if ((this.DeleteOrganizationOperationCompleted == null)) - { + public void DeleteOrganizationAsync(string organizationId, string sipDomain, object userState) { + if ((this.DeleteOrganizationOperationCompleted == null)) { this.DeleteOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationOperationCompleted); } this.InvokeAsync("DeleteOrganization", new object[] { organizationId, sipDomain}, this.DeleteOrganizationOperationCompleted, userState); } - - private void OnDeleteOrganizationOperationCompleted(object arg) - { - if ((this.DeleteOrganizationCompleted != null)) - { + + private void OnDeleteOrganizationOperationCompleted(object arg) { + if ((this.DeleteOrganizationCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteOrganizationCompleted(this, new DeleteOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateUser", 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 bool CreateUser(string organizationId, string userUpn, LyncUserPlan plan) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateUser", 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 bool CreateUser(string organizationId, string userUpn, LyncUserPlan plan) { object[] results = this.Invoke("CreateUser", new object[] { organizationId, userUpn, plan}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginCreateUser(string organizationId, string userUpn, LyncUserPlan plan, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCreateUser(string organizationId, string userUpn, LyncUserPlan plan, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateUser", new object[] { organizationId, userUpn, plan}, callback, asyncState); } - + /// - public bool EndCreateUser(System.IAsyncResult asyncResult) - { + public bool EndCreateUser(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void CreateUserAsync(string organizationId, string userUpn, LyncUserPlan plan) - { + public void CreateUserAsync(string organizationId, string userUpn, LyncUserPlan plan) { this.CreateUserAsync(organizationId, userUpn, plan, null); } - + /// - public void CreateUserAsync(string organizationId, string userUpn, LyncUserPlan plan, object userState) - { - if ((this.CreateUserOperationCompleted == null)) - { + public void CreateUserAsync(string organizationId, string userUpn, LyncUserPlan plan, object userState) { + if ((this.CreateUserOperationCompleted == null)) { this.CreateUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateUserOperationCompleted); } this.InvokeAsync("CreateUser", new object[] { @@ -285,108 +265,140 @@ namespace WebsitePanel.Providers.Lync userUpn, plan}, this.CreateUserOperationCompleted, userState); } - - private void OnCreateUserOperationCompleted(object arg) - { - if ((this.CreateUserCompleted != null)) - { + + private void OnCreateUserOperationCompleted(object arg) { + if ((this.CreateUserCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateUserCompleted(this, new CreateUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetLyncUserGeneralSettings", 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 LyncUser GetLyncUserGeneralSettings(string organizationId, string userUpn) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetLyncUserGeneralSettings", 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 LyncUser GetLyncUserGeneralSettings(string organizationId, string userUpn) { object[] results = this.Invoke("GetLyncUserGeneralSettings", new object[] { organizationId, userUpn}); return ((LyncUser)(results[0])); } - + /// - public System.IAsyncResult BeginGetLyncUserGeneralSettings(string organizationId, string userUpn, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetLyncUserGeneralSettings(string organizationId, string userUpn, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetLyncUserGeneralSettings", new object[] { organizationId, userUpn}, callback, asyncState); } - + /// - public LyncUser EndGetLyncUserGeneralSettings(System.IAsyncResult asyncResult) - { + public LyncUser EndGetLyncUserGeneralSettings(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((LyncUser)(results[0])); } - + /// - public void GetLyncUserGeneralSettingsAsync(string organizationId, string userUpn) - { + public void GetLyncUserGeneralSettingsAsync(string organizationId, string userUpn) { this.GetLyncUserGeneralSettingsAsync(organizationId, userUpn, null); } - + /// - public void GetLyncUserGeneralSettingsAsync(string organizationId, string userUpn, object userState) - { - if ((this.GetLyncUserGeneralSettingsOperationCompleted == null)) - { + public void GetLyncUserGeneralSettingsAsync(string organizationId, string userUpn, object userState) { + if ((this.GetLyncUserGeneralSettingsOperationCompleted == null)) { this.GetLyncUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetLyncUserGeneralSettingsOperationCompleted); } this.InvokeAsync("GetLyncUserGeneralSettings", new object[] { organizationId, userUpn}, this.GetLyncUserGeneralSettingsOperationCompleted, userState); } - - private void OnGetLyncUserGeneralSettingsOperationCompleted(object arg) - { - if ((this.GetLyncUserGeneralSettingsCompleted != null)) - { + + private void OnGetLyncUserGeneralSettingsOperationCompleted(object arg) { + if ((this.GetLyncUserGeneralSettingsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetLyncUserGeneralSettingsCompleted(this, new GetLyncUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetLyncUserPlan", 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 bool SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetLyncUserGeneralSettings", 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 bool SetLyncUserGeneralSettings(string organizationId, string userUpn, LyncUser lyncUser) { + object[] results = this.Invoke("SetLyncUserGeneralSettings", new object[] { + organizationId, + userUpn, + lyncUser}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginSetLyncUserGeneralSettings(string organizationId, string userUpn, LyncUser lyncUser, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetLyncUserGeneralSettings", new object[] { + organizationId, + userUpn, + lyncUser}, callback, asyncState); + } + + /// + public bool EndSetLyncUserGeneralSettings(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void SetLyncUserGeneralSettingsAsync(string organizationId, string userUpn, LyncUser lyncUser) { + this.SetLyncUserGeneralSettingsAsync(organizationId, userUpn, lyncUser, null); + } + + /// + public void SetLyncUserGeneralSettingsAsync(string organizationId, string userUpn, LyncUser lyncUser, object userState) { + if ((this.SetLyncUserGeneralSettingsOperationCompleted == null)) { + this.SetLyncUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetLyncUserGeneralSettingsOperationCompleted); + } + this.InvokeAsync("SetLyncUserGeneralSettings", new object[] { + organizationId, + userUpn, + lyncUser}, this.SetLyncUserGeneralSettingsOperationCompleted, userState); + } + + private void OnSetLyncUserGeneralSettingsOperationCompleted(object arg) { + if ((this.SetLyncUserGeneralSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetLyncUserGeneralSettingsCompleted(this, new SetLyncUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetLyncUserPlan", 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 bool SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan) { object[] results = this.Invoke("SetLyncUserPlan", new object[] { organizationId, userUpn, plan}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginSetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginSetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetLyncUserPlan", new object[] { organizationId, userUpn, plan}, callback, asyncState); } - + /// - public bool EndSetLyncUserPlan(System.IAsyncResult asyncResult) - { + public bool EndSetLyncUserPlan(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void SetLyncUserPlanAsync(string organizationId, string userUpn, LyncUserPlan plan) - { + public void SetLyncUserPlanAsync(string organizationId, string userUpn, LyncUserPlan plan) { this.SetLyncUserPlanAsync(organizationId, userUpn, plan, null); } - + /// - public void SetLyncUserPlanAsync(string organizationId, string userUpn, LyncUserPlan plan, object userState) - { - if ((this.SetLyncUserPlanOperationCompleted == null)) - { + public void SetLyncUserPlanAsync(string organizationId, string userUpn, LyncUserPlan plan, object userState) { + if ((this.SetLyncUserPlanOperationCompleted == null)) { this.SetLyncUserPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetLyncUserPlanOperationCompleted); } this.InvokeAsync("SetLyncUserPlan", new object[] { @@ -394,155 +406,131 @@ namespace WebsitePanel.Providers.Lync userUpn, plan}, this.SetLyncUserPlanOperationCompleted, userState); } - - private void OnSetLyncUserPlanOperationCompleted(object arg) - { - if ((this.SetLyncUserPlanCompleted != null)) - { + + private void OnSetLyncUserPlanOperationCompleted(object arg) { + if ((this.SetLyncUserPlanCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SetLyncUserPlanCompleted(this, new SetLyncUserPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteUser", 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 bool DeleteUser(string userUpn) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteUser", 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 bool DeleteUser(string userUpn) { object[] results = this.Invoke("DeleteUser", new object[] { userUpn}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginDeleteUser(string userUpn, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDeleteUser(string userUpn, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteUser", new object[] { userUpn}, callback, asyncState); } - + /// - public bool EndDeleteUser(System.IAsyncResult asyncResult) - { + public bool EndDeleteUser(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void DeleteUserAsync(string userUpn) - { + public void DeleteUserAsync(string userUpn) { this.DeleteUserAsync(userUpn, null); } - + /// - public void DeleteUserAsync(string userUpn, object userState) - { - if ((this.DeleteUserOperationCompleted == null)) - { + public void DeleteUserAsync(string userUpn, object userState) { + if ((this.DeleteUserOperationCompleted == null)) { this.DeleteUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteUserOperationCompleted); } this.InvokeAsync("DeleteUser", new object[] { userUpn}, this.DeleteUserOperationCompleted, userState); } - - private void OnDeleteUserOperationCompleted(object arg) - { - if ((this.DeleteUserCompleted != null)) - { + + private void OnDeleteUserOperationCompleted(object arg) { + if ((this.DeleteUserCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteUserCompleted(this, new DeleteUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFederationDomains", 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 LyncFederationDomain[] GetFederationDomains(string organizationId) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFederationDomains", 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 LyncFederationDomain[] GetFederationDomains(string organizationId) { object[] results = this.Invoke("GetFederationDomains", new object[] { organizationId}); return ((LyncFederationDomain[])(results[0])); } - + /// - public System.IAsyncResult BeginGetFederationDomains(string organizationId, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetFederationDomains(string organizationId, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetFederationDomains", new object[] { organizationId}, callback, asyncState); } - + /// - public LyncFederationDomain[] EndGetFederationDomains(System.IAsyncResult asyncResult) - { + public LyncFederationDomain[] EndGetFederationDomains(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((LyncFederationDomain[])(results[0])); } - + /// - public void GetFederationDomainsAsync(string organizationId) - { + public void GetFederationDomainsAsync(string organizationId) { this.GetFederationDomainsAsync(organizationId, null); } - + /// - public void GetFederationDomainsAsync(string organizationId, object userState) - { - if ((this.GetFederationDomainsOperationCompleted == null)) - { + public void GetFederationDomainsAsync(string organizationId, object userState) { + if ((this.GetFederationDomainsOperationCompleted == null)) { this.GetFederationDomainsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFederationDomainsOperationCompleted); } this.InvokeAsync("GetFederationDomains", new object[] { organizationId}, this.GetFederationDomainsOperationCompleted, userState); } - - private void OnGetFederationDomainsOperationCompleted(object arg) - { - if ((this.GetFederationDomainsCompleted != null)) - { + + private void OnGetFederationDomainsOperationCompleted(object arg) { + if ((this.GetFederationDomainsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetFederationDomainsCompleted(this, new GetFederationDomainsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddFederationDomain", 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 bool AddFederationDomain(string organizationId, string domainName, string proxyFqdn) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddFederationDomain", 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 bool AddFederationDomain(string organizationId, string domainName, string proxyFqdn) { object[] results = this.Invoke("AddFederationDomain", new object[] { organizationId, domainName, proxyFqdn}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginAddFederationDomain(string organizationId, string domainName, string proxyFqdn, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginAddFederationDomain(string organizationId, string domainName, string proxyFqdn, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("AddFederationDomain", new object[] { organizationId, domainName, proxyFqdn}, callback, asyncState); } - + /// - public bool EndAddFederationDomain(System.IAsyncResult asyncResult) - { + public bool EndAddFederationDomain(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void AddFederationDomainAsync(string organizationId, string domainName, string proxyFqdn) - { + public void AddFederationDomainAsync(string organizationId, string domainName, string proxyFqdn) { this.AddFederationDomainAsync(organizationId, domainName, proxyFqdn, null); } - + /// - public void AddFederationDomainAsync(string organizationId, string domainName, string proxyFqdn, object userState) - { - if ((this.AddFederationDomainOperationCompleted == null)) - { + public void AddFederationDomainAsync(string organizationId, string domainName, string proxyFqdn, object userState) { + if ((this.AddFederationDomainOperationCompleted == null)) { this.AddFederationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddFederationDomainOperationCompleted); } this.InvokeAsync("AddFederationDomain", new object[] { @@ -550,392 +538,363 @@ namespace WebsitePanel.Providers.Lync domainName, proxyFqdn}, this.AddFederationDomainOperationCompleted, userState); } - - private void OnAddFederationDomainOperationCompleted(object arg) - { - if ((this.AddFederationDomainCompleted != null)) - { + + private void OnAddFederationDomainOperationCompleted(object arg) { + if ((this.AddFederationDomainCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.AddFederationDomainCompleted(this, new AddFederationDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveFederationDomain", 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 bool RemoveFederationDomain(string organizationId, string domainName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveFederationDomain", 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 bool RemoveFederationDomain(string organizationId, string domainName) { object[] results = this.Invoke("RemoveFederationDomain", new object[] { organizationId, domainName}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginRemoveFederationDomain(string organizationId, string domainName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginRemoveFederationDomain(string organizationId, string domainName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("RemoveFederationDomain", new object[] { organizationId, domainName}, callback, asyncState); } - + /// - public bool EndRemoveFederationDomain(System.IAsyncResult asyncResult) - { + public bool EndRemoveFederationDomain(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void RemoveFederationDomainAsync(string organizationId, string domainName) - { + public void RemoveFederationDomainAsync(string organizationId, string domainName) { this.RemoveFederationDomainAsync(organizationId, domainName, null); } - + /// - public void RemoveFederationDomainAsync(string organizationId, string domainName, object userState) - { - if ((this.RemoveFederationDomainOperationCompleted == null)) - { + public void RemoveFederationDomainAsync(string organizationId, string domainName, object userState) { + if ((this.RemoveFederationDomainOperationCompleted == null)) { this.RemoveFederationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveFederationDomainOperationCompleted); } this.InvokeAsync("RemoveFederationDomain", new object[] { organizationId, domainName}, this.RemoveFederationDomainOperationCompleted, userState); } - - private void OnRemoveFederationDomainOperationCompleted(object arg) - { - if ((this.RemoveFederationDomainCompleted != null)) - { + + private void OnRemoveFederationDomainOperationCompleted(object arg) { + if ((this.RemoveFederationDomainCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.RemoveFederationDomainCompleted(this, new RemoveFederationDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ReloadConfiguration", 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 ReloadConfiguration() - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ReloadConfiguration", 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 ReloadConfiguration() { this.Invoke("ReloadConfiguration", new object[0]); } - + /// - public System.IAsyncResult BeginReloadConfiguration(System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginReloadConfiguration(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("ReloadConfiguration", new object[0], callback, asyncState); } - + /// - public void EndReloadConfiguration(System.IAsyncResult asyncResult) - { + public void EndReloadConfiguration(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void ReloadConfigurationAsync() - { + public void ReloadConfigurationAsync() { this.ReloadConfigurationAsync(null); } - + /// - public void ReloadConfigurationAsync(object userState) - { - if ((this.ReloadConfigurationOperationCompleted == null)) - { + public void ReloadConfigurationAsync(object userState) { + if ((this.ReloadConfigurationOperationCompleted == null)) { this.ReloadConfigurationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnReloadConfigurationOperationCompleted); } this.InvokeAsync("ReloadConfiguration", new object[0], this.ReloadConfigurationOperationCompleted, userState); } - - private void OnReloadConfigurationOperationCompleted(object arg) - { - if ((this.ReloadConfigurationCompleted != null)) - { + + private void OnReloadConfigurationOperationCompleted(object arg) { + if ((this.ReloadConfigurationCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.ReloadConfigurationCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - public new void CancelAsync(object userState) - { + public new void CancelAsync(object userState) { base.CancelAsync(userState); } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreateOrganizationCompletedEventHandler(object sender, CreateOrganizationCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CreateOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class CreateOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal CreateOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal CreateOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public string Result - { - get - { + public string Result { + get { this.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteOrganizationCompletedEventHandler(object sender, DeleteOrganizationCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeleteOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class DeleteOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal DeleteOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal DeleteOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreateUserCompletedEventHandler(object sender, CreateUserCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CreateUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class CreateUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal CreateUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal CreateUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetLyncUserGeneralSettingsCompletedEventHandler(object sender, GetLyncUserGeneralSettingsCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetLyncUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetLyncUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetLyncUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetLyncUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public LyncUser Result - { - get - { + public LyncUser Result { + get { this.RaiseExceptionIfNecessary(); return ((LyncUser)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void SetLyncUserGeneralSettingsCompletedEventHandler(object sender, SetLyncUserGeneralSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetLyncUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SetLyncUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public bool Result { + get { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetLyncUserPlanCompletedEventHandler(object sender, SetLyncUserPlanCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetLyncUserPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class SetLyncUserPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal SetLyncUserPlanCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal SetLyncUserPlanCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteUserCompletedEventHandler(object sender, DeleteUserCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeleteUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class DeleteUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal DeleteUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal DeleteUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetFederationDomainsCompletedEventHandler(object sender, GetFederationDomainsCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetFederationDomainsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetFederationDomainsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetFederationDomainsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetFederationDomainsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public LyncFederationDomain[] Result - { - get - { + public LyncFederationDomain[] Result { + get { this.RaiseExceptionIfNecessary(); return ((LyncFederationDomain[])(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void AddFederationDomainCompletedEventHandler(object sender, AddFederationDomainCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class AddFederationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class AddFederationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal AddFederationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal AddFederationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void RemoveFederationDomainCompletedEventHandler(object sender, RemoveFederationDomainCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class RemoveFederationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class RemoveFederationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal RemoveFederationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal RemoveFederationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void ReloadConfigurationCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs index 8f04045d..b55428ec 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs @@ -124,6 +124,24 @@ namespace WebsitePanel.Server } } + [WebMethod, SoapHeader("settings")] + public bool SetLyncUserGeneralSettings(string organizationId, string userUpn, LyncUser lyncUser) + { + try + { + Log.WriteStart("{0}.SetLyncUserGeneralSettings", ProviderSettings.ProviderName); + bool ret = Lync.SetLyncUserGeneralSettings(organizationId, userUpn, lyncUser); + Log.WriteEnd("{0}.SetLyncUserGeneralSettings", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.SetLyncUserGeneralSettings", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] public bool SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan) { diff --git a/WebsitePanel/Sources/generate_es_proxies.bat b/WebsitePanel/Sources/generate_es_proxies.bat index a6c063c5..0f50b419 100644 --- a/WebsitePanel/Sources/generate_es_proxies.bat +++ b/WebsitePanel/Sources/generate_es_proxies.bat @@ -65,8 +65,8 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\PackagesProxy.cs REM %WSDL% %SERVER_URL%/esScheduler.asmx /out:.\WebsitePanel.EnterpriseServer.Client\SchedulerProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\SchedulerProxy.cs -%WSDL% %SERVER_URL%/esServers.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ServersProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient -%WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ServersProxy.cs +REM %WSDL% %SERVER_URL%/esServers.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ServersProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient +REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ServersProxy.cs REM %WSDL% %SERVER_URL%/esSharePointServers.asmx /out:.\WebsitePanel.EnterpriseServer.Client\SharePointServersProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\SharePointServersProxy.cs @@ -92,8 +92,8 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\WebServersProxy.cs REM %WSDL% %SERVER_URL%/esVirtualizationServerForPrivateCloud.asmx /out:.\WebsitePanel.EnterpriseServer.Client\VirtualizationServerProxyForPrivateCloud.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\VirtualizationServerProxyForPrivateCloud.cs -REM %WSDL% %SERVER_URL%/esLync.asmx /out:.\WebsitePanel.EnterpriseServer.Client\LyncProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient -REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\LyncProxy.cs +%WSDL% %SERVER_URL%/esLync.asmx /out:.\WebsitePanel.EnterpriseServer.Client\LyncProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient +%WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\LyncProxy.cs diff --git a/WebsitePanel/Sources/generate_server_proxies.bat b/WebsitePanel/Sources/generate_server_proxies.bat index 1d02b7f0..8c3cfdee 100644 --- a/WebsitePanel/Sources/generate_server_proxies.bat +++ b/WebsitePanel/Sources/generate_server_proxies.bat @@ -50,13 +50,13 @@ REM %WSE_CLEAN% .\WebsitePanel.Server.Client\VirtualizationServerProxy.cs REM %WSDL% %SERVER_URL%/VirtualizationServerForPrivateCloud.asmx /out:.\WebsitePanel.Server.Client\VirtualizationServerForPrivateCloudProxy.cs /namespace:WebsitePanel.Providers.VirtualizationForPC /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\VirtualizationServerForPrivateCloudProxy.cs -%WSDL% %SERVER_URL%/WebServer.asmx /out:.\WebsitePanel.Server.Client\WebServerProxy.cs /namespace:WebsitePanel.Providers.Web /type:webClient /fields -%WSE_CLEAN% .\WebsitePanel.Server.Client\WebServerProxy.cs +REM %WSDL% %SERVER_URL%/WebServer.asmx /out:.\WebsitePanel.Server.Client\WebServerProxy.cs /namespace:WebsitePanel.Providers.Web /type:webClient /fields +REM %WSE_CLEAN% .\WebsitePanel.Server.Client\WebServerProxy.cs REM %WSDL% %SERVER_URL%/WindowsServer.asmx /out:.\WebsitePanel.Server.Client\WindowsServerProxy.cs /namespace:WebsitePanel.Server /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\WindowsServerProxy.cs -REM %WSDL% %SERVER_URL%/LyncServer.asmx /out:.\WebsitePanel.Server.Client\LyncServerProxy.cs /namespace:WebsitePanel.Providers.Lync /type:webClient /fields -REM %WSE_CLEAN% .\WebsitePanel.Server.Client\LyncServerProxy.cs +%WSDL% %SERVER_URL%/LyncServer.asmx /out:.\WebsitePanel.Server.Client\LyncServerProxy.cs /namespace:WebsitePanel.Providers.Lync /type:webClient /fields +%WSE_CLEAN% .\WebsitePanel.Server.Client\LyncServerProxy.cs From 67e47f37f56359502470144b6211fb3054fc6802 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 20 Nov 2012 13:52:51 -0500 Subject: [PATCH 102/107] Merge --- .../WebsitePanel.EnterpriseServer/Web.config | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 6c7d9d64..3766094f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,19 +5,11 @@ - - + - - - + + From 265f0a0e0229f8c9bc2ae09d065bd59e4ddafd4b Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 20 Nov 2012 14:05:59 -0500 Subject: [PATCH 103/107] Added tag build-2.0.0.182 for changeset 33b9234ebc6c From 5cc40e16127339365f96e2df3a122acd69e251d1 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 20 Nov 2012 14:09:48 -0500 Subject: [PATCH 104/107] Added tag build-2.0.0.183 for changeset ea5838597a87 From 6cf946b6b442c30051ad266d97e51402d881c4a3 Mon Sep 17 00:00:00 2001 From: robvde Date: Thu, 22 Nov 2012 13:16:41 +0400 Subject: [PATCH 105/107] Fixed: Decoupling of userprincipalName and PrimaryEmailAddress OrganizationUsers updated with image buttons with the ability to go directly to offering settings When changing primaryemailaddress, sip address changes accordingly Mailboxes list view updated with Login (=userprincipalName) with the ability to go directly to user setting Lync list view updated with Login (=userprincipalName) with the ability to go directly to user setting --- WebsitePanel/Database/update_db.sql | 386 ++++++++++++++++-- .../LyncProxy.cs | 13 +- .../Code/Data/DataProvider.cs | 37 +- .../ExchangeServerController.cs | 5 + .../Code/HostedSolution/LyncController.cs | 38 +- .../Code/HostedSolution/ReportController.cs | 2 +- .../esLync.asmx.cs | 2 +- .../HostedSolution/ExchangeAccount.cs | 7 + .../HostedSolution/LyncErrorCodes.cs | 3 + .../HostedSolution/LyncUser.cs | 4 +- .../Exchange2007.cs | 2 +- .../Lync2010.cs | 86 +++- .../ExchangeMailboxes.ascx.resx | 6 + .../OrganizationUsers.ascx.resx | 6 + .../ExchangeServer/ExchangeMailboxes.ascx | 10 + .../ExchangeServer/ExchangeMailboxes.ascx.cs | 12 +- .../ExchangeServer/OrganizationUsers.ascx | 14 +- .../ExchangeServer/OrganizationUsers.ascx.cs | 95 ++++- .../App_LocalResources/LyncEditUser.ascx.resx | 3 + .../App_LocalResources/LyncUsers.ascx.resx | 9 +- .../WebsitePanel/Lync/LyncEditUser.ascx | 10 + .../WebsitePanel/Lync/LyncEditUser.ascx.cs | 9 + .../Lync/LyncEditUser.ascx.designer.cs | 58 +-- .../WebsitePanel/Lync/LyncUsers.ascx | 17 +- .../WebsitePanel/Lync/LyncUsers.ascx.cs | 11 +- .../Lync/LyncUsers.ascx.designer.cs | 9 - .../Lync/UserControls/LyncUserSettings.ascx | 2 + .../UserControls/LyncUserSettings.ascx.cs | 102 +++++ .../LyncUserSettings.ascx.designer.cs | 24 ++ .../WebsitePanel.Portal.Modules.csproj | 8 + 30 files changed, 869 insertions(+), 121 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.designer.cs diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index aba5730d..65f678f4 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -569,6 +569,19 @@ UPDATE [dbo].[Quotas] SET [HideQuota] = 1 WHERE [QuotaName] = N'OS.DomainPointer GO +/****** Object: Table [dbo].[ExchangeAccounts] Extend Exchange Accounts with UserPrincipalName ******/ +IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='ExchangeAccounts' AND COLS.name='UserPrincipalName') +BEGIN +ALTER TABLE [dbo].[ExchangeAccounts] ADD + [UserPrincipalName] [nvarchar] (300) COLLATE Latin1_General_CI_AS NULL +END +GO + +IF NOT EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE UserPrincipalName IS NOT NULL) +BEGIN + UPDATE [dbo].[ExchangeAccounts] SET [UserPrincipalName] = PrimaryEmailAddress +END +GO /****** Object: Table [dbo].[ExchangeAccounts] Extend Exchange Accounts with SubscriberNumber ******/ @@ -1468,7 +1481,8 @@ INSERT INTO ExchangeAccounts SamAccountName, AccountPassword, MailboxPlanId, - SubscriberNumber + SubscriberNumber, + UserPrincipalName ) VALUES ( @@ -1482,7 +1496,8 @@ VALUES @SamAccountName, @AccountPassword, @MailboxPlanId, - @SubscriberNumber + @SubscriberNumber, + @PrimaryEmailAddress ) SET @AccountID = SCOPE_IDENTITY() @@ -2157,7 +2172,8 @@ SELECT E.MailEnabledPublicFolder, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2242,7 +2258,8 @@ WITH Accounts AS ( EA.PrimaryEmailAddress, EA.MailEnabledPublicFolder, EA.MailboxPlanId, - EA.SubscriberNumber ' + @joincondition + + EA.SubscriberNumber, + EA.UserPrincipalName ' + @joincondition + ' WHERE ' + @condition + ' ) @@ -2291,7 +2308,8 @@ SELECT E.AccountPassword, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2304,6 +2322,37 @@ GO +ALTER PROCEDURE [dbo].[GetExchangeAccountByAccountName] +( + @ItemID int, + @AccountName nvarchar(300) +) +AS +SELECT + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxManagerActions, + E.SamAccountName, + E.AccountPassword, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber, + E.UserPrincipalName +FROM + ExchangeAccounts AS E +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId +WHERE + E.ItemID = @ItemID AND + E.AccountName = @AccountName +RETURN +GO + + IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetExchangeAccountByMailboxPlanId') @@ -2330,7 +2379,8 @@ SELECT E.AccountPassword, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2357,7 +2407,8 @@ SELECT E.AccountPassword, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2380,7 +2431,8 @@ SELECT E.AccountPassword, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2420,7 +2472,8 @@ SELECT E.AccountPassword, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2447,7 +2500,8 @@ SELECT E.AccountPassword, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2470,7 +2524,8 @@ SELECT E.AccountPassword, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2917,7 +2972,8 @@ SELECT E.AccountPassword, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2947,7 +3003,8 @@ SELECT DisplayName, PrimaryEmailAddress, MailEnabledPublicFolder, - SubscriberNumber + SubscriberNumber, + UserPrincipalName FROM ExchangeAccounts WHERE @@ -3009,7 +3066,8 @@ SELECT MailboxManagerActions, SamAccountName, AccountPassword, - SubscriberNumber + SubscriberNumber, + UserPrincipalName FROM ExchangeAccounts WHERE AccountID = @AccountID @@ -3078,7 +3136,8 @@ SELECT EA.DisplayName, EA.PrimaryEmailAddress, EA.MailEnabledPublicFolder, - EA.SubscriberNumber + EA.SubscriberNumber, + EA.UserPrincipalName FROM ExchangeAccounts AS EA WHERE ' + @condition @@ -3151,7 +3210,8 @@ SELECT EA.AccountName, EA.DisplayName, EA.PrimaryEmailAddress, - EA.SubscriberNumber + EA.SubscriberNumber, + EA.UserPrincipalName FROM ExchangeAccounts AS EA WHERE ' + @condition @@ -3211,7 +3271,7 @@ AS ea.ItemID, ea.AccountName, ea.DisplayName, - ea.PrimaryEmailAddress, + ea.UserPrincipalName, ea.SamAccountName, ou.LyncUserPlanId, lp.LyncUserPlanName @@ -3249,7 +3309,7 @@ AS ea.ItemID, ea.AccountName, ea.DisplayName, - ea.PrimaryEmailAddress, + ea.UserPrincipalName, ea.SamAccountName, ou.LyncUserPlanId, lp.LyncUserPlanName @@ -3678,6 +3738,13 @@ RETURN GO +IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='LyncUsers' AND COLS.name='SipAddress') +BEGIN +ALTER TABLE [dbo].[LyncUsers] ADD + [SipAddress] [nvarchar] (300) COLLATE Latin1_General_CI_AS NULL +END +GO + IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetLyncUsers') @@ -3699,7 +3766,8 @@ CREATE TABLE #TempLyncUsers [ItemID] [int] NOT NULL, [AccountName] [nvarchar](300) NOT NULL, [DisplayName] [nvarchar](300) NOT NULL, - [PrimaryEmailAddress] [nvarchar](300) NULL, + [UserPrincipalName] [nvarchar](300) NULL, + [SipAddress] [nvarchar](300) NULL, [SamAccountName] [nvarchar](100) NULL, [LyncUserPlanId] [int] NOT NULL, [LyncUserPlanName] [nvarchar] (300) NOT NULL, @@ -3714,11 +3782,17 @@ BEGIN SET @condition = ''ORDER BY ea.DisplayName'' END -IF (@SortColumn = ''PrimaryEmailAddress'') +IF (@SortColumn = ''UserPrincipalName'') BEGIN - SET @condition = ''ORDER BY ea.PrimaryEmailAddress'' + SET @condition = ''ORDER BY ea.UserPrincipalName'' END +IF (@SortColumn = ''SipAddress'') +BEGIN + SET @condition = ''ORDER BY ou.SipAddress'' +END + + IF (@SortColumn = ''LyncUserPlanName'') BEGIN SET @condition = ''ORDER BY lp.LyncUserPlanName'' @@ -3734,7 +3808,8 @@ set @sql = '' ea.ItemID, ea.AccountName, ea.DisplayName, - ea.PrimaryEmailAddress, + ea.UserPrincipalName, + ou.SipAddress, ea.SamAccountName, ou.LyncUserPlanId, lp.LyncUserPlanName @@ -3770,11 +3845,17 @@ BEGIN SELECT * FROM #TempLyncUsers WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY DisplayName DESC END - IF (@SortColumn = ''PrimaryEmailAddress'') + IF (@SortColumn = ''UserPrincipalName'') BEGIN SELECT * FROM #TempLyncUsers - WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY PrimaryEmailAddress DESC + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY UserPrincipalName DESC END + IF (@SortColumn = ''SipAddress'') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY SipAddress DESC + END + IF (@SortColumn = ''LyncUserPlanName'') BEGIN SELECT * FROM #TempLyncUsers @@ -3784,7 +3865,7 @@ BEGIN ELSE BEGIN SELECT * FROM #TempLyncUsers - WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY PrimaryEmailAddress DESC + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY UserPrincipalName DESC END @@ -3797,6 +3878,134 @@ GO +ALTER PROCEDURE [dbo].[GetLyncUsers] +( + @ItemID int, + @SortColumn nvarchar(40), + @SortDirection nvarchar(20), + @StartRow int, + @Count int +) +AS + +CREATE TABLE #TempLyncUsers +( + [ID] [int] IDENTITY(1,1) NOT NULL, + [AccountID] [int], + [ItemID] [int] NOT NULL, + [AccountName] [nvarchar](300) NOT NULL, + [DisplayName] [nvarchar](300) NOT NULL, + [UserPrincipalName] [nvarchar](300) NULL, + [SipAddress] [nvarchar](300) NULL, + [SamAccountName] [nvarchar](100) NULL, + [LyncUserPlanId] [int] NOT NULL, + [LyncUserPlanName] [nvarchar] (300) NOT NULL, +) + + +DECLARE @condition nvarchar(700) +SET @condition = '' + +IF (@SortColumn = 'DisplayName') +BEGIN + SET @condition = 'ORDER BY ea.DisplayName' +END + +IF (@SortColumn = 'UserPrincipalName') +BEGIN + SET @condition = 'ORDER BY ea.UserPrincipalName' +END + +IF (@SortColumn = 'SipAddress') +BEGIN + SET @condition = 'ORDER BY ou.SipAddress' +END + + +IF (@SortColumn = 'LyncUserPlanName') +BEGIN + SET @condition = 'ORDER BY lp.LyncUserPlanName' +END + +DECLARE @sql nvarchar(3500) + +set @sql = '' + INSERT INTO + #TempLyncUsers + SELECT + ea.AccountID, + ea.ItemID, + ea.AccountName, + ea.DisplayName, + ea.UserPrincipalName, + ou.SipAddress, + ea.SamAccountName, + ou.LyncUserPlanId, + lp.LyncUserPlanName + FROM + ExchangeAccounts ea + INNER JOIN + LyncUsers ou + INNER JOIN + LyncUserPlans lp + ON + ou.LyncUserPlanId = lp.LyncUserPlanId + ON + ea.AccountID = ou.AccountID + WHERE + ea.ItemID = @ItemID + @condition + +exec sp_executesql @sql, N'@ItemID int',@ItemID + +DECLARE @RetCount int +SELECT @RetCount = COUNT(ID) FROM #TempLyncUsers + +IF (@SortDirection = 'ASC') +BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID > @StartRow AND ID <= (@StartRow + @Count) +END +ELSE +BEGIN + IF @SortColumn <> '' AND @SortColumn IS NOT NULL + BEGIN + IF (@SortColumn = 'DisplayName') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY DisplayName DESC + END + IF (@SortColumn = 'UserPrincipalName') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY UserPrincipalName DESC + END + + IF (@SortColumn = 'SipAddress') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY SipAddress DESC + END + + IF (@SortColumn = 'LyncUserPlanName') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY LyncUserPlanName DESC + END + END + ELSE + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY UserPrincipalName DESC + END + + +END + +DROP TABLE #TempLyncUsers +GO + + + @@ -6596,4 +6805,129 @@ exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @UserID int, @Filter @StartRow, @MaximumRows, @UserID, @FilterValue, @ItemTypeID, @ActorID RETURN -GO \ No newline at end of file +GO + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'LyncUserExists') +BEGIN +EXEC sp_executesql N' +CREATE PROCEDURE [dbo].[LyncUserExists] +( + @AccountID int, + @SipAddress nvarchar(300), + @Exists bit OUTPUT +) +AS + + SET @Exists = 0 + IF EXISTS(SELECT * FROM [dbo].[ExchangeAccountEmailAddresses] WHERE [EmailAddress] = @SipAddress AND [AccountID] <> @AccountID) + BEGIN + SET @Exists = 1 + END + ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [PrimaryEmailAddress] = @SipAddress AND [AccountID] <> @AccountID) + BEGIN + SET @Exists = 1 + END + ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [UserPrincipalName] = @SipAddress AND [AccountID] <> @AccountID) + BEGIN + SET @Exists = 1 + END + ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [AccountName] = @SipAddress AND [AccountID] <> @AccountID) + BEGIN + SET @Exists = 1 + END + ELSE IF EXISTS(SELECT * FROM [dbo].[LyncUsers] WHERE [SipAddress] = @SipAddress) + BEGIN + SET @Exists = 1 + END + + + RETURN' +END +GO + + + + +ALTER PROCEDURE [dbo].[LyncUserExists] +( + @AccountID int, + @SipAddress nvarchar(300), + @Exists bit OUTPUT +) +AS + + SET @Exists = 0 + IF EXISTS(SELECT * FROM [dbo].[ExchangeAccountEmailAddresses] WHERE [EmailAddress] = @SipAddress AND [AccountID] <> @AccountID) + BEGIN + SET @Exists = 1 + END + ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [PrimaryEmailAddress] = @SipAddress AND [AccountID] <> @AccountID) + BEGIN + SET @Exists = 1 + END + ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [UserPrincipalName] = @SipAddress AND [AccountID] <> @AccountID) + BEGIN + SET @Exists = 1 + END + ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [AccountName] = @SipAddress AND [AccountID] <> @AccountID) + BEGIN + SET @Exists = 1 + END + ELSE IF EXISTS(SELECT * FROM [dbo].[LyncUsers] WHERE [SipAddress] = @SipAddress) + BEGIN + SET @Exists = 1 + END + + + RETURN +GO + + + + + +ALTER PROCEDURE [dbo].[AddLyncUser] + @AccountID int, + @LyncUserPlanID int, + @SipAddress nvarchar(300) +AS +INSERT INTO + dbo.LyncUsers + (AccountID, + LyncUserPlanID, + CreatedDate, + ModifiedDate, + SipAddress) +VALUES +( + @AccountID, + @LyncUserPlanID, + getdate(), + getdate(), + @SipAddress +) +GO + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'UpdateLyncUser') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[UpdateLyncUser] +( + @AccountID int, + @SipAddress nvarchar(300) +) +AS + +UPDATE LyncUsers SET + SipAddress = @SipAddress +WHERE + AccountID = @AccountID AND AccountType IN (1,7) + +RETURN' +END +GO + + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs index b21b13d1..cce2aeac 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs @@ -52,6 +52,7 @@ namespace WebsitePanel.EnterpriseServer { using WebsitePanel.Providers.ResultObjects; + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] @@ -685,13 +686,13 @@ namespace WebsitePanel.EnterpriseServer { /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetLyncUserGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool SetLyncUserGeneralSettings(int itemId, int accountId, string sipAddress, string lineUri) { + public LyncUserResult SetLyncUserGeneralSettings(int itemId, int accountId, string sipAddress, string lineUri) { object[] results = this.Invoke("SetLyncUserGeneralSettings", new object[] { itemId, accountId, sipAddress, lineUri}); - return ((bool)(results[0])); + return ((LyncUserResult)(results[0])); } /// @@ -704,9 +705,9 @@ namespace WebsitePanel.EnterpriseServer { } /// - public bool EndSetLyncUserGeneralSettings(System.IAsyncResult asyncResult) { + public LyncUserResult EndSetLyncUserGeneralSettings(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); - return ((bool)(results[0])); + return ((LyncUserResult)(results[0])); } /// @@ -1248,10 +1249,10 @@ namespace WebsitePanel.EnterpriseServer { } /// - public bool Result { + public LyncUserResult Result { get { this.RaiseExceptionIfNecessary(); - return ((bool)(this.results[0])); + return ((LyncUserResult)(this.results[0])); } } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs index 892546ea..f7ab7cf4 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs @@ -3257,7 +3257,7 @@ namespace WebsitePanel.EnterpriseServer #region Lync - public static void AddLyncUser(int accountId, int lyncUserPlanId) + public static void AddLyncUser(int accountId, int lyncUserPlanId, string sipAddress) { SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure, @@ -3265,10 +3265,24 @@ namespace WebsitePanel.EnterpriseServer new[] { new SqlParameter("@AccountID", accountId), - new SqlParameter("@LyncUserPlanID", lyncUserPlanId) + new SqlParameter("@LyncUserPlanID", lyncUserPlanId), + new SqlParameter("@SipAddress", sipAddress) }); } + public static void UpdateLyncUser(int accountId, string sipAddress) + { + SqlHelper.ExecuteNonQuery(ConnectionString, + CommandType.StoredProcedure, + "UpdateLyncUser", + new[] + { + new SqlParameter("@AccountID", accountId), + new SqlParameter("@SipAddress", sipAddress) + }); + } + + public static bool CheckLyncUserExists(int accountId) { int res = (int)SqlHelper.ExecuteScalar(ConnectionString, CommandType.StoredProcedure, "CheckLyncUserExists", @@ -3276,6 +3290,25 @@ namespace WebsitePanel.EnterpriseServer return res > 0; } + public static bool LyncUserExists(int accountId, string sipAddress) + { + SqlParameter outParam = new SqlParameter("@Exists", SqlDbType.Bit); + outParam.Direction = ParameterDirection.Output; + + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "LyncUserExists", + new SqlParameter("@AccountID", accountId), + new SqlParameter("@SipAddress", sipAddress), + outParam + ); + + return Convert.ToBoolean(outParam.Value); + } + + + public static IDataReader GetLyncUsers(int itemId, string sortColumn, string sortDirection, int startRow, int count) { SqlParameter[] sqlParams = new SqlParameter[] diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs index 22be24bb..486e2519 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs @@ -2119,6 +2119,11 @@ namespace WebsitePanel.EnterpriseServer ocs.SetUserPrimaryUri(instanceId, emailAddress); } + if (DataProvider.CheckLyncUserExists(account.AccountId)) + { + LyncController.SetLyncUserGeneralSettings(itemId, accountId, emailAddress, null); + } + // save account UpdateAccount(account); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs index f7184468..a72d5b59 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs @@ -250,7 +250,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution try { - DataProvider.AddLyncUser(accountId, lyncUserPlanId); + DataProvider.AddLyncUser(accountId, lyncUserPlanId, user.UserPrincipalName); } catch (Exception ex) { @@ -341,12 +341,11 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } - public static bool SetLyncUserGeneralSettings(int itemId, int accountId, string sipAddress, string lineUri) + public static LyncUserResult SetLyncUserGeneralSettings(int itemId, int accountId, string sipAddress, string lineUri) { - TaskManager.StartTask("LYNC", "SET_LYNC_USER_GENERAL_SETTINGS"); + LyncUserResult res = TaskManager.StartResultTask("LYNC", "SET_LYNC_USER_GENERAL_SETTINGS"); LyncUser user = null; - bool ret = true; try { @@ -376,19 +375,38 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution user.LyncUserPlanName = plan.LyncUserPlanName; } - user.PrimaryUri = sipAddress; - user.LineUri = lineUri; + + if (!string.IsNullOrEmpty(sipAddress)) + { + if (sipAddress != usr.UserPrincipalName) + { + if (DataProvider.LyncUserExists(accountId, sipAddress)) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.ADDRESS_ALREADY_USED); + return res; + } + } + + user.SipAddress = sipAddress; + + } + + if (!string.IsNullOrEmpty(lineUri)) user.LineUri = lineUri; lync.SetLyncUserGeneralSettings(org.OrganizationId, usr.UserPrincipalName, user); + + DataProvider.UpdateLyncUser(accountId, sipAddress); } } catch (Exception ex) { - ret = false; - throw TaskManager.WriteError(ex); + TaskManager.CompleteResultTask(res, LyncErrorCodes.FAILED_SET_SETTINGS, ex); + return res; } - TaskManager.CompleteTask(); - return ret; + + res.IsSuccess = true; + TaskManager.CompleteResultTask(); + return res; } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs index 8f3d5235..adad212f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs @@ -511,7 +511,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution try { - stats.SipAddress = lyncUser.PrimaryEmailAddress; + stats.SipAddress = lyncUser.SipAddress; if (string.IsNullOrEmpty(lyncUser.LineUri)) stats.PhoneNumber = string.Empty; else stats.PhoneNumber = lyncUser.LineUri; LyncUserPlan plan = LyncController.GetLyncUserPlan(org.Id, lyncUser.LyncUserPlanId); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs index 311b66f9..8006be54 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs @@ -120,7 +120,7 @@ namespace WebsitePanel.EnterpriseServer } [WebMethod] - public bool SetLyncUserGeneralSettings(int itemId, int accountId, string sipAddress, string lineUri) + public LyncUserResult SetLyncUserGeneralSettings(int itemId, int accountId, string sipAddress, string lineUri) { return LyncController.SetLyncUserGeneralSettings(itemId, accountId, sipAddress, lineUri); } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs index 36fbfdde..c3299d67 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs @@ -49,6 +49,7 @@ namespace WebsitePanel.Providers.HostedSolution int mailboxPlanId; string mailboxPlan; string publicFolderPermission; + string userPrincipalName; public int AccountId { @@ -142,5 +143,11 @@ namespace WebsitePanel.Providers.HostedSolution } + public string UserPrincipalName + { + get { return this.userPrincipalName; } + set { this.userPrincipalName = value; } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncErrorCodes.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncErrorCodes.cs index 15cfbae8..4f792ea3 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncErrorCodes.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncErrorCodes.cs @@ -70,5 +70,8 @@ public const string CANNOT_REMOVE_LYNC_FEDERATIONDOMAIN = "CANNOT_REMOVE_LYNC_FEDERATIONDOMAIN"; + public const string FAILED_SET_SETTINGS = "FAILED_SET_SETTINGS"; + + public const string ADDRESS_ALREADY_USED = "ADDRESS_ALREADY_USED"; } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs index 1a4dd851..e95a9436 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs @@ -34,8 +34,8 @@ namespace WebsitePanel.Providers.HostedSolution { public class LyncUser { - public string PrimaryUri { get; set; } - public string PrimaryEmailAddress { get; set; } + public string SipAddress { get; set; } + public string UserPrincipalName { get; set; } public string DisplayName { get; set; } public string LineUri { get; set; } public int AccountID { get; set; } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs index a338e30c..f972983b 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs @@ -2592,7 +2592,7 @@ namespace WebsitePanel.Providers.HostedSolution cmd.Parameters.Add("Identity", accountName); cmd.Parameters.Add("PrimarySmtpAddress", primaryEmail); //cmd.Parameters.Add("UserPrincipalName", primaryEmail); - cmd.Parameters.Add("WindowsEmailAddress", primaryEmail); + //cmd.Parameters.Add("WindowsEmailAddress", primaryEmail); ExecuteShellCommand(runSpace, cmd); } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs index f058c759..be5e9397 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs @@ -514,8 +514,10 @@ namespace WebsitePanel.Providers.HostedSolution PSObject user = result[0]; lyncUser.DisplayName = (string)GetPSObjectProperty(user, "DisplayName"); - lyncUser.PrimaryUri = (string)GetPSObjectProperty(user, "SipAddress"); + lyncUser.SipAddress = (string)GetPSObjectProperty(user, "SipAddress"); lyncUser.LineUri = (string)GetPSObjectProperty(user, "LineURI"); + + lyncUser.SipAddress = lyncUser.SipAddress.ToLower().Replace("sip:", ""); } catch (Exception ex) { @@ -538,22 +540,96 @@ namespace WebsitePanel.Providers.HostedSolution bool ret = true; Runspace runSpace = null; + Guid tenantId = Guid.Empty; + LyncTransaction transaction = StartTransaction(); + try { runSpace = OpenRunspace(); + Command cmd = new Command("Get-CsTenant"); + cmd.Parameters.Add("Identity", GetOrganizationPath(organizationId)); + Collection result = ExecuteShellCommand(runSpace, cmd, false); + if ((result != null) && (result.Count > 0)) + { + tenantId = (Guid)GetPSObjectProperty(result[0], "TenantId"); - Command cmd = new Command("Set-CsUser"); + string[] tmp = userUpn.Split('@'); + if (tmp.Length < 2) return false; + + // Get SipDomains and verify existence + bool bSipDomainExists = false; + cmd = new Command("Get-CsSipDomain"); + Collection sipDomains = ExecuteShellCommand(runSpace, cmd, false); + + foreach (PSObject domain in sipDomains) + { + string d = (string)GetPSObjectProperty(domain, "Name"); + if (d.ToLower() == tmp[1].ToLower()) + { + bSipDomainExists = true; + break; + } + } + + string path = string.Empty; + + if (!bSipDomainExists) + { + // Create Sip Domain + cmd = new Command("New-CsSipDomain"); + cmd.Parameters.Add("Identity", tmp[1].ToLower()); + ExecuteShellCommand(runSpace, cmd, false); + + transaction.RegisterNewSipDomain(tmp[1].ToLower()); + + + path = AddADPrefix(GetOrganizationPath(organizationId)); + DirectoryEntry ou = ActiveDirectoryUtils.GetADObject(path); + string[] sipDs = (string[])ActiveDirectoryUtils.GetADObjectPropertyMultiValue(ou, "msRTCSIP-Domains"); + List listSipDs = new List(); + listSipDs.AddRange(sipDs); + listSipDs.Add(tmp[1]); + + ActiveDirectoryUtils.SetADObjectPropertyValue(ou, "msRTCSIP-Domains", listSipDs.ToArray()); + ou.CommitChanges(); + + //Create simpleurls + CreateSimpleUrl(runSpace, tmp[1].ToLower(), tenantId); + transaction.RegisterNewSimpleUrl(tmp[1].ToLower(), tenantId.ToString()); + + path = AddADPrefix(GetResultObjectDN(result)); + DirectoryEntry user = ActiveDirectoryUtils.GetADObject(path); + + if (tmp.Length > 0) + { + string Url = SimpleUrlRoot + tmp[1]; + ActiveDirectoryUtils.SetADObjectPropertyValue(user, "msRTCSIP-BaseSimpleUrl", Url.ToLower()); + } + user.CommitChanges(); + } + } + + cmd = new Command("Set-CsUser"); cmd.Parameters.Add("Identity", userUpn); - if (!string.IsNullOrEmpty(lyncUser.PrimaryUri)) cmd.Parameters.Add("SipAddress", lyncUser.PrimaryUri); - if (!string.IsNullOrEmpty(lyncUser.PrimaryUri)) cmd.Parameters.Add("LineUri", lyncUser.LineUri); + if (!string.IsNullOrEmpty(lyncUser.SipAddress)) cmd.Parameters.Add("SipAddress", "SIP:"+lyncUser.SipAddress); + if (!string.IsNullOrEmpty(lyncUser.SipAddress)) cmd.Parameters.Add("LineUri", lyncUser.LineUri); ExecuteShellCommand(runSpace, cmd, false); + + //initiate addressbook generation + cmd = new Command("Update-CsAddressBook"); + ExecuteShellCommand(runSpace, cmd, false); + + //initiate user database replication + cmd = new Command("Update-CsUserDatabase"); + ExecuteShellCommand(runSpace, cmd, false); + } catch (Exception ex) { ret = false; HostedSolutionLog.LogError("SetLyncUserGeneralSettingsInternal", ex); - throw; + RollbackTransaction(transaction); } finally { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxes.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxes.ascx.resx index 1aaeac3a..a254bede 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxes.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxes.ascx.resx @@ -174,4 +174,10 @@ Mailboxes + + Login + + + Login + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUsers.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUsers.ascx.resx index 581e06b6..3923f30b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUsers.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUsers.ascx.resx @@ -180,4 +180,10 @@ Total Users Created for this Tenant: + + Login + + + Login + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx index 851a9b78..35443356 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx @@ -46,6 +46,7 @@ Email AccountName Account Number + Login @@ -67,6 +68,15 @@ + + + + + <%# Eval("UserPrincipalName") %> + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs index 6a970dc9..f225eb71 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs @@ -47,7 +47,7 @@ namespace WebsitePanel.Portal.ExchangeServer { if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1) { - gvMailboxes.Columns[2].Visible = false; + gvMailboxes.Columns[3].Visible = false; } } } @@ -139,7 +139,15 @@ namespace WebsitePanel.Portal.ExchangeServer // bind stats BindStats(); - } + } + + public string GetOrganizationUserEditUrl(string accountId) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_user", + "AccountID=" + accountId, + "ItemID=" + PanelRequest.ItemID, + "Context=User"); + } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx index c6b5f5bf..8db4b2f5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx @@ -47,6 +47,7 @@ Email AccountName Account Number + Login @@ -74,14 +75,15 @@ - - + + + - - - - + /> + /> + /> + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs index 60d76797..07b88d06 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs @@ -48,7 +48,7 @@ namespace WebsitePanel.Portal.HostedSolution { if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1) { - gvUsers.Columns[3].Visible = false; + gvUsers.Columns[4].Visible = false; } } @@ -115,6 +115,52 @@ namespace WebsitePanel.Portal.HostedSolution messageBox.ShowErrorMessage("ORGANIZATIONS_DELETE_USERS", ex); } } + + if (e.CommandName == "OpenMailProperties") + { + int accountId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "mailbox_settings", + "AccountID=" + accountId, + "ItemID=" + PanelRequest.ItemID)); + } + + if (e.CommandName == "OpenBlackBerryProperties") + { + int accountId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_blackberry_user", + "AccountID=" + accountId, + "ItemID=" + PanelRequest.ItemID)); + } + + if (e.CommandName == "OpenCRMProperties") + { + int accountId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "mailbox_settings", + "AccountID=" + accountId, + "ItemID=" + PanelRequest.ItemID)); + } + + if (e.CommandName == "OpenUCProperties") + { + string[] Tmp = e.CommandArgument.ToString().Split('|'); + + int accountId = Utils.ParseInt(Tmp[0], 0); + if (Tmp[1] == "True") + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_ocs_user", + "AccountID=" + accountId, + "ItemID=" + PanelRequest.ItemID)); + else + if (Tmp[2] == "True") + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_lync_user", + "AccountID=" + accountId, + "ItemID=" + PanelRequest.ItemID)); + + + + } } @@ -208,7 +254,52 @@ namespace WebsitePanel.Portal.HostedSolution // bind stats BindStats(); - } + } + + + public bool EnableMailImageButton(int accountTypeId) + { + bool imgName = true; + + ExchangeAccountType accountType = (ExchangeAccountType)accountTypeId; + + if (accountType == ExchangeAccountType.User) + imgName = false; + + return imgName; + } + + public bool EnableOCSImageButton(bool IsOCSUser, bool IsLyncUser) + { + bool imgName = false; + + if (IsLyncUser) + imgName = true; + else + if ((IsOCSUser)) + imgName = true; + + return imgName; + } + + public bool EnableBlackBerryImageButton(bool IsBlackBerryUser) + { + bool imgName = false; + + if (IsBlackBerryUser) + imgName = true; + + return imgName; + } + + + public string GetOCSArgument(int accountID, bool IsOCS, bool IsLync) + { + return accountID.ToString() + "|" + IsOCS.ToString() + "|" + IsLync.ToString(); + } + + + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncEditUser.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncEditUser.ascx.resx index bad6c174..efcae705 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncEditUser.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncEditUser.ascx.resx @@ -135,4 +135,7 @@ Plan Name : + + SIP Address: + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncUsers.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncUsers.ascx.resx index 9114e730..748a13ee 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncUsers.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncUsers.ascx.resx @@ -126,8 +126,8 @@ Display name - - Sign-in name + + Login <p>Microsoft Lync Server delivers unified communications to the users, including software-powered VoIP, Web and audio/video conferencing, and enterprise instant messaging.</p> @@ -138,7 +138,7 @@ Display name - Sign-in name + SIP Address Lync Users @@ -152,4 +152,7 @@ No users have been Lync enabled. To enable a user for Lync click "Create Lync User" button. + + Login + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx index bcb77a8f..64305427 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx @@ -7,6 +7,7 @@ <%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %> <%@ Register src="../ExchangeServer/UserControls/MailboxSelector.ascx" tagname="MailboxSelector" tagprefix="uc1" %> <%@ Register Src="UserControls/LyncUserPlanSelector.ascx" TagName="LyncUserPlanSelector" TagPrefix="wsp" %> +<%@ Register Src="UserControls/LyncUserSettings.ascx" TagName="LyncUserSettings" TagPrefix="wsp" %>
@@ -38,6 +39,15 @@ + + + + + + + + +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs index aa3b96fa..b3b2782b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs @@ -52,6 +52,8 @@ namespace WebsitePanel.Portal.Lync litDisplayName.Text = lyncUser.DisplayName; planSelector.planId = lyncUser.LyncUserPlanId.ToString(); + lyncUserSettings.sipAddress = lyncUser.SipAddress; + } protected void btnSave_Click(object sender, EventArgs e) @@ -61,11 +63,18 @@ namespace WebsitePanel.Portal.Lync try { LyncUserResult res = ES.Services.Lync.SetUserLyncPlan(PanelRequest.ItemID, PanelRequest.AccountID, Convert.ToInt32(planSelector.planId)); + if (res.IsSuccess && res.ErrorCodes.Count == 0) + { + res = ES.Services.Lync.SetLyncUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID, lyncUserSettings.sipAddress, string.Empty); + } + if (res.IsSuccess && res.ErrorCodes.Count == 0) { messageBox.ShowSuccessMessage("UPDATE_LYNC_USER"); return; } + else + messageBox.ShowMessage(res, "UPDATE_LYNC_USER", "LYNC"); } catch(Exception ex) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs index 2b64cf15..fb36ea09 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs @@ -1,33 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // @@ -122,6 +93,24 @@ namespace WebsitePanel.Portal.Lync { /// protected global::WebsitePanel.Portal.Lync.UserControls.LyncUserPlanSelector planSelector; + /// + /// locSipAddress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSipAddress; + + /// + /// lyncUserSettings control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Lync.UserControls.LyncUserSettings lyncUserSettings; + /// /// btnSave control. /// @@ -130,14 +119,5 @@ namespace WebsitePanel.Portal.Lync { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button btnSave; - - /// - /// FormComments control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize FormComments; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx index d0320faa..f94d5abd 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx @@ -41,7 +41,7 @@ DisplayName - Email + Email - - + + + + + <%# Eval("UserPrincipalName") %> + + + + + protected global::WebsitePanel.Portal.QuotaViewer usersQuota; - - /// - /// FormComments control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize FormComments; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx new file mode 100644 index 00000000..5da9df82 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx @@ -0,0 +1,2 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LyncUserSettings.ascx.cs" Inherits="WebsitePanel.Portal.Lync.UserControls.LyncUserSettings" %> + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.cs new file mode 100644 index 00000000..c7b45afa --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.cs @@ -0,0 +1,102 @@ +// Copyright (c) 2011, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Web.UI.WebControls; +using EntServer = WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.Lync.UserControls +{ + public partial class LyncUserSettings : WebsitePanelControlBase + { + + private string sipAddressToSelect; + + public string sipAddress + { + + get { return ddlSipAddresses.SelectedItem.Value; } + set + { + sipAddressToSelect = value; + foreach (ListItem li in ddlSipAddresses.Items) + { + if (li.Value == value) + { + ddlSipAddresses.ClearSelection(); + li.Selected = true; + break; + } + } + } + } + + public int plansCount + { + get + { + return this.ddlSipAddresses.Items.Count; + } + } + + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindAddresses(); + } + } + + private void BindAddresses() + { + + EntServer.ExchangeEmailAddress[] emails = ES.Services.ExchangeServer.GetMailboxEmailAddresses(PanelRequest.ItemID, PanelRequest.AccountID); + + foreach (EntServer.ExchangeEmailAddress email in emails) + { + ListItem li = new ListItem(); + li.Text = email.EmailAddress; + li.Value = email.EmailAddress; + li.Selected = email.IsPrimary; + ddlSipAddresses.Items.Add(li); + } + + foreach (ListItem li in ddlSipAddresses.Items) + { + if (li.Value == sipAddressToSelect) + { + ddlSipAddresses.ClearSelection(); + li.Selected = true; + break; + } + } + + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.designer.cs new file mode 100644 index 00000000..2cd7f4d3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.designer.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// 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.Lync.UserControls { + + + public partial class LyncUserSettings { + + /// + /// ddlSipAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlSipAddresses; + } +} 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 c513660b..bea7dc26 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -297,6 +297,13 @@ LyncUsers.ascx + + LyncUserSettings.ascx + ASPXCodeBehind + + + LyncUserSettings.ascx + LyncUserPlanSelector.ascx ASPXCodeBehind @@ -3807,6 +3814,7 @@ + From 02cd8ae141a9be1819a108141e9423a1c9fe3d3b Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 22 Nov 2012 11:11:59 -0500 Subject: [PATCH 106/107] Merge --- .../Lync/LyncEditUser.ascx.designer.cs | 30 ++++++++++++++++++- .../Lync/LyncUsers.ascx.designer.cs | 30 ++++++++++++++++++- .../LyncUserSettings.ascx.designer.cs | 28 +++++++++++++++++ 3 files changed, 86 insertions(+), 2 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs index fb36ea09..52aaa081 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs @@ -1,4 +1,32 @@ -//------------------------------------------------------------------------------ +// Copyright (c) 2011, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx.designer.cs index 25937689..9f386e85 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx.designer.cs @@ -1,4 +1,32 @@ -//------------------------------------------------------------------------------ +// Copyright (c) 2011, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.designer.cs index 2cd7f4d3..202d581f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.designer.cs @@ -1,3 +1,31 @@ +// Copyright (c) 2011, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + //------------------------------------------------------------------------------ // // This code was generated by a tool. From 1ed886a04502d443b9858d0cbd9168e0b18e823b Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 22 Nov 2012 11:21:23 -0500 Subject: [PATCH 107/107] Added tag build-2.0.0.184 for changeset a4ec851f9c29