Difference between revisions of "NATS5 Join Page CAPTCHA"
Line 37: | Line 37: | ||
{if $errors.captcha}<div class="join_error">{$errors.captcha}</div>{/if} | {if $errors.captcha}<div class="join_error">{$errors.captcha}</div>{/if} | ||
<img src="/captcha_image.php?width=300&height=90" width="300" height="90" /><br /> | <img src="/captcha_image.php?width=300&height=90" width="300" height="90" /><br /> | ||
− | <label class="memberinfo"> | + | <label class="memberinfo">Verefy Text:</label> |
<input class="join_input" type="text" name="signup[captcha:1]" /> | <input class="join_input" type="text" name="signup[captcha:1]" /> | ||
</div> | </div> | ||
Line 53: | Line 53: | ||
=== Google reCAPTCHA V2 === | === Google reCAPTCHA V2 === | ||
+ | To setup the Google reCAPTCHA V2 on your join forms, please first [[Google reCAPTCHA|obtain a site key and a secret key from Google]]. | ||
Revision as of 17:25, 7 February 2020
General
You only need to setup CAPTCHA on your join template(s), not your gateway template(s), unless you are using the gateway one step feature. This is ths case regardless of the CAPTCHA style you decide to use.
Styles
Currently NATS supports 2 different styles of CAPTCHA on your join templates.
Image with Letters
To setup the classic CAPTCHA on your join forms, please add the following code to your join template(s) within the main form.
Basic
{if !empty($vars.captcha_required) || !empty($errors.captcha)} <tr> <td colspan="2" style="border:none; text-align: center"> <img src="/captcha_image.php?width=300&height=90" width="300" height="90" /><br /> <strong>Please fill in the text from the image</strong><br /> <input class="join_input" type="text" name="signup[captcha:1]" /> {if !empty($errors.captcha)} <br /> <span>{$errors.captcha}</span> {/if} </td> </tr> {/if}
Stylish
{if !empty($vars.captcha_required) || !empty($errors.captcha)} <fieldset> <legend>CAPTCHA Image</legend> <div class="form_input"> {if $errors.captcha}<div class="join_error">{$errors.captcha}</div>{/if} <img src="/captcha_image.php?width=300&height=90" width="300" height="90" /><br /> <label class="memberinfo">Verefy Text:</label> <input class="join_input" type="text" name="signup[captcha:1]" /> </div> </fieldset> {/if}
You can customize the size of the CAPTCHA by changing the width and height parameters in the <img> tag. Please note that you will need to change the values in the src atrribuite (the url width and height variables) as well as the width and height attributes of the <img> tag.
By default, NATS will store the CAPTCHA value in the ses_captcha session variable. You can change the name of the session variable by adding the following form field to your join template.
<input type="hidden" name="captcha_key" value="some_text">
Given this example, NATS will use the ses_captcha_some_text session variable to store the CAPTCHA value.
Google reCAPTCHA V2
To setup the Google reCAPTCHA V2 on your join forms, please first obtain a site key and a secret key from Google.
Enabling Options
You have a few different options to require CAPTCHA on your join form.
- You can turn on the MEMBER_SIGNUP_USE_CAPTCHA setting on the configuration -> surfer page in the signup form section. Enabling this setting will require CAPTCHA verification for all join pages for all sites and tours. If this setting is enabled, it will override all of the options below.
- You can turn on the 'Member CAPTCHA' setting on sites -> site management -> <select site> -> tours -> <select tour> page. Enabing this setting will require CAPTCHA verification for all join pages for the given site and tour. Please note this additional site tours do not inherit this setting. If this setting is enabled, it will override the final option below.
- You can set the values for the MEMBER_RETRY_CAPTCHA (X) and the MEMBER_RETRY_CAPTCHA_HOURS (Y) on the configuration surfer page in the signup form section. Enabling this setting will require CAPTCHA verification for all join pages for all tours of the given site and the given ip address once there are X (or more) never joined member records that were created within Y hours.