From 3b7e5e938325fd3a0bd3ad92926c09aba086ef7b Mon Sep 17 00:00:00 2001 From: Charles Nurse Date: Tue, 17 Dec 2013 14:58:45 -0800 Subject: [PATCH] Rollback previous merge --- .../Entities/Urls/TabIndexController.cs | 38 +++++++------- .../Library/Security/Roles/RoleInfo.cs | 26 ++++------ .../Services/Sitemap/CoreSitemapProvider.cs | 49 +------------------ .../Services/Sitemap/SitemapBuilder.cs | 13 ----- .../Library/Services/Sitemap/SitemapUrl.cs | 13 ++--- .../SQL/App_LocalResources/SQL.ascx.resx | 33 ------------- Website/DesktopModules/Admin/SQL/sql.ascx | 15 ------ 7 files changed, 31 insertions(+), 156 deletions(-) diff --git a/DNN Platform/Library/Entities/Urls/TabIndexController.cs b/DNN Platform/Library/Entities/Urls/TabIndexController.cs index e83f99e4b55..e08ba316a2a 100644 --- a/DNN Platform/Library/Entities/Urls/TabIndexController.cs +++ b/DNN Platform/Library/Entities/Urls/TabIndexController.cs @@ -213,10 +213,8 @@ private static void AddCustomRedirectsToDictionary(SharedDictionary DateTime.MinValue) || - (tab.StartDate > DateTime.Now && tab.StartDate > DateTime.MinValue)) + //594 : disabled / external url pages cannot navigate to settings page + if (tab.DisableLink || !string.IsNullOrEmpty(tab.Url)) { string settingsUrl = tabPath + "/ctl/Tab"; string settingsRewritePath = CreateRewritePath(tab.TabID, redirect.CultureCode, "ctl=Tab"); @@ -331,11 +329,11 @@ private static void AddPermanentRedirectToDictionary(SharedDictionary tabIndex, + private static void AddSiteRootRedirects(PathSizes pathSizes, + SharedDictionary tabIndex, IEnumerable chosenAliases, - bool hasSiteRootRedirect, - Dictionary dupCheck, + bool hasSiteRootRedirect, + Dictionary dupCheck, ICollection usingHttpAliases) { foreach (PortalAliasInfo alias in chosenAliases) //and that is once per portal alias per portal @@ -453,8 +451,8 @@ private static int AddTabToTabDict(SharedDictionary tabIndex, //for deleted, expired or pages not enabled yet, direct to the home page if the setting is enabled //534 : tab is disabled, mark as deleted (don't want to cause duplicate tab warnings) bool isDeleted = (tab.IsDeleted || tab.DisableLink || - (tab.EndDate < DateTime.Now && tab.EndDate > DateTime.MinValue) || - (tab.StartDate > DateTime.Now && tab.StartDate > DateTime.MinValue)); + (tab.EndDate < DateTime.Now && tab.EndDate > DateTime.MinValue) || + (tab.StartDate > DateTime.Now && tab.StartDate > DateTime.MinValue)); if (isDeleted) // don't care what setting is, redirect code will decide whether to redirect or 404 - just mark as page deleted && // settings.DeletedTabHandlingValue == DeletedTabHandlingTypes.Do301RedirectToPortalHome) @@ -581,10 +579,8 @@ private static int AddTabToTabDict(SharedDictionary tabIndex, isDeleted); } - // disabled / not active by date / external url pages cannot navigate to settings page - if (tab.DisableLink || !string.IsNullOrEmpty(tab.Url) || - (tab.EndDate < DateTime.Now && tab.EndDate > DateTime.MinValue) || - (tab.StartDate > DateTime.Now && tab.StartDate > DateTime.MinValue)) + //594 : disabled / external url pages cannot navigate to settings page + if (tab.DisableLink || !string.IsNullOrEmpty(tab.Url)) { string settingsUrl = tabPath.Replace("//", "/") + "/ctl/Tab"; string settingsRewritePath = CreateRewritePath(tab.TabID, "", "ctl=tab"); @@ -829,7 +825,7 @@ private static void AddToTabDict(SharedDictionary tabIndex, { DupKeyCheck foundTAb = dupCheckDict[dupKey]; if ((foundTAb.IsDeleted == false && isDeleted == false) //found is not deleted, this tab is not deleted - && keyDupAction == UrlEnums.TabKeyPreference.TabOK + && keyDupAction == UrlEnums.TabKeyPreference.TabOK && foundTAb.TabIdOriginal != "-1") //-1 tabs are login, register, privacy etc { @@ -1300,11 +1296,11 @@ private static void GetAliasFromSettings(int portalId, } } - private static string ManageCustomAliases(string tabCulture, - PortalInfo thisPortal, - TabInfo tab, + private static string ManageCustomAliases(string tabCulture, + PortalInfo thisPortal, + TabInfo tab, List httpAliases, - List customHttpAliasesUsed, + List customHttpAliasesUsed, out bool customAliasUsed) { string customHttpAlias = ""; @@ -1533,7 +1529,7 @@ internal static PortalAliasInfo GetPortalAliasByPortal(int portalId, string port bool foundAlias = false; //Do a specified PortalAlias check first - PortalAliasInfo portalAliasInfo = portalAliasCollection.SingleOrDefault(a => a.HTTPAlias == portalAlias.ToLower()); + PortalAliasInfo portalAliasInfo = portalAliasCollection.SingleOrDefault(a => a.HTTPAlias ==portalAlias.ToLower()); if (portalAliasInfo != null) { if (portalAliasInfo.PortalID == portalId) @@ -1650,7 +1646,7 @@ public static void InvalidateDictionary(string reason, PageIndexData rebuildData //add log entry for cache clearance var elc = new EventLogController(); - var logValue = new LogInfo { LogTypeKey = "HOST_ALERT" }; + var logValue = new LogInfo {LogTypeKey = "HOST_ALERT"}; try { //817 : not clearing items correctly from dictionary diff --git a/DNN Platform/Library/Security/Roles/RoleInfo.cs b/DNN Platform/Library/Security/Roles/RoleInfo.cs index 402c8adeaa2..08b382a464f 100644 --- a/DNN Platform/Library/Security/Roles/RoleInfo.cs +++ b/DNN Platform/Library/Security/Roles/RoleInfo.cs @@ -40,7 +40,6 @@ using DotNetNuke.Security.Roles.Internal; using DotNetNuke.Services.FileSystem; using DotNetNuke.Services.Tokens; -using System.Web; #endregion @@ -360,7 +359,7 @@ public virtual void Fill(IDataReader dr) AutoAssignment = Null.SetNullBoolean(dr["AutoAssignment"]); RSVPCode = Null.SetNullString(dr["RSVPCode"]); IconFile = Null.SetNullString(dr["IconFile"]); - + //New properties may not be present if called before 6.2 Upgrade has been executed try { @@ -405,8 +404,8 @@ public virtual void Fill(IDataReader dr) IsSystemRole = Null.SetNullBoolean(dr["IsSystemRole"]); } } - - + + } catch (IndexOutOfRangeException) { @@ -488,7 +487,7 @@ public string GetProperty(string propertyName, string format, CultureInfo format case "datecreated": return PropertyAccess.FormatString(CreatedOnDate.ToString(), format); case "photourl": - return PropertyAccess.FormatString(FormatUrl(PhotoURL), format); + return PropertyAccess.FormatString(PhotoURL, format); case "stat_status": return PropertyAccess.FormatString(GetString("stat_status", string.Empty), format); case "stat_photo": @@ -496,7 +495,7 @@ public string GetProperty(string propertyName, string format, CultureInfo format case "stat_file": return PropertyAccess.FormatString(GetString("stat_file", string.Empty), format); case "url": - return PropertyAccess.FormatString(FormatUrl(GetString("URL", string.Empty)), format); + return PropertyAccess.FormatString(GetString("URL", string.Empty), format); case "issystemrole": return PropertyAccess.Boolean2LocalizedYesNo(IsSystemRole, formatProvider); case "grouptype": @@ -512,6 +511,9 @@ public string GetProperty(string propertyName, string format, CultureInfo format propertyNotFound = true; return string.Empty; } + + + } #endregion @@ -641,7 +643,7 @@ public void ReadXml(XmlReader reader) case "both": SecurityMode = SecurityMode.Both; break; - } + } break; case "status": switch (reader.ReadElementContentAsString()) @@ -753,15 +755,5 @@ private string GetString(string keyName, string defaultValue) return defaultValue; } - - private string FormatUrl(string url) - { - if (url.StartsWith("/") && HttpContext.Current != null) - { - //server absolute path - return Globals.AddHTTP(HttpContext.Current.Request.Url.Host) + url; - } - return url; - } } } \ No newline at end of file diff --git a/DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs b/DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs index 043fe3286ff..aebc26b05e6 100644 --- a/DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs +++ b/DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs @@ -126,51 +126,6 @@ private SitemapUrl GetPageUrl(TabInfo objTab, string language) } pageUrl.ChangeFrequency = SitemapChangeFrequency.Daily; - // support for alternate pages: https://support.google.com/webmasters/answer/2620865?hl=en - if (ps.ContentLocalizationEnabled && !objTab.IsNeutralCulture) - { - List alternates = new List(); - TabInfo currentTab = objTab; - - if (!objTab.IsDefaultLanguage) - currentTab = objTab.DefaultLanguageTab; - - foreach (TabInfo localized in currentTab.LocalizedTabs.Values) - { - if ((!localized.IsDeleted && !localized.DisableLink && localized.TabType == TabType.Normal) && - (Null.IsNull(localized.StartDate) || localized.StartDate < DateTime.Now) && - (Null.IsNull(localized.EndDate) || localized.EndDate > DateTime.Now) && - (IsTabPublic(localized.TabPermissions)) && - (includeHiddenPages || localized.IsVisible)) - { - string alternateUrl = Globals.NavigateURL(localized.TabID, localized.IsSuperTab, ps, "", localized.CultureCode); - - if (alternateUrl.ToLower().IndexOf(portalAlias.ToLower(), StringComparison.Ordinal) == -1) - { - // code to fix a bug in dnn5.1.2 for navigateurl - if ((HttpContext.Current != null)) - { - alternateUrl = Globals.AddHTTP(HttpContext.Current.Request.Url.Host + alternateUrl); - } - else - { - // try to use the portalalias - alternateUrl = Globals.AddHTTP(portalAlias.ToLower()) + alternateUrl; - } - } - alternates.Add(new AlternateUrl() { Url = alternateUrl, Language = localized.CultureCode }); - } - } - - if (alternates.Count > 0) - { - // add self to the list - alternates.Add(new AlternateUrl() { Url = pageUrl.Url, Language = objTab.CultureCode }); - - pageUrl.AlternateUrls = alternates; - } - } - return pageUrl; } @@ -195,7 +150,7 @@ protected float GetPriority(TabInfo objTab) } else { - priority = Convert.ToSingle(1 - (objTab.Level * 0.1)); + priority = Convert.ToSingle(1 - (objTab.Level*0.1)); } if (priority < minPagePriority) @@ -218,7 +173,7 @@ public virtual bool IsTabPublic(TabPermissionCollection objTabPermissions) if ((roles != null)) { // permissions strings are encoded with Deny permissions at the beginning and Grant permissions at the end for optimal performance - foreach (string role in roles.Split(new[] { ';' })) + foreach (string role in roles.Split(new[] {';'})) { if (!string.IsNullOrEmpty(role)) { diff --git a/DNN Platform/Library/Services/Sitemap/SitemapBuilder.cs b/DNN Platform/Library/Services/Sitemap/SitemapBuilder.cs index 5e5a0a96b18..3c7693539c6 100644 --- a/DNN Platform/Library/Services/Sitemap/SitemapBuilder.cs +++ b/DNN Platform/Library/Services/Sitemap/SitemapBuilder.cs @@ -220,7 +220,6 @@ private void WriteSitemap(bool cached, TextWriter output, int index, List AlternateUrls { get; set; } - } + public SitemapChangeFrequency ChangeFrequency { get; set; } - public class AlternateUrl - { - public string Language { get; set; } - public string Url { get; set; } + public float Priority { get; set; } } } \ No newline at end of file diff --git a/Website/DesktopModules/Admin/SQL/App_LocalResources/SQL.ascx.resx b/Website/DesktopModules/Admin/SQL/App_LocalResources/SQL.ascx.resx index 9e45d1f4dc2..7fad30e750f 100644 --- a/Website/DesktopModules/Admin/SQL/App_LocalResources/SQL.ascx.resx +++ b/Website/DesktopModules/Admin/SQL/App_LocalResources/SQL.ascx.resx @@ -249,37 +249,4 @@ SQL Query Result - - First - - - Showing _START_ to _END_ of _TOTAL_ entries - - - (filtered from _MAX_ total entries) - - - Last - - - Show _MENU_ entries - - - Loading... - - - Next - - - Previous - - - Processing... - - - Search: - - - Showing 0 to 0 of 0 entries - \ No newline at end of file diff --git a/Website/DesktopModules/Admin/SQL/sql.ascx b/Website/DesktopModules/Admin/SQL/sql.ascx index 89b35e1457c..c4645da5dbe 100644 --- a/Website/DesktopModules/Admin/SQL/sql.ascx +++ b/Website/DesktopModules/Admin/SQL/sql.ascx @@ -163,21 +163,6 @@ } }--%> ] - }, - oLanguage: { - "sInfo": "<%=Localization.GetSafeJSString(LocalizeString("sInfo"))%>", - "sInfoFiltered": "<%=Localization.GetSafeJSString(LocalizeString("sInfoFiltered"))%>", - "sInfoEmpty": "<%=Localization.GetSafeJSString(LocalizeString("sInfoEmpty"))%>", - "sLengthMenu": "<%=Localization.GetSafeJSString(LocalizeString("sLengthMenu"))%>", - "sLoadingRecords": "<%=Localization.GetSafeJSString(LocalizeString("sLoadingRecords"))%>", - "sProcessing": "<%=Localization.GetSafeJSString(LocalizeString("sProcessing"))%>", - "sSearch": "<%=Localization.GetSafeJSString(LocalizeString("sSearch"))%>", - "oPaginate": { - "sFirst": "<%=Localization.GetSafeJSString(LocalizeString("sFirst"))%>", - "sLast": "<%=Localization.GetSafeJSString(LocalizeString("sLast"))%>", - "sNext": "<%=Localization.GetSafeJSString(LocalizeString("sNext"))%>", - "sPrevious": "<%=Localization.GetSafeJSString(LocalizeString("sPrevious"))%>" - } } }); //new FixedHeader(oTable);