Forum for discussing general topics related to Couch.
15 posts Page 2 of 2
The type 'recaptcha' input raises errors like all other Couch inputs (the 'require' parameter is not really needed as Google will always validate the captcha at each submission).

As mentioned in the docs on form, your form then should display the errors either in bulk - e.g.
Code: Select all
<cms:if k_error >
    <font color='red'><cms:each k_error ><cms:show item /><br /></cms:each></font>

Or with individual field - e.g. assuming the name of the captcha field is 'recaptcha_test', you should test for a variable named 'k_error_recaptcha_test' as follows
Code: Select all
<cms:input name='recaptcha_test' type='recaptcha'/><br>

<cms:if k_error_recaptcha_test>
    <font color='red'><cms:show k_error_recaptcha_test /></font><br>

@oldcelt, are you using any of those two in your form?
I wasn't but I'll give it a go!

CouchCMS is brilliant but needs a lot of study to get the finer points embedded in the old brain :)

I'm sure I'll get there in the end - thanks again for the instant help.
KK wrote: <cms:if k_error_recaptcha_test>
<font color='red'><cms:show k_error_recaptcha_test /></font><br>
@oldcelt, are you using any of those two in your form?

Each individual field on the form did have the above but the recaptcha_test didn't. That sorted it - thank you!
Hi!! How are you? I am having a problem with an integration with the google captcha. I dont know why it doesnt work.
I config the couch/config.php with the secret and site key of google captcha. Also, in the login.html (in theme/_system) this:
<cms:input name='recaptcha_test' type='recaptcha'/> and also i put in the addon/captcha the
require_once( K_COUCH_DIR.'addons/recaptcha/recaptcha.php' );

Well, the problem is that i see and i can do the verification of the captcha in the login, but in the case that i didn't do the verification of the captcha (i only put the USER/PASSWORD), and then click in "login", i can login.

How can i do if i want that the captcha has been required for the login?

Sorry if my english is bad!!

Hi @calejandro :)

From what I could gather, you are trying to add the captcha to the 'login' form of Couch admin-panel. Right?
If so, just making it show in the form won't be sufficient as the core code processing the login form will remain unaware of the new addition and will just ignore it (which you have seen).

The correct way is to 'override' the default login processing mechanism of Couch and then do all the processing yourself (which would include validating the captcha also).

This could be a little advanced if you are only just beginning with Couch but please take a look at 'extended-users' -

You may use the technique shown there to create your own login form with whatever modifications you desire.

Hope this helps.
15 posts Page 2 of 2

Who is online

In total there are 6 users online :: 1 registered, 0 hidden and 5 guests
(based on users active over the past 5 minutes)

Users browsing this forum: Google [Bot] and 5 guests