Skip to content
This repository has been archived by the owner on Feb 12, 2018. It is now read-only.

Commit

Permalink
Improvements to reCaptcha feedback messages
Browse files Browse the repository at this point in the history
  • Loading branch information
peppertree committed Jul 22, 2014
1 parent f093a3e commit 8e0b13b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
18 changes: 18 additions & 0 deletions App_LocalResources/View.ascx.resx
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,22 @@
<data name="lblEmailRegex.Text" xml:space="preserve">
<value />
</data>
<data name="captcha-timeout.Error" xml:space="preserve">
<value>You have waited too long for submitting the form</value>
</data>
<data name="incorrect-captcha-sol.Error" xml:space="preserve">
<value>The challenge solution was not correct</value>
</data>
<data name="invalid-request-cookie.Error" xml:space="preserve">
<value>The challenge solution was not correct</value>
</data>
<data name="invalid-site-private-key.Error" xml:space="preserve">
<value>ReCaptach key error. Check your reCaptach account!</value>
</data>
<data name="recaptcha-common-error.Error" xml:space="preserve">
<value>Unknown reCaptcha error</value>
</data>
<data name="recaptcha-not-reachable.Error" xml:space="preserve">
<value>ReCaptcha server not reachable. Check your reCaptach account!</value>
</data>
</root>
15 changes: 9 additions & 6 deletions View.ascx.vb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Imports DotNetNuke.Common.Globals
Imports DotNetNuke.Common.Utilities
Imports System.Net
Imports System.IO
Imports DotNetNuke.Services.Log.EventLog

Namespace Connect.Modules.UserManagement.AccountRegistration

Expand Down Expand Up @@ -96,19 +97,21 @@ Namespace Connect.Modules.UserManagement.AccountRegistration
pnlSuccess.Visible = False
Select Case strResultCode.ToLower
Case "invalid-site-private-key"
'reCaptach set up not correct, register anyway.
'reCaptcha set up not correct, register anyway.
DotNetNuke.Services.Exceptions.LogException(New Exception(Localization.GetString(strResultCode.ToLower & ".Error", LocalResourceFile)))
Register()
Case "invalid-request-cookie"
lblError.Text = "The challenge solution was not correct"
lblError.Text = Localization.GetString(strResultCode.ToLower & ".Error", LocalResourceFile)
Case "incorrect-captcha-sol"
lblError.Text = "The challenge solution was not correct"
lblError.Text = Localization.GetString(strResultCode.ToLower & ".Error", LocalResourceFile)
Case "captcha-timeout"
lblError.Text = "You have waited too long for submitting the form"
lblError.Text = Localization.GetString(strResultCode.ToLower & ".Error", LocalResourceFile)
Case "recaptcha-not-reachable"
'reCaptach server not reachable. Register anyway.
'reCaptcha server not reachable. Register anyway.
DotNetNuke.Services.Exceptions.LogException(New Exception(Localization.GetString(strResultCode.ToLower & ".Error", LocalResourceFile)))
Register()
Case Else
lblError.Text = "Unknown reCaptcha error."
lblError.Text = Localization.GetString("recaptcha-common-error.Error", LocalResourceFile)
End Select
End If

Expand Down

0 comments on commit 8e0b13b

Please sign in to comment.