Skip to content

Commit

Permalink
Merge branch 'feature/FixCaptcha' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
skamphuis committed Jan 8, 2019
2 parents bfb7681 + 3da3ff6 commit 7ac5ee1
Show file tree
Hide file tree
Showing 74 changed files with 1,207 additions and 718 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
InstallPackager/
7 changes: 3 additions & 4 deletions API/MetaWebLog/Handler.ashx.vb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Namespace Ventrian.NewsArticles.API.MetaWebLog

Private ReadOnly Property PortalSettings() As PortalSettings
Get
Return PortalController.GetCurrentPortalSettings()
Return PortalController.Instance.GetCurrentPortalSettings()
End Get
End Property

Expand Down Expand Up @@ -108,8 +108,7 @@ Namespace Ventrian.NewsArticles.API.MetaWebLog

Dim check As Boolean = False

Dim objModuleController As New ModuleController
Dim settings As Hashtable = objModuleController.GetModuleSettings(moduleId)
Dim settings As Hashtable = Common.GetModuleSettings(moduleId)

If (user.IsSuperUser) Then
Return True
Expand Down Expand Up @@ -437,7 +436,7 @@ Namespace Ventrian.NewsArticles.API.MetaWebLog
Throw New MetaException("01", "You do not have permission to post articles")
End If

Dim objSettings As Hashtable = objModuleController.GetModuleSettings(objTabModule.ModuleID)
Dim objSettings As Hashtable = Common.GetModuleSettings(objTabModule.ModuleID)
Dim objArticleSettings As New ArticleSettings(objSettings, PortalSettings, objTabModule)

Dim objArticle As New ArticleInfo
Expand Down
44 changes: 34 additions & 10 deletions App_LocalResources/ucViewOptions.ascx.resx
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ArticleSettings.Text" xml:space="preserve">
<value>Article Settings</value>
Expand Down Expand Up @@ -438,12 +438,6 @@
<data name="CommentSettings.Text" xml:space="preserve">
<value>Comment Settings</value>
</data>
<data name="UseCaptcha.Help" xml:space="preserve">
<value>Check to use captcha validation on the post comment screen.</value>
</data>
<data name="UseCaptcha.Text" xml:space="preserve">
<value>Use Captcha?</value>
</data>
<data name="EnableCommentModeration.Help" xml:space="preserve">
<value>Check to require comments to be moderated before posting.</value>
</data>
Expand Down Expand Up @@ -766,7 +760,7 @@
<value>Always Show PageID</value>
</data>
<data name="plDefaultImageFolder.Help" xml:space="preserve">
<value>Select the default image folder.</value>
<value>Select the default image folder. Users will only be able to select this folder or its child folders.</value>
</data>
<data name="plDefaultImageFolder.Text" xml:space="preserve">
<value>Default Image Folder:</value>
Expand Down Expand Up @@ -982,7 +976,7 @@
<value>File Settings</value>
</data>
<data name="plDefaultFileFolder.Help" xml:space="preserve">
<value>Specify the default folder to upload files.</value>
<value>Specify the default folder to upload files. Users will only be able to select this folder or its child folders.</value>
</data>
<data name="plDefaultFileFolder.Text" xml:space="preserve">
<value>Default File Folder</value>
Expand Down Expand Up @@ -1197,4 +1191,34 @@
<data name="plJournalIntegrationGroups.Text" xml:space="preserve">
<value>Journal Group Posting</value>
</data>
<data name="CaptchaType.Help" xml:space="preserve">
<value>Select the type of captcha to use on the post comment screen.</value>
</data>
<data name="CaptchaType.Text" xml:space="preserve">
<value>Captcha Type</value>
</data>
<data name="CaptchaTypeDnnCore.Text" xml:space="preserve">
<value>Core DNN Captcha</value>
</data>
<data name="CaptchaTypeHoneypot.Text" xml:space="preserve">
<value>Use a Honepot control</value>
</data>
<data name="CaptchaTypeNone.Text" xml:space="preserve">
<value>None</value>
</data>
<data name="CaptchaTypeReCaptcha.Text" xml:space="preserve">
<value>Google reCaptcha</value>
</data>
<data name="reCaptchaSecretKey.Text" xml:space="preserve">
<value>reCaptcha Secret Key</value>
</data>
<data name="reCaptchaSiteKey.Text" xml:space="preserve">
<value>reCaptcha Site Key</value>
</data>
<data name="reCaptchaSecretKey.Help" xml:space="preserve">
<value>Google reCaptcha Secret Key, only needed when CaptchaType is set to reCaptcha.</value>
</data>
<data name="reCaptchaSiteKey.Help" xml:space="preserve">
<value>Google reCaptcha Site Key, only needed when CaptchaType is set to reCaptcha.</value>
</data>
</root>
11 changes: 5 additions & 6 deletions Base/NewsArticleModuleBase.vb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Imports DotNetNuke.Common
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Security
Imports DotNetNuke.Security.Permissions
Imports DotNetNuke.Services.Localization

Namespace Ventrian.NewsArticles.Base
Expand Down Expand Up @@ -45,10 +46,8 @@ Namespace Ventrian.NewsArticles.Base
Try
_articleSettings = New ArticleSettings(Settings, PortalSettings, ModuleConfiguration)
Catch
Dim objModuleController As New ModuleController()

Dim objSettings As Hashtable = objModuleController.GetModuleSettings(ModuleId)
Dim objTabSettings As Hashtable = objModuleController.GetTabModuleSettings(TabModuleId)
Dim objSettings As Hashtable = ModuleConfiguration.ModuleSettings
Dim objTabSettings As Hashtable = ModuleConfiguration.TabModuleSettings

For Each item As DictionaryEntry In objTabSettings
If (objSettings.ContainsKey(item.Key) = False) Then
Expand All @@ -57,7 +56,7 @@ Namespace Ventrian.NewsArticles.Base
Next

_articleSettings = New ArticleSettings(objSettings, PortalSettings, ModuleConfiguration)
objModuleController.UpdateModuleSetting(ModuleId, "ResetArticleSettings", "true")
ModuleController.Instance.UpdateModuleSetting(ModuleId, "ResetArticleSettings", "true")
End Try
End If
Return _articleSettings
Expand Down Expand Up @@ -356,7 +355,7 @@ Namespace Ventrian.NewsArticles.Base

' Admin of Module
'
If (PortalSecurity.HasEditPermissions(objModule.ModulePermissions)) Then
If (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, "EDIT" , objModule)) Then

Return True

Expand Down
7 changes: 3 additions & 4 deletions Components/ArticleController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Namespace Ventrian.NewsArticles

Dim objArticles As New List(Of ArticleInfo)
While dr.Read
objArticles.Add(CType(CBO.FillObject(dr, GetType(ArticleInfo), False), ArticleInfo))
objArticles.Add(CBO.FillObject(Of ArticleInfo)(dr, False))
End While

Dim nextResult As Boolean = dr.NextResult()
Expand Down Expand Up @@ -124,7 +124,7 @@ Namespace Ventrian.NewsArticles
Dim objArticle As ArticleInfo = CType(DataCache.GetCache(cacheKey), ArticleInfo)

If (objArticle Is Nothing) Then
objArticle = CType(CBO.FillObject(DataProvider.Instance().GetArticle(articleID), GetType(ArticleInfo)), ArticleInfo)
objArticle = CBO.FillObject(Of ArticleInfo)(DataProvider.Instance().GetArticle(articleID))
If (objArticle Is Nothing) Then
Return Nothing
End If
Expand Down Expand Up @@ -288,8 +288,7 @@ Namespace Ventrian.NewsArticles

Public Function GetSearchItems(ByVal ModInfo As DotNetNuke.Entities.Modules.ModuleInfo) As DotNetNuke.Services.Search.SearchItemInfoCollection Implements DotNetNuke.Entities.Modules.ISearchable.GetSearchItems

Dim objModuleController As New ModuleController
Dim settings As Hashtable = objModuleController.GetModuleSettings(ModInfo.ModuleID)
Dim settings As Hashtable = Common.GetModuleSettings(ModInfo.ModuleID)
settings = GetTabModuleSettings(ModInfo.TabModuleID, settings)

Dim doSearch As Boolean = False
Expand Down
Loading

0 comments on commit 7ac5ee1

Please sign in to comment.