Revision: 3298
http://subtext.svn.sourceforge.net/subtext/?rev=3298&view=rev
Author: twyford
Date: 2008-10-25 16:40:05 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
Fixes: Remove Email address from RSS Feed - ID: 2136420
Thanks Si!
Modified Paths:
--------------
trunk/SubtextSolution/Subtext.Framework/BlogInfo.cs
trunk/SubtextSolution/Subtext.Framework/Configuration/ConfigurationFlag.cs
trunk/SubtextSolution/Subtext.Framework/Data/DataHelper.cs
trunk/SubtextSolution/Subtext.Framework/Data/SqlDataProvider.cs
trunk/SubtextSolution/Subtext.Framework/Syndication/GenericRssWriter.cs
trunk/SubtextSolution/Subtext.Installation/Scripts/StoredProcedures.sql
trunk/SubtextSolution/Subtext.Installation/SqlInstallationProvider.cs
trunk/SubtextSolution/Subtext.Installation/Subtext.Installation.csproj
trunk/SubtextSolution/Subtext.Web/Admin/Configure.aspx
trunk/SubtextSolution/Subtext.Web/Admin/Configure.aspx.cs
trunk/SubtextSolution/Subtext.Web/Admin/Configure.aspx.designer.cs
trunk/SubtextSolution/UnitTests.Subtext/Framework/BlogInfoTests.cs
trunk/SubtextSolution/VersionInfo.Designer.cs
Added Paths:
-----------
trunk/SubtextSolution/Subtext.Installation/Scripts/Installation.02.00.01.sql
Modified: trunk/SubtextSolution/Subtext.Framework/BlogInfo.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/BlogInfo.cs 2008-09-12 01:52:41 UTC (rev 3297)
+++ trunk/SubtextSolution/Subtext.Framework/BlogInfo.cs 2008-10-25 16:40:05 UTC (rev 3298)
@@ -131,6 +131,8 @@
return ObjectProvider.Instance().GetBlogById(blogId);
}
+
+
/// <summary>
/// Class used to encapsulate URL formats for
/// various sections of the blog.
@@ -200,7 +202,18 @@
set { _blogID = value; }
}
+ private bool _showEmailAddressInRss;
/// <summary>
+ /// Gets or sets the option to show the blog owners email address in rss feeds.
+ /// </summary>
+
+ public bool ShowEmailAddressInRss
+ {
+ get { return _showEmailAddressInRss; }
+ set { _showEmailAddressInRss = value; }
+ }
+
+ /// <summary>
/// Gets the time zone.
/// </summary>
/// <value>The time zone.</value>
Modified: trunk/SubtextSolution/Subtext.Framework/Configuration/ConfigurationFlag.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Configuration/ConfigurationFlag.cs 2008-09-12 01:52:41 UTC (rev 3297)
+++ trunk/SubtextSolution/Subtext.Framework/Configuration/ConfigurationFlag.cs 2008-10-25 16:40:05 UTC (rev 3298)
@@ -63,5 +63,7 @@
CommentNotificationEnabled = 8192,
/// <summary>Trackback notification mails are enabled.</summary>
TrackbackNotificationEnabled = 16384,
+ /// <summary>Show blog author email address in rss feed</summary>
+ ShowAuthorEmailAddressinRss = 1,
};
}
Modified: trunk/SubtextSolution/Subtext.Framework/Data/DataHelper.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Data/DataHelper.cs 2008-09-12 01:52:41 UTC (rev 3297)
+++ trunk/SubtextSolution/Subtext.Framework/Data/DataHelper.cs 2008-10-25 16:40:05 UTC (rev 3298)
@@ -578,6 +578,7 @@
info.Password = ReadString(reader, "Password");
info.OpenIDUrl = ReadString(reader, "OpenIDUrl");
info.CardSpaceHash = ReadString(reader, "CardSpaceHash");
+ info.ShowEmailAddressInRss = ReadBoolean(reader, "ShowEmailRssFeed");
info.SubTitle = ReadString(reader, "SubTitle");
info.Title = ReadString(reader, "Title");
Modified: trunk/SubtextSolution/Subtext.Framework/Data/SqlDataProvider.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Data/SqlDataProvider.cs 2008-09-12 01:52:41 UTC (rev 3297)
+++ trunk/SubtextSolution/Subtext.Framework/Data/SqlDataProvider.cs 2008-10-25 16:40:05 UTC (rev 3298)
@@ -1405,7 +1405,8 @@
,DataHelper.MakeInParam("@OpenIDUrl", SqlDbType.VarChar, 255, info.OpenIDUrl)
,DataHelper.MakeInParam("@CardSpaceHash", SqlDbType.NVarChar, 512, info.CardSpaceHash)
,DataHelper.MakeInParam("@OpenIDServer", SqlDbType.VarChar, 255, info.OpenIDServer)
- ,DataHelper.MakeInParam("@OpenIDDelegate", SqlDbType.VarChar, 255, info.OpenIDDelegate)
+ ,DataHelper.MakeInParam("@OpenIDDelegate", SqlDbType.VarChar, 255, info.OpenIDDelegate)
+ ,DataHelper.MakeInParam("@ShowEmailRssFeed", SqlDbType.Bit,100,info.ShowEmailAddressInRss)
};
return NonQueryBool("subtext_UpdateConfig", p);
Modified: trunk/SubtextSolution/Subtext.Framework/Syndication/GenericRssWriter.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Syndication/GenericRssWriter.cs 2008-09-12 01:52:41 UTC (rev 3297)
+++ trunk/SubtextSolution/Subtext.Framework/Syndication/GenericRssWriter.cs 2008-10-25 16:40:05 UTC (rev 3298)
@@ -120,7 +120,8 @@
/// </summary>
protected virtual void WriteChannel()
{
- RssImageElement image = new RssImageElement(GetRssImage(), _info.Title, _info.HomeFullyQualifiedUrl, 77, 60, null);
+ RssImageElement image =
+ new RssImageElement(GetRssImage(), _info.Title, _info.HomeFullyQualifiedUrl, 77, 60, null);
BuildChannel(_info.Title, _info.HomeFullyQualifiedUrl.ToString(), _info.Email, _info.SubTitle, _info.Language, _info.Author, Config.CurrentBlog.LicenseUrl, image);
}
@@ -170,10 +171,12 @@
this.WriteElementString("language", lang);
//TODO: Implement this element.
this.WriteElementString("copyright", copyright);
-
- //TODO: Provide REAL email authentication.
- //TODO: Allow blog owner to omit this field on a per-blog basis without having to remove email address. Or we might consider a separate field for Syndicated email address.
- if (authorEmail != null && authorEmail.Length > 0 && authorEmail.IndexOf("@") > 0 && authorEmail.IndexOf(".") > 0)
+
+ if (authorEmail != null
+ && authorEmail.Length > 0
+ && authorEmail.IndexOf("@") > 0
+ && authorEmail.IndexOf(".") > 0
+ && (Config.CurrentBlog.ShowEmailAddressInRss))
{
this.WriteElementString("managingEditor", authorEmail);
}
@@ -186,8 +189,10 @@
this.WriteElementString("creativeCommons:license", cclicense);
}
- if(image != null)
- image.WriteToXmlWriter(this);
+ if (image != null)
+ {
+ image.WriteToXmlWriter(this);
+ }
}
protected void EndChannel()
Added: trunk/SubtextSolution/Subtext.Installation/Scripts/Installation.02.00.01.sql
===================================================================
--- trunk/SubtextSolution/Subtext.Installation/Scripts/Installation.02.00.01.sql (rev 0)
+++ trunk/SubtextSolution/Subtext.Installation/Scripts/Installation.02.00.01.sql 2008-10-25 16:40:05 UTC (rev 3298)
@@ -0,0 +1,14 @@
+/*----------- {Config/Rss Email Author} ------------*/
+/*add the ShowEmailRssFeed column */
+IF NOT EXISTS
+(
+ SELECT * FROM [INFORMATION_SCHEMA].[COLUMNS]
+ WHERE TABLE_NAME = 'subtext_Config'
+ AND TABLE_SCHEMA = '<dbUser,varchar,dbo>'
+ AND COLUMN_NAME = 'ShowEmailRssFeed'
+)
+BEGIN
+ ALTER TABLE [<dbUser,varchar,dbo>].[subtext_Config]
+ ADD [ShowEmailRssFeed] [bit] NULL
+END
+GO
Modified: trunk/SubtextSolution/Subtext.Installation/Scripts/StoredProcedures.sql
===================================================================
--- trunk/SubtextSolution/Subtext.Installation/Scripts/StoredProcedures.sql 2008-09-12 01:52:41 UTC (rev 3297)
+++ trunk/SubtextSolution/Subtext.Installation/Scripts/StoredProcedures.sql 2008-10-25 16:40:05 UTC (rev 3298)
@@ -1262,6 +1262,7 @@
, OpenIDServer
, OpenIDDelegate
, CardSpaceHash
+ , ShowEmailRssFeed
FROM [<dbUser,varchar,dbo>].[subtext_Config]
END
ELSE IF (@Strict = 0) AND (1 = (SELECT COUNT(1) FROM [<dbUser,varchar,dbo>].[subtext_Config] WHERE Host = @Host))
@@ -1306,6 +1307,7 @@
, OpenIDServer
, OpenIDDelegate
, CardSpaceHash
+ , ShowEmailRssFeed
FROM [<dbUser,varchar,dbo>].[subtext_Config]
LEFT OUTER JOIN [<dbUser,varchar,dbo>].[subtext_BlogGroup] bgroup ON bgroup.Id = [subtext_Config].BlogGroupId
WHERE Host = @Host
@@ -1350,6 +1352,7 @@
, MobileSkinCssFile
, OpenIDUrl
, CardSpaceHash
+ , ShowEmailRssFeed
FROM [<dbUser,varchar,dbo>].[subtext_Config]
LEFT OUTER JOIN [<dbUser,varchar,dbo>].[subtext_BlogGroup] bgroup ON
bgroup.Id = [subtext_Config].BlogGroupId
@@ -3303,6 +3306,7 @@
, @CardSpaceHash nvarchar(512) = NULL
, @OpenIDServer varchar(255) = NULL
, @OpenIDDelegate varchar(255) = NULL
+ , @ShowEmailRssFeed bit
)
AS
UPDATE [<dbUser,varchar,dbo>].[subtext_Config]
@@ -3340,6 +3344,7 @@
, CardSpaceHash = @CardSpaceHash
, OpenIDServer = @OpenIDServer
, OpenIDDelegate = @OpenIDDelegate
+ , ShowEmailRssFeed = @ShowEmailRssFeed
WHERE BlogId = @BlogId
GO
@@ -3756,6 +3761,7 @@
, blog.CardSpaceHash
, blog.OpenIDServer
, blog.OpenIDDelegate
+ , blog.ShowEmailRssFeed
FROM [<dbUser,varchar,dbo>].[subtext_Config] blog
LEFT OUTER JOIN [<dbUser,varchar,dbo>].[subtext_BlogGroup] bgroup ON
bgroup.Id = blog.BlogGroupId
@@ -5435,4 +5441,4 @@
GO
GRANT EXECUTE ON [<dbUser,varchar,dbo>].[subtext_DeleteEnclosure] TO [public]
-GO
\ No newline at end of file
+GO
Modified: trunk/SubtextSolution/Subtext.Installation/SqlInstallationProvider.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Installation/SqlInstallationProvider.cs 2008-09-12 01:52:41 UTC (rev 3297)
+++ trunk/SubtextSolution/Subtext.Installation/SqlInstallationProvider.cs 2008-10-25 16:40:05 UTC (rev 3298)
@@ -220,6 +220,11 @@
internal class InstallationScriptInfo
{
+ //Have the compiled regex as static to get the full benefit of compilation
+ private static Regex _ScriptParseRegex =
+ new Regex(@"(?<ScriptName>Installation\.(?<version>\d+\.\d+\.\d+)\.sql)$",
+ RegexOptions.Compiled | RegexOptions.IgnoreCase);
+
private InstallationScriptInfo(string scriptName, Version version)
{
this.version = version;
@@ -228,8 +233,7 @@
internal static InstallationScriptInfo Parse(string resourceName)
{
- Regex regex = new Regex(@"(?<ScriptName>Installation\.(?<version>\d+\.\d+\.\d+)\.sql)$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
- Match match = regex.Match(resourceName);
+ Match match = _ScriptParseRegex.Match(resourceName);
if(!match.Success)
{
return null;
Modified: trunk/SubtextSolution/Subtext.Installation/Subtext.Installation.csproj
===================================================================
--- trunk/SubtextSolution/Subtext.Installation/Subtext.Installation.csproj 2008-09-12 01:52:41 UTC (rev 3297)
+++ trunk/SubtextSolution/Subtext.Installation/Subtext.Installation.csproj 2008-10-25 16:40:05 UTC (rev 3298)
@@ -180,6 +180,9 @@
<ItemGroup>
<EmbeddedResource Include="Scripts\Installation.02.00.00.sql" />
</ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Scripts\Installation.02.00.01.sql" />
+ </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
Modified: trunk/SubtextSolution/Subtext.Web/Admin/Configure.aspx
===================================================================
--- trunk/SubtextSolution/Subtext.Web/Admin/Configure.aspx 2008-09-12 01:52:41 UTC (rev 3297)
+++ trunk/SubtextSolution/Subtext.Web/Admin/Configure.aspx 2008-10-25 16:40:05 UTC (rev 3298)
@@ -11,7 +11,7 @@
runat="server">
</asp:Content>
<asp:Content ID="configurationOptions" ContentPlaceHolderID="pageContent" runat="server">
- <st:MessagePanel ID="Messages" runat="server" />
+ <st:messagepanel ID="Messages" runat="server" />
<h2>
Configure</h2>
<div class="Edit" id="configure-form">
@@ -30,7 +30,8 @@
<asp:TextBox ID="txbAuthor" runat="server" CssClass="textbox" />
<label accesskey="e" for="Edit_txbAuthorEmail">
Owner's <u>E</u>mail</label>
- <asp:TextBox ID="txbAuthorEmail" runat="server" CssClass="textbox" />
+ <asp:TextBox ID="txbAuthorEmail" runat="server" CssClass="textbox" />
+ <asp:CheckBox ID="ckbShowEmailonRssFeed" runat="server" CssClass="checkbox" AccessKey="r" Text="Show email address on <u>R</u>SS Feed" /><br />
<label accesskey="s" for="Edit_ddlSkin">
Display <u>S</u>kin</label>
<asp:DropDownList ID="ddlSkin" runat="server" DataSource="<%# Skins %>" DataTextField="Name"
@@ -300,8 +301,9 @@
<div class="options">
<label accesskey="c" for="Edit_txbSecondaryCss">
<u>C</u>ustom CSS
- <st:HelpToolTip ID="HelpToolTip1" runat="server" HelpText="You can enter custom CSS within this block. Be careful as the tool will not validate the CSS. This CSS will be included (as a proper link) within every page of your blog."
- ImageUrl="~/images/icons/help-small.png" ImageWidth="16" ImageHeight="16" />
+ <st:helptooltip ID="HelpToolTip1" runat="server" HelpText="You can enter custom CSS within this block. Be careful as the tool will not validate the CSS. This CSS will be included (as a proper link) within every page of your blog."
+ ImageUrl="~/images/icons/help-small.png" ImageWidth="16"
+ ImageHeight="16" />
</label>
<asp:TextBox ID="txbSecondaryCss" runat="server" CssClass="textarea" TextMode="MultiLine" />
<label accesskey="a" for="Edit_txbNews">
Modified: trunk/SubtextSolution/Subtext.Web/Admin/Configure.aspx.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Web/Admin/Configure.aspx.cs 2008-09-12 01:52:41 UTC (rev 3297)
+++ trunk/SubtextSolution/Subtext.Web/Admin/Configure.aspx.cs 2008-10-25 16:40:05 UTC (rev 3298)
@@ -93,6 +93,7 @@
txbAuthorEmail.Text = info.Email;
txbUser.Text = info.UserName;
txbNews.Text = info.News;
+ ckbShowEmailonRssFeed.Checked = info.ShowEmailAddressInRss;
txbGenericTrackingCode.Text = info.TrackingCode;
ckbAllowServiceAccess.Checked = info.AllowServiceAccess;
ddlTimezone.DataSource = WindowsTimeZone.TimeZones;
@@ -195,7 +196,7 @@
info.Author = txbAuthor.Text;
info.Email = txbAuthorEmail.Text;
info.UserName = txbUser.Text;
-
+ info.ShowEmailAddressInRss = ckbShowEmailonRssFeed.Checked;
info.TimeZoneId = Int32.Parse(ddlTimezone.SelectedItem.Value);
info.Subfolder = Config.CurrentBlog.Subfolder;
info.Host = Config.CurrentBlog.Host;
@@ -285,4 +286,4 @@
#endregion
}
-}
\ No newline at end of file
+}
Modified: trunk/SubtextSolution/Subtext.Web/Admin/Configure.aspx.designer.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Web/Admin/Configure.aspx.designer.cs 2008-09-12 01:52:41 UTC (rev 3297)
+++ trunk/SubtextSolution/Subtext.Web/Admin/Configure.aspx.designer.cs 2008-10-25 16:40:05 UTC (rev 3298)
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:2.0.50727.1434
+// Runtime Version:2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -68,6 +68,15 @@
protected global::System.Web.UI.WebControls.TextBox txbAuthorEmail;
/// <summary>
+ /// ckbShowEmailonRssFeed control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.WebControls.CheckBox ckbShowEmailonRssFeed;
+
+ /// <summary>
/// ddlSkin control.
/// </summary>
/// <remarks>
@@ -167,51 +176,60 @@
protected global::System.Web.UI.WebControls.DropDownList ddlLangLocale;
/// <summary>
- /// ddlItemCount control.
+ /// Panel1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
- protected global::System.Web.UI.WebControls.DropDownList ddlItemCount;
+ protected global::System.Web.UI.WebControls.Panel Panel1;
/// <summary>
- /// ddlCategoryListPostCount control.
+ /// hlpOpenID control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
- protected global::System.Web.UI.WebControls.DropDownList ddlCategoryListPostCount;
+ protected global::Subtext.Web.Controls.HelpToolTip hlpOpenID;
/// <summary>
- /// hlpOpenID control.
+ /// tbOpenIDServer control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
- protected global::Subtext.Web.Controls.HelpToolTip hlpOpenID;
+ protected global::System.Web.UI.WebControls.TextBox tbOpenIDServer;
/// <summary>
- /// tbOpenIDServer control.
+ /// tbOpenIDDelegate control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
- protected global::System.Web.UI.WebControls.TextBox tbOpenIDServer;
+ protected global::System.Web.UI.WebControls.TextBox tbOpenIDDelegate;
/// <summary>
- /// tbOpenIDDelegate control.
+ /// ddlItemCount control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
- protected global::System.Web.UI.WebControls.TextBox tbOpenIDDelegate;
+ protected global::System.Web.UI.WebControls.DropDownList ddlItemCount;
/// <summary>
+ /// ddlCategoryListPostCount control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.WebControls.DropDownList ddlCategoryListPostCount;
+
+ /// <summary>
/// HelpToolTip1 control.
/// </summary>
/// <remarks>
Modified: trunk/SubtextSolution/UnitTests.Subtext/Framework/BlogInfoTests.cs
===================================================================
--- trunk/SubtextSolution/UnitTests.Subtext/Framework/BlogInfoTests.cs 2008-09-12 01:52:41 UTC (rev 3297)
+++ trunk/SubtextSolution/UnitTests.Subtext/Framework/BlogInfoTests.cs 2008-10-25 16:40:05 UTC (rev 3298)
@@ -104,6 +104,12 @@
blog.IsActive = false;
Assert.IsTrue((blog.Flag & ConfigurationFlags.IsActive) != ConfigurationFlags.IsActive);
+ blog.ShowEmailAddressInRss = true;
+ Assert.IsTrue(blog.ShowEmailAddressInRss);
+ Assert.IsTrue((blog.Flag & ConfigurationFlags.ShowAuthorEmailAddressinRss) == ConfigurationFlags.ShowAuthorEmailAddressinRss);
+ blog.ShowEmailAddressInRss = false;
+ Assert.IsTrue((blog.Flag & ConfigurationFlags.ShowAuthorEmailAddressinRss) != ConfigurationFlags.ShowAuthorEmailAddressinRss);
+
blog.IsAggregated = true;
Assert.IsTrue(blog.IsAggregated);
Assert.IsTrue((blog.Flag & ConfigurationFlags.IsAggregated) == ConfigurationFlags.IsAggregated);
Modified: trunk/SubtextSolution/VersionInfo.Designer.cs
===================================================================
--- trunk/SubtextSolution/VersionInfo.Designer.cs 2008-09-12 01:52:41 UTC (rev 3297)
+++ trunk/SubtextSolution/VersionInfo.Designer.cs 2008-10-25 16:40:05 UTC (rev 3298)
@@ -11,5 +11,5 @@
// </auto-generated>
//------------------------------------------------------------------------------
-[assembly: AssemblyVersionAttribute("2.0.0.0")]
+[assembly: AssemblyVersionAttribute("2.0.1.0")]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|