From 8e0b13bfa66701358cbbf220f702334cb0f88fa0 Mon Sep 17 00:00:00 2001 From: peppertree Date: Tue, 22 Jul 2014 11:35:08 +0200 Subject: [PATCH] Improvements to reCaptcha feedback messages https://github.com/DNN-Connect/UserAccountRegistration/issues/6 --- App_LocalResources/View.ascx.resx | 18 ++++++++++++++++++ View.ascx.vb | 15 +++++++++------ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/App_LocalResources/View.ascx.resx b/App_LocalResources/View.ascx.resx index 5f9de73..15ec8e4 100644 --- a/App_LocalResources/View.ascx.resx +++ b/App_LocalResources/View.ascx.resx @@ -321,4 +321,22 @@ + + You have waited too long for submitting the form + + + The challenge solution was not correct + + + The challenge solution was not correct + + + ReCaptach key error. Check your reCaptach account! + + + Unknown reCaptcha error + + + ReCaptcha server not reachable. Check your reCaptach account! + \ No newline at end of file diff --git a/View.ascx.vb b/View.ascx.vb index 721095a..2d9ec8e 100644 --- a/View.ascx.vb +++ b/View.ascx.vb @@ -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 @@ -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