From 317653269f86ae3486541357a7900aa11bb4d5ec Mon Sep 17 00:00:00 2001 From: robvde Date: Sat, 20 Oct 2012 22:49:19 +0400 Subject: [PATCH] Fixed: Lync unable to delete federation domain Adjusted: certain input items forced to lower case --- .../Lync2010.cs | 18 ++++++++++++++++-- .../WebsitePanel/DomainsAddDomain.ascx.cs | 2 +- .../ExchangeMailboxEmailAddresses.ascx.cs | 2 +- .../OrganizationCreateUser.ascx.cs | 4 ++-- .../WebsitePanel/WebSitesAddPointer.ascx.cs | 2 +- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs index 26c14e00..09968caf 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs @@ -162,6 +162,7 @@ namespace WebsitePanel.Providers.HostedSolution #region organization private string CreateOrganizationInternal(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) { + sipDomain = sipDomain.ToLower(); HostedSolutionLog.LogStart("CreateOrganizationInternal"); HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); HostedSolutionLog.DebugInfo("sipDomain: {0}", sipDomain); @@ -839,6 +840,9 @@ namespace WebsitePanel.Providers.HostedSolution HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); HostedSolutionLog.DebugInfo("domainName: {0}", domainName); + domainName = domainName.ToLower(); + proxyFqdn = proxyFqdn.ToLower(); + Runspace runSpace = null; try { @@ -926,9 +930,19 @@ namespace WebsitePanel.Providers.HostedSolution if (GetPSObjectProperty(result[0], "AllowedDomains").GetType().ToString() == "Microsoft.Rtc.Management.WritableConfig.Settings.Edge.AllowList") { + HostedSolutionLog.DebugInfo("Remove DomainName: {0}", domainName); allowList = (AllowList)GetPSObjectProperty(result[0], "AllowedDomains"); - DomainPattern domain = new DomainPattern(domainName); - allowList.AllowedDomain.Remove(domain); + DomainPattern domain = null; + foreach (DomainPattern d in allowList.AllowedDomain) + { + if (d.Domain.ToLower() == domainName.ToLower()) + { + domain = d; + break; + } + } + if (domain != null) + allowList.AllowedDomain.Remove(domain); } cmd = new Command("Set-CsTenantFederationConfiguration"); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs index ff7be2f4..4a2dab6d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs @@ -225,7 +225,7 @@ namespace WebsitePanel.Portal { domainId = ES.Services.Servers.AddDomainWithProvisioning(PanelSecurity.PackageId, domainName.ToLower(), type, CreateWebSite.Checked, pointWebSiteId, pointMailDomainId, - EnableDns.Checked, CreateInstantAlias.Checked, AllowSubDomains.Checked, (PointWebSite.Checked && WebSitesList.Items.Count > 0) ? string.Empty : txtHostName.Text); + EnableDns.Checked, CreateInstantAlias.Checked, AllowSubDomains.Checked, (PointWebSite.Checked && WebSitesList.Items.Count > 0) ? string.Empty : txtHostName.Text.ToLower()); if (domainId < 0) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.cs index eb6eb688..816e6d19 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.cs @@ -91,7 +91,7 @@ namespace WebsitePanel.Portal.ExchangeServer try { int result = ES.Services.ExchangeServer.AddMailboxEmailAddress( - PanelRequest.ItemID, PanelRequest.AccountID, email.Email); + PanelRequest.ItemID, PanelRequest.AccountID, email.Email.ToLower()); if (result < 0) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs index 245da91f..cf72b9c8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs @@ -92,8 +92,8 @@ namespace WebsitePanel.Portal.HostedSolution try { int accountId = ES.Services.Organizations.CreateUser(PanelRequest.ItemID, txtDisplayName.Text.Trim(), - email.AccountName, - email.DomainName, + email.AccountName.ToLower(), + email.DomainName.ToLower(), password.Password, txtSubscriberNumber.Text.Trim(), false, diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesAddPointer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesAddPointer.ascx.cs index 1c139793..42038324 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesAddPointer.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesAddPointer.ascx.cs @@ -67,7 +67,7 @@ namespace WebsitePanel.Portal { try { - int result = ES.Services.WebServers.AddWebSitePointer(PanelRequest.ItemID, txtHostName.Text, domainsSelectDomainControl.DomainId); + int result = ES.Services.WebServers.AddWebSitePointer(PanelRequest.ItemID, txtHostName.Text.ToLower(), domainsSelectDomainControl.DomainId); if (result < 0) { ShowResultMessage(result);