diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 603f79f0..8b609c0f 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -7070,3 +7070,28 @@ BEGIN UPDATE [dbo].[Providers] SET [EditorControl] = 'Windows2012' WHERE [ProviderName] = 'Windows2012' END GO + +-- fix check domain used by HostedOrganization + +ALTER PROCEDURE [dbo].[CheckDomainUsedByHostedOrganization] + @DomainName nvarchar(100), + @Result int OUTPUT +AS + SET @Result = 0 + IF EXISTS(SELECT 1 FROM ExchangeAccounts WHERE UserPrincipalName LIKE '%@'+ @DomainName AND AccountType!=2) + BEGIN + SET @Result = 1 + END + ELSE + IF EXISTS(SELECT 1 FROM ExchangeAccountEmailAddresses WHERE EmailAddress LIKE '%@'+ @DomainName) + BEGIN + SET @Result = 1 + END + ELSE + IF EXISTS(SELECT 1 FROM LyncUsers WHERE SipAddress LIKE '%@'+ @DomainName) + BEGIN + SET @Result = 1 + END + + RETURN @Result +GO diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/DomainExpirationTask.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/DomainExpirationTask.cs index 521d17be..4e8b079d 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/DomainExpirationTask.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/DomainExpirationTask.cs @@ -183,9 +183,10 @@ namespace WebsitePanel.EnterpriseServer items["user"] = user; items["Domains"] = domains.Select(x => new { DomainName = x.DomainName, - ExpirationDate = x.ExpirationDate, + ExpirationDate = x.ExpirationDate < DateTime.Now ? "Expired" : x.ExpirationDate.ToString(), + ExpirationDateOrdering = x.ExpirationDate, Customer = string.Format("{0} {1}", domainUsers[x.PackageId].FirstName, domainUsers[x.PackageId].LastName) }) - .OrderBy(x => x.ExpirationDate).ThenBy(x => x.Customer).ThenBy(x => x.DomainName); + .OrderBy(x => x.ExpirationDateOrdering).ThenBy(x => x.Customer).ThenBy(x => x.DomainName); items["IncludeNonExistenDomains"] = includeNonExistenDomains; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Domains.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Domains.ascx index 8dc31afd..c1ac1fcd 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Domains.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Domains.ascx @@ -42,7 +42,7 @@ <%# GetDomainExpirationDate(Eval("ExpirationDate"), Eval("LastUpdateDate"))%> -
+
">
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Domains.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Domains.ascx.cs index 06fb93e2..db114e6d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Domains.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Domains.ascx.cs @@ -45,8 +45,12 @@ namespace WebsitePanel.Portal { public partial class Domains : WebsitePanelModuleBase { + public Dictionary dnsRecords; + protected void Page_Load(object sender, EventArgs e) { + dnsRecords = new Dictionary(); + gvDomains.PageSize = UsersHelper.GetDisplayItemsPerPage(); // visibility @@ -154,11 +158,18 @@ namespace WebsitePanel.Portal public string GetDomainDnsRecords(int domainId) { + if(dnsRecords.ContainsKey(domainId)) + { + return dnsRecords[domainId]; + } + var records = ES.Services.Servers.GetDomainDnsRecords(domainId); if (!records.Any()) { - return "No Dns Records"; + dnsRecords.Add(domainId, string.Empty); + + return string.Empty; } var header = GetLocalizedString("DomainLookup.TooltipHeader"); @@ -169,7 +180,9 @@ namespace WebsitePanel.Portal tooltipLines.Add(" "); tooltipLines.AddRange( records.Select(x=>string.Format("{0}: {1}", x.RecordType, x.Value))); - return string.Join("\r\n", tooltipLines); + dnsRecords.Add(domainId, string.Join("\r\n", tooltipLines)); + + return dnsRecords[domainId]; } protected void odsDomainsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainNames.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainNames.ascx index 59c42aec..71b7c337 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainNames.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainNames.ascx @@ -30,7 +30,7 @@ + NavigateUrl='<%# GetDomainRecordsEditUrl(Eval("DomainID").ToString()) %>' Enabled="true"> <%# Eval("DomainName") %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx index 8c6e86e9..f9e2ab8a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx @@ -30,7 +30,7 @@ + NavigateUrl='<%# GetDomainRecordsEditUrl(Eval("DomainID").ToString()) %>' Enabled="true"> <%# Eval("DomainName") %>