From 029d60bff52799dbb6a2ea518bbd5e7e93e1201e Mon Sep 17 00:00:00 2001 From: Cipa Date: Sat, 19 Mar 2011 13:52:52 -0700 Subject: [PATCH 1/2] Only check for CAPTCHA if Register form detected. Checks for a value in cmdwebsignup input field. For the default template cmdwebsignup is the submit button. For a custom template use a submit cmdwebsignup input field or a hidden cmdwebsignup field. --- assets/snippets/weblogin/weblogin.processor.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 assets/snippets/weblogin/weblogin.processor.inc.php diff --git a/assets/snippets/weblogin/weblogin.processor.inc.php b/assets/snippets/weblogin/weblogin.processor.inc.php old mode 100755 new mode 100644 index 6e773c477b..643620b633 --- a/assets/snippets/weblogin/weblogin.processor.inc.php +++ b/assets/snippets/weblogin/weblogin.processor.inc.php @@ -303,7 +303,7 @@ } } - if(isset($modx->config['use_captcha']) && $modx->config['use_captcha']==1) { + if(isset($modx->config['use_captcha']) && $modx->config['use_captcha']==1 && isset($_POST['cmdwebsignup'])) { if($_SESSION['veriword']!=$captcha_code) { $output = webLoginAlert("The security code you entered didn't validate! Please try to login again!"); $newloginerror = 1; From 9727842f44a06bf00d4b427f77e82ce0f581285f Mon Sep 17 00:00:00 2001 From: Cipa Date: Sat, 19 Mar 2011 13:59:32 -0700 Subject: [PATCH 2/2] Added instruction on how to set up a custom template if captcha on and WebSignup and WebLogin are used on the same page. Works with commit 029d60bff52799dbb6a2 --- install/assets/snippets/websignup.tpl | 5 +++++ 1 file changed, 5 insertions(+) mode change 100755 => 100644 install/assets/snippets/websignup.tpl diff --git a/install/assets/snippets/websignup.tpl b/install/assets/snippets/websignup.tpl old mode 100755 new mode 100644 index 14c6fa28fe..7f339aba58 --- a/install/assets/snippets/websignup.tpl +++ b/install/assets/snippets/websignup.tpl @@ -23,11 +23,16 @@ # Params: # # &tpl - (Optional) Chunk name or document id to use as a template +# If custom template AND captcha on AND using WebSignup and +# WebLogin on the same page make sure you have a field named +# cmdwebsignup. In the default template it is the submit button +# One can use a hidden field. # &groups - Web users groups to be assigned to users # &useCaptcha - (Optional) Determine to use (1) or not to use (0) captcha # on signup form - if not defined, will default to system # setting. GD is required for this feature. If GD is not # available, useCaptcha will automatically be set to false; +# # # Note: Templats design: # section 1: signup template