Skip to content

Commit

Permalink
Rollback previous merge
Browse files Browse the repository at this point in the history
  • Loading branch information
cnurse committed Dec 17, 2013
1 parent 7dc49a6 commit 3b7e5e9
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 156 deletions.
38 changes: 17 additions & 21 deletions DNN Platform/Library/Entities/Urls/TabIndexController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,8 @@ private static void AddCustomRedirectsToDictionary(SharedDictionary<string, stri
checkForDupUrls,
isDeleted);
//838 : disabled tabs with custom aliases - still load the settings page without redirect
//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 + "/ctl/Tab";
string settingsRewritePath = CreateRewritePath(tab.TabID, redirect.CultureCode, "ctl=Tab");
Expand Down Expand Up @@ -331,11 +329,11 @@ private static void AddPermanentRedirectToDictionary(SharedDictionary<string, st
isDeleted);
}

private static void AddSiteRootRedirects(PathSizes pathSizes,
SharedDictionary<string, string> tabIndex,
private static void AddSiteRootRedirects(PathSizes pathSizes,
SharedDictionary<string, string> tabIndex,
IEnumerable<PortalAliasInfo> chosenAliases,
bool hasSiteRootRedirect,
Dictionary<string, DupKeyCheck> dupCheck,
bool hasSiteRootRedirect,
Dictionary<string, DupKeyCheck> dupCheck,
ICollection<string> usingHttpAliases)
{
foreach (PortalAliasInfo alias in chosenAliases) //and that is once per portal alias per portal
Expand Down Expand Up @@ -453,8 +451,8 @@ private static int AddTabToTabDict(SharedDictionary<string, string> 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)
Expand Down Expand Up @@ -581,10 +579,8 @@ private static int AddTabToTabDict(SharedDictionary<string, string> 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");
Expand Down Expand Up @@ -829,7 +825,7 @@ private static void AddToTabDict(SharedDictionary<string, string> 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
{
Expand Down Expand Up @@ -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<string> httpAliases,
List<string> customHttpAliasesUsed,
List<string> customHttpAliasesUsed,
out bool customAliasUsed)
{
string customHttpAlias = "";
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
26 changes: 9 additions & 17 deletions DNN Platform/Library/Security/Roles/RoleInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
using DotNetNuke.Security.Roles.Internal;
using DotNetNuke.Services.FileSystem;
using DotNetNuke.Services.Tokens;
using System.Web;

#endregion

Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -405,8 +404,8 @@ public virtual void Fill(IDataReader dr)
IsSystemRole = Null.SetNullBoolean(dr["IsSystemRole"]);
}
}


}
catch (IndexOutOfRangeException)
{
Expand Down Expand Up @@ -488,15 +487,15 @@ 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":
return PropertyAccess.FormatString(GetString("stat_photo", string.Empty), 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":
Expand All @@ -512,6 +511,9 @@ public string GetProperty(string propertyName, string format, CultureInfo format
propertyNotFound = true;
return string.Empty;
}



}

#endregion
Expand Down Expand Up @@ -641,7 +643,7 @@ public void ReadXml(XmlReader reader)
case "both":
SecurityMode = SecurityMode.Both;
break;
}
}
break;
case "status":
switch (reader.ReadElementContentAsString())
Expand Down Expand Up @@ -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;
}
}
}
49 changes: 2 additions & 47 deletions DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<AlternateUrl> alternates = new List<AlternateUrl>();
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;
}

Expand All @@ -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)
Expand All @@ -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))
{
Expand Down
13 changes: 0 additions & 13 deletions DNN Platform/Library/Services/Sitemap/SitemapBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ private void WriteSitemap(bool cached, TextWriter output, int index, List<Sitema
// build header
writer.WriteStartElement("urlset", "http://www.sitemaps.org/schemas/sitemap/" + SITEMAP_VERSION);
writer.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance");
writer.WriteAttributeString("xmlns", "xhtml", null, "http://www.w3.org/1999/xhtml");
var schemaLocation = "http://www.sitemaps.org/schemas/sitemap/" + SITEMAP_VERSION;
writer.WriteAttributeString("xsi", "schemaLocation", null, string.Format("{0} {0}/sitemap.xsd", schemaLocation));

Expand Down Expand Up @@ -301,18 +300,6 @@ private void AddURL(SitemapUrl sitemapUrl)
writer.WriteElementString("lastmod", sitemapUrl.LastModified.ToString("yyyy-MM-dd"));
writer.WriteElementString("changefreq", sitemapUrl.ChangeFrequency.ToString().ToLower());
writer.WriteElementString("priority", sitemapUrl.Priority.ToString("F01", CultureInfo.InvariantCulture));

if (sitemapUrl.AlternateUrls != null)
{
foreach (AlternateUrl alternate in sitemapUrl.AlternateUrls)
{
writer.WriteStartElement("link", "http://www.w3.org/1999/xhtml");
writer.WriteAttributeString("rel", "alternate");
writer.WriteAttributeString("hreflang", alternate.Language);
writer.WriteAttributeString("href", alternate.Url);
writer.WriteEndElement();
}
}
writer.WriteEndElement();
}

Expand Down
13 changes: 3 additions & 10 deletions DNN Platform/Library/Services/Sitemap/SitemapUrl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#region Usings

using System;
using System.Collections.Generic;

#endregion

Expand All @@ -31,19 +30,13 @@ public class SitemapUrl
{
public string Url { get; set; }


public DateTime LastModified { get; set; }

public SitemapChangeFrequency ChangeFrequency { get; set; }

public float Priority { get; set; }

public List<AlternateUrl> 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; }
}
}
33 changes: 0 additions & 33 deletions Website/DesktopModules/Admin/SQL/App_LocalResources/SQL.ascx.resx
Original file line number Diff line number Diff line change
Expand Up @@ -249,37 +249,4 @@
<data name="CopyTitle.Text" xml:space="preserve">
<value>SQL Query Result</value>
</data>
<data name="sFirst.Text" xml:space="preserve">
<value>First</value>
</data>
<data name="sInfo.Text" xml:space="preserve">
<value>Showing _START_ to _END_ of _TOTAL_ entries</value>
</data>
<data name="sInfoFiltered.Text" xml:space="preserve">
<value>(filtered from _MAX_ total entries)</value>
</data>
<data name="sLast.Text" xml:space="preserve">
<value>Last</value>
</data>
<data name="sLengthMenu.Text" xml:space="preserve">
<value>Show _MENU_ entries</value>
</data>
<data name="sLoadingRecords.Text" xml:space="preserve">
<value>Loading...</value>
</data>
<data name="sNext.Text" xml:space="preserve">
<value>Next</value>
</data>
<data name="sPrevious.Text" xml:space="preserve">
<value>Previous</value>
</data>
<data name="sProcessing.Text" xml:space="preserve">
<value>Processing...</value>
</data>
<data name="sSearch.Text" xml:space="preserve">
<value>Search:</value>
</data>
<data name="sInfoEmpty.Text" xml:space="preserve">
<value>Showing 0 to 0 of 0 entries</value>
</data>
</root>
15 changes: 0 additions & 15 deletions Website/DesktopModules/Admin/SQL/sql.ascx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3b7e5e9

Please sign in to comment.