diff --git a/src/Subtext.Framework/Configuration/BlogConfigurationSettings.cs b/src/Subtext.Framework/Configuration/BlogConfigurationSettings.cs index 9a795d044..730b5108c 100644 --- a/src/Subtext.Framework/Configuration/BlogConfigurationSettings.cs +++ b/src/Subtext.Framework/Configuration/BlogConfigurationSettings.cs @@ -31,6 +31,7 @@ public class BlogConfigurationSettings { private Tracking _tracking; private NameValueCollection _allowedHtmlTags; + private NameValueCollection _nonBlogPages; public BlogConfigurationSettings() { @@ -97,6 +98,24 @@ public Tracking Tracking public int GalleryImageThumbnailWidth { get; set; } public int GalleryImageThumbnailHeight { get; set; } + public bool HostAdminLinkEnabled + { + get + { + if (String.IsNullOrEmpty(ConfigurationManager.AppSettings["ShowHostAdminLink"])) + { + return true; + } + + bool enabled; + if (bool.TryParse(ConfigurationManager.AppSettings["ShowHostAdminLink"], out enabled)) + { + return enabled; + } + return true; + } + } + /// /// Gets a value indicating whether invisible captcha enabled. This is /// configured within the "InvisibleCaptchaEnabled" app setting. It is not @@ -142,5 +161,24 @@ public NameValueCollection AllowedHtmlTags return _allowedHtmlTags; } } + + /// + /// Returns a containing a list + /// of page names that are not to be parsed as a request for a blog entry. + /// The key contains the file name and the value contains a short description about the page + /// + /// The static file names. + [XmlIgnore] + public NameValueCollection NonBlogPages + { + get + { + if (_nonBlogPages == null) + { + _nonBlogPages = ((NameValueCollection)(ConfigurationManager.GetSection("NonBlogPages"))); + } + return _nonBlogPages; + } + } } } \ No newline at end of file diff --git a/src/Subtext.Framework/Web/HttpModules/BlogRequest.cs b/src/Subtext.Framework/Web/HttpModules/BlogRequest.cs index e4812209a..53d975f97 100644 --- a/src/Subtext.Framework/Web/HttpModules/BlogRequest.cs +++ b/src/Subtext.Framework/Web/HttpModules/BlogRequest.cs @@ -183,7 +183,8 @@ private static bool IsStaticFileRequest(HttpRequestBase request) || filePath.EndsWith(".txt", StringComparison.OrdinalIgnoreCase) || filePath.EndsWith(".html", StringComparison.OrdinalIgnoreCase) || filePath.EndsWith(".htm", StringComparison.OrdinalIgnoreCase) - || filePath.Contains("/images/", StringComparison.OrdinalIgnoreCase); + || filePath.Contains("/images/", StringComparison.OrdinalIgnoreCase) + || Config.Settings.NonBlogPages.Get(request.FilePath.Substring(1))!=null; } private static bool IsEmbeddedResource(HttpRequestBase request) diff --git a/src/Subtext.Web/Web.config b/src/Subtext.Web/Web.config index f4e8bae25..6ed31212f 100644 --- a/src/Subtext.Web/Web.config +++ b/src/Subtext.Web/Web.config @@ -7,6 +7,7 @@
+
@@ -15,7 +16,7 @@ - + @@ -57,6 +58,15 @@ + + + + + + - + +