diff --git a/.gitignore b/.gitignore
index 913083b..af69409 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1 @@
-Installs/NewsArticles.00.09.11/
-Installs/NewsArticles.00.10.00/
+InstallPackager/
diff --git a/App_LocalResources/ucViewOptions.ascx.resx b/App_LocalResources/ucViewOptions.ascx.resx
index 72caad6..e28308a 100755
--- a/App_LocalResources/ucViewOptions.ascx.resx
+++ b/App_LocalResources/ucViewOptions.ascx.resx
@@ -112,10 +112,10 @@
2.0
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Article Settings
@@ -438,12 +438,6 @@
Comment Settings
-
- Check to use captcha validation on the post comment screen.
-
-
- Use Captcha?
-
Check to require comments to be moderated before posting.
@@ -1197,4 +1191,34 @@
Journal Group Posting
+
+ Select the type of captcha to use on the post comment screen.
+
+
+ Captcha Type
+
+
+ Core DNN Captcha
+
+
+ Use a Honepot control
+
+
+ None
+
+
+ Google reCaptcha
+
+
+ reCaptcha Secret Key
+
+
+ reCaptcha Site Key
+
+
+ Google reCaptcha Secret Key, only needed when CaptchaType is set to reCaptcha.
+
+
+ Google reCaptcha Site Key, only needed when CaptchaType is set to reCaptcha.
+
\ No newline at end of file
diff --git a/Components/ArticleSettings.vb b/Components/ArticleSettings.vb
index 9ecf85f..86f90ce 100755
--- a/Components/ArticleSettings.vb
+++ b/Components/ArticleSettings.vb
@@ -57,10 +57,10 @@ Namespace Ventrian.NewsArticles
Dim role As String
For Each role In roles.Split(New Char() {";"c})
- If (role <> "" AndAlso Not role Is Nothing AndAlso _
- ((context.Request.IsAuthenticated = False And role = glbRoleUnauthUserName) Or _
- role = glbRoleAllUsersName Or _
- objUserInfo.IsInRole(role) = True _
+ If (role <> "" AndAlso Not role Is Nothing AndAlso
+ ((context.Request.IsAuthenticated = False And role = glbRoleUnauthUserName) Or
+ role = glbRoleAllUsersName Or
+ objUserInfo.IsInRole(role) = True
)) Then
Return True
End If
@@ -939,12 +939,39 @@ Namespace Ventrian.NewsArticles
End Get
End Property
- Public ReadOnly Property UseCaptcha() As Boolean
+ Public ReadOnly Property CaptchaType() As CaptchaType
Get
+ Dim retval As CaptchaType = CaptchaType.None
If (Settings.Contains(ArticleConstants.USE_CAPTCHA_SETTING)) Then
- Return Convert.ToBoolean(Settings(ArticleConstants.USE_CAPTCHA_SETTING))
+ 'there's an existing module setting, so make sure we don't change behavior for that
+ If Convert.ToBoolean(Settings(ArticleConstants.USE_CAPTCHA_SETTING).ToString()) Then
+ retval = CaptchaType.DnnCore
+ End If
Else
- Return False
+ If (Settings.Contains(ArticleConstants.CAPTCHATYPE_SETTING)) Then
+ retval = CType(System.Enum.Parse(GetType(CaptchaType), Settings(ArticleConstants.CAPTCHATYPE_SETTING)), CaptchaType)
+ End If
+ End If
+ Return retval
+ End Get
+ End Property
+
+ Public ReadOnly Property ReCaptchaSiteKey() As String
+ Get
+ If Settings.ContainsKey(ArticleConstants.RECAPTCHA_SITEKEY_SETTING) Then
+ Return Settings(ArticleConstants.RECAPTCHA_SITEKEY_SETTING).ToString()
+ Else
+ Return ""
+ End If
+ End Get
+ End Property
+
+ Public ReadOnly Property ReCaptchaSecretKey() As String
+ Get
+ If Settings.ContainsKey(ArticleConstants.RECAPTCHA_SECRETKEY_SETTING) Then
+ Return Settings(ArticleConstants.RECAPTCHA_SECRETKEY_SETTING).ToString()
+ Else
+ Return ""
End If
End Get
End Property
diff --git a/Components/CaptchaType.vb b/Components/CaptchaType.vb
new file mode 100644
index 0000000..a5fbe13
--- /dev/null
+++ b/Components/CaptchaType.vb
@@ -0,0 +1,24 @@
+'
+' News Articles for DotNetNuke - http://www.dotnetnuke.com
+' Copyright (c) 2002-2007
+' by Ventrian ( sales@ventrian.com ) ( http://www.ventrian.com )
+'
+
+Imports System
+Imports System.Configuration
+Imports System.Data
+
+Imports DotNetNuke.Common.Utilities
+
+Namespace Ventrian.NewsArticles
+
+ Public Enum CaptchaType
+
+ None
+ DnnCore
+ ReCaptcha
+ Honeypot
+
+ End Enum
+
+End Namespace
diff --git a/Components/Common/ArticleConstants.vb b/Components/Common/ArticleConstants.vb
index bfb22d3..4fca1a6 100755
--- a/Components/Common/ArticleConstants.vb
+++ b/Components/Common/ArticleConstants.vb
@@ -125,6 +125,9 @@ Namespace Ventrian.NewsArticles
Public Const COMMENT_REQUIRE_NAME_SETTING As String = "CommentRequireName"
Public Const COMMENT_REQUIRE_EMAIL_SETTING As String = "CommentRequireEmail"
Public Const USE_CAPTCHA_SETTING As String = "UseCaptcha"
+ Public Const CAPTCHATYPE_SETTING As String = "CaptchaType"
+ Public Const RECAPTCHA_SITEKEY_SETTING As String = "reCaptchaSiteKey"
+ Public Const RECAPTCHA_SECRETKEY_SETTING As String = "reCaptchaSecretKey"
Public Const NOTIFY_DEFAULT_SETTING As String = "NotifyDefault"
Public Const COMMENT_SORT_DIRECTION_SETTING As String = "CommentSortDirection"
Public Const COMMENT_AKISMET_SETTING As String = "CommentAkismet"
diff --git a/Controls/Honeypot.ascx b/Controls/Honeypot.ascx
new file mode 100644
index 0000000..ac7a100
--- /dev/null
+++ b/Controls/Honeypot.ascx
@@ -0,0 +1,7 @@
+<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Honeypot.ascx.vb" Inherits="Ventrian.NewsArticles.Controls.Honeypot" %>
+<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
+
diff --git a/Controls/Honeypot.ascx.designer.vb b/Controls/Honeypot.ascx.designer.vb
new file mode 100644
index 0000000..0f455fa
--- /dev/null
+++ b/Controls/Honeypot.ascx.designer.vb
@@ -0,0 +1,44 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+Namespace Ventrian.NewsArticles.Controls
+
+ Partial Public Class Honeypot
+
+ '''
+ '''ConfirmEmailLabel control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents ConfirmEmailLabel As Global.System.Web.UI.UserControl
+
+ '''
+ '''txtConfirmEmail control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents txtConfirmEmail As Global.System.Web.UI.WebControls.TextBox
+
+ '''
+ '''RecaptchaValidator control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents RecaptchaValidator As Global.System.Web.UI.WebControls.CustomValidator
+ End Class
+End Namespace
diff --git a/Controls/Honeypot.ascx.vb b/Controls/Honeypot.ascx.vb
new file mode 100644
index 0000000..67002f6
--- /dev/null
+++ b/Controls/Honeypot.ascx.vb
@@ -0,0 +1,23 @@
+Imports System.IO
+Imports System.Net
+Imports System.Web.Script.Serialization
+Imports DotNetNuke.Common.Utilities
+
+Namespace Ventrian.NewsArticles.Controls
+ Public Class Honeypot
+ Inherits System.Web.UI.UserControl
+
+ Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+
+ End Sub
+
+ Protected Sub HoneypotValidator_OnServerValidate(source As Object, args As ServerValidateEventArgs)
+ args.IsValid = IsValid()
+ End Sub
+
+ Public Function IsValid() As Boolean
+ Return txtConfirmEmail.Text = ""
+ End Function
+ End Class
+
+End Namespace
\ No newline at end of file
diff --git a/Controls/PostComment.ascx b/Controls/PostComment.ascx
index 8ff659c..d32cd9e 100755
--- a/Controls/PostComment.ascx
+++ b/Controls/PostComment.ascx
@@ -1,5 +1,7 @@
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="PostComment.ascx.vb" Inherits="Ventrian.NewsArticles.Controls.PostComment" %>
<%@ Register TagPrefix="dnn" Assembly="DotNetNuke" Namespace="DotNetNuke.UI.WebControls"%>
+<%@ Register TagPrefix="article" TagName="ReCaptcha" Src="ReCaptcha.ascx" %>
+<%@ Register TagPrefix="article" TagName="Honeypot" Src="Honeypot.ascx" %>