Is it possible to implement a captcha with the WebLogin 1.1 snippet that came with the demo content for web users to comment on the blog articles when you first install MODx Evo 1.04? I have tried copying the code from the FormSignup chunk and placed it inside of the FormLogin chunk to get the image to show under the username and password text boxes in the right column
<fieldset>
<h3>Your Login Details</h3>
<label for="username">User: <input type="text" name="username" id="username" tabindex="1" onkeypress="return webLoginEnter(document.loginfrm.password);" value="[+username+]" /></label>
<label for="password">Password: <input type="password" name="password" id="password" tabindex="2" onkeypress="return webLoginEnter(document.loginfrm.cmdweblogin);" value="" /></label>
<p>Enter the word/number combination shown in the image below.</p>
<p><a href="[+action+]"><img align="top" src="manager/includes/veriword.php" width="149" height="60" alt="If you have trouble reading the code, click on the code itself to generate a new random code." style="border: 1px solid #039" /></a></p>
<label>Form code:*
<input type="text" name="formcode" class="inputBox" size="20" /></label>
<input type="checkbox" id="checkbox_1" name="checkbox_1" tabindex="3" size="1" value="" [+checkbox+] onclick="webLoginCheckRemember()" /><label for="checkbox_1" class="checkbox">Remember me</label>
<input type="submit" value="[+logintext+]" name="cmdweblogin" class="button" />
<a href="#" onclick="webLoginShowForm(2);return false;" id="forgotpsswd">Forget Your Password?</a>
{{register}}
{{manager user}}
</fieldset>
and placed the &useCaptcha=`1` inside of my snippet call like follows:
<h2>Login:</h2>
<div id="sidebarlogin">[!WebLogin? &tpl=`FormLogin` &loginhomeid=`[(site_start)]` &useCaptcha=`1`!]</div>
But it doesn’t seem to validate. You can view the site here:
http://www.grstreamkeepers.com look at the lower right corner side bar and you’ll see the login with captcha. You can use tester with test123 to see what I mean.
I also tried copying the code (in red) from the WebSignup snippet and pasted into the WebLogin snippet but that doesn’t seem to work either:
WebLogin 1.1 Snippet Code
# Snippet customize settings
$liHomeId = isset($loginhomeid)? explode(",",$loginhomeid):array($modx->config[’login_home’],$modx->documentIdentifier);
$loHomeId = isset($logouthomeid)? $logouthomeid:$modx->documentIdentifier;
$pwdReqId = isset($pwdreqid)? $pwdreqid:0;
$pwdActId = isset($pwdactid)? $pwdactid:0;
$loginText = isset($logintext)? $logintext:’Login’;
$logoutText = isset($logouttext)? $logouttext:’Logout’;
$tpl = isset($tpl)? $tpl:"";
$useCaptcha = isset($useCaptcha)? $useCaptcha : $modx->config[’use_captcha’] ;
// Override captcha if no GD
if ($useCaptcha && !gd_info()) $useCaptcha = 0;
The login form seems to work fine with captcha disabled, however when I disable the captcha feature I get bombarded by bots trying to register with the registration page which uses the FormSignup chunk in conjunction with the WebSignup 1.1 snippet therefore I have to enable the captcha to avoid the bots.
Can anyone help me with this? Am I missing something?