Difference between revisions of "NATS5 Join Page CAPTCHA"

From TMM Wiki
Jump to navigationJump to search
 
(12 intermediate revisions by 3 users not shown)
Line 13: Line 13:
 
Basic
 
Basic
 
<pre>
 
<pre>
{if (!empty($vars.captcha_required) || !empty($errors.captcha)) && (($smarty.config.MEMBER_SIGNUP_CAPTCHA_STYLE == 1))}
+
{if ((!empty($vars.captcha_required) || !empty($errors.captcha)) && ($config.MEMBER_SIGNUP_CAPTCHA_STYLE == 1))}
 
<tr>
 
<tr>
 
<td colspan="2" style="border:none; text-align: center">
 
<td colspan="2" style="border:none; text-align: center">
Line 19: Line 19:
 
<strong>Please fill in the text from the image</strong><br />
 
<strong>Please fill in the text from the image</strong><br />
 
<input class="join_input" type="text" name="signup[captcha:1]" />
 
<input class="join_input" type="text" name="signup[captcha:1]" />
 
 
{if !empty($errors.captcha)}
 
{if !empty($errors.captcha)}
 
<br />
 
<br />
Line 31: Line 30:
 
Stylish
 
Stylish
 
<pre>
 
<pre>
{if (!empty($vars.captcha_required) || !empty($errors.captcha)) && (($smarty.config.MEMBER_SIGNUP_CAPTCHA_STYLE == 1))}
+
{if ((!empty($vars.captcha_required) || !empty($errors.captcha)) && ($config.MEMBER_SIGNUP_CAPTCHA_STYLE == 1))}
 
<fieldset>
 
<fieldset>
<legend>CAPTCHA Image</legend>
+
<legend>Verification</legend>
 
<div class="form_input">
 
<div class="form_input">
 
{if !empty($errors.captcha)}<div class="join_error">{$errors.captcha}</div>{/if}
 
{if !empty($errors.captcha)}<div class="join_error">{$errors.captcha}</div>{/if}
Line 57: Line 56:
 
Please add the following code to your join template(s) (if not present already) between the <head>...</head> tags
 
Please add the following code to your join template(s) (if not present already) between the <head>...</head> tags
 
<pre>
 
<pre>
{if (!empty($vars.captcha_required)) && ($smarty.config.MEMBER_SIGNUP_CAPTCHA_STYLE == 2)}<script src="https://www.google.com/recaptcha/api.js" async defer></script>{/if}
+
{if (!empty($vars.captcha_required) && ($config.MEMBER_SIGNUP_CAPTCHA_STYLE == 2))}<script src="https://www.google.com/recaptcha/api.js" async defer></script>{/if}
 
</pre>
 
</pre>
  
 
Please add the following code to your join template(s) (if not present already) within the main form (between the <form>...</form> tags).
 
Please add the following code to your join template(s) (if not present already) within the main form (between the <form>...</form> tags).
 
<pre>
 
<pre>
{if (!empty($vars.captcha_required) || !empty($errors.captcha)) && (($smarty.config.MEMBER_SIGNUP_CAPTCHA_STYLE == 2))}
+
{if ((!empty($vars.captcha_required) || !empty($errors.captcha)) && ($config.MEMBER_SIGNUP_CAPTCHA_STYLE == 2))}
 
<fieldset>
 
<fieldset>
 
<legend>Verification</legend>
 
<legend>Verification</legend>
 
<div class="option-padding">
 
<div class="option-padding">
 
{if !empty($errors.captcha)}<div class="join_error">{$errors.captcha}</div>{/if}
 
{if !empty($errors.captcha)}<div class="join_error">{$errors.captcha}</div>{/if}
<div class="g-recaptcha" data-sitekey="{$config.MEMBER_SIGNUP_GOOGLE_RECAPTCHA_KEY}"></div>
+
<div class="g-recaptcha" style="width: 304px; margin: 0 auto" data-sitekey="{$config.MEMBER_SIGNUP_GOOGLE_RECAPTCHA_KEY}"></div>
 
</div>
 
</div>
 
</fieldset>
 
</fieldset>
 
{/if}
 
{/if}
 
</pre>
 
</pre>
 
+
 
 +
==== NATS Special Options ====
 +
To use Google reCAPTCHA v2 with any special options, you will need to add additional jquery code to your $(document).ready() function.<br>
 +
This example is designed so only one recaptcha field is required on your template, and have the recaptcha work for both normal join option form & special option form.
 +
 
 +
<pre>
 +
{literal}
 +
$("#specialSignupform").submit(function(){
 +
var g_recaptcha = $('#signupform [name=g-recaptcha-response]').val();
 +
$('#specialSignupform').append("<input type='hidden' name='g-recaptcha-response' value='" + g_recaptcha + "'>");
 +
});
 +
{/literal}
 +
</pre>
 +
 
 +
 
 +
 
 +
This will also require updating your template's forms to include an id:<br>
 +
normal form section from (if not already set):
 +
<pre>
 +
<body>
 +
<div id="container">
 +
<div id="form">
 +
<form action="signup.php">
 +
</pre>
 +
 
 +
To:
 +
<pre>
 +
<body>
 +
<div id="container">
 +
<div id="form">
 +
<form id="signupform" action="signup.php">
 +
</pre>
 +
 
 +
special option form section (if not already set):
 +
<pre>
 +
{if $have_special_options}
 +
<br>
 +
<form action="signup.php" method="POST">
 +
</pre>
 +
 
 +
To:
 +
<pre>
 +
{if $have_special_options}
 +
<br>
 +
<form id="specialSignupform" action="signup.php" method="POST">
 +
</pre>
 +
 
 
== Enabling Options ==
 
== Enabling Options ==
 
You have a few different options to require CAPTCHA on your join form.
 
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 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 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 that 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.
 
* 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.

Latest revision as of 13:58, 21 April 2023

NATS 5
Members Section
Members Management
Adding a Member
View Member Details
Restricted Values
OpenID Connect
Mod Auth OpenIDC
    Adtool
GET /adtool/admin
GET /adtool/adtools
GET /adtool/adtool
GET /adtool/adtool-rules
GET /adtool/adtool-rule
GET /adtool/categories
GET /adtool/field-options
GET /adtool/field-types
GET /adtool/groups
GET /adtool/search
GET /adtool/templates
GET /adtool/types
GET /adtool/type
POST /adtool/adtool
POST /adtool/adtool-rule
POST /adtool/category
POST /adtool/field
POST /adtool/field-option
POST /adtool/group
POST /adtool/import
POST /adtool/type
PATCH /adtool/adtool
PATCH /adtool/adtool-group
PATCH /adtool/adtool-rule
PATCH /adtool/category
PATCH /adtool/field
PATCH /adtool/field-option
PATCH /adtool/group
PATCH /adtool/move
PATCH /adtool/restore-adtool
PATCH /adtool/restore-category
PATCH /adtool/restore-field
PATCH /adtool/restore-field-option
PATCH /adtool/restore-type
PATCH /adtool/type
DELETE /adtool/adtool
DELETE /adtool/adtool-rule
DELETE /adtool/category
DELETE /adtool/field
DELETE /adtool/field-option
DELETE /adtool/group
DELETE /adtool/type
    Affiliate
DELETE /affiliate/account-rep
DELETE /affiliate/account-type
DELETE /affiliate/affiliate
DELETE /affiliate/doc
DELETE /affiliate/group
DELETE /affiliate/permissions
GET /affiliate/account-changes
GET /affiliate/account-types
GET /affiliate/admin-settings
GET /affiliate/campaigns
GET /affiliate/current
GET /affiliate/current-permissions
GET /affiliate/docs
GET /affiliate/doc
GET /affiliate/groups
GET /affiliate/group
GET /affiliate/hits
GET /affiliate/link-styles
GET /affiliate/loginids
GET /affiliate/loginlog
GET /affiliate/manual-payout
GET /affiliate/news-sections
GET /affiliate/notes
GET /affiliate/notices
GET /affiliate/override
GET /affiliate/payout
GET /affiliate/payment-periods
GET /affiliate/payvia-types
GET /affiliate/payvia-type
GET /affiliate/permissions
GET /affiliate/programcampaigns
GET /affiliate/referrer
GET /affiliate/referring-urls
GET /affiliate/reps
GET /affiliate/rest-methods
GET /affiliate/search
GET /affiliate/search-limited
GET /affiliate/settings
GET /affiliate/skins
GET /affiliate/soap-functions
GET /affiliate/status
PATCH /affiliate/adminsettings
PATCH /affiliate/account-change
PATCH /affiliate/account-type
PATCH /affiliate/account-type-permissions
PATCH /affiliate/admin-setting
PATCH /affiliate/affiliate-account-type
PATCH /affiliate/affiliate-group
PATCH /affiliate/allsettings
PATCH /affiliate/account-rep
PATCH /affiliate/avatar
PATCH /affiliate/customs
PATCH /affiliate/defaults
PATCH /affiliate/details
PATCH /affiliate/override
PATCH /affiliate/password
PATCH /affiliate/payment-period
PATCH /affiliate/payvia
PATCH /affiliate/payvia-info
PATCH /affiliate/permissions
PATCH /affiliate/referrer
PATCH /affiliate/reset-api
PATCH /affiliate/reset-rss
PATCH /affiliate/reset-tos
PATCH /affiliate/rest-permissions
PATCH /affiliate/restore
PATCH /affiliate/restore-account-type
PATCH /affiliate/settings
PATCH /affiliate/soap-permissions
PATCH /affiliate/status
POST /affiliate/account-type
POST /affiliate/add
POST /affiliate/doc
POST /affiliate/group
POST /affiliate/invoice
POST /affiliate/manual-sale
POST /affiliate/note
    Biller
GET /biller/available
GET /biller/partner-available
GET /biller/billerdata
GET /biller/cascades
GET /biller/cascades-available
GET /biller/cascade-count
GET /biller/cascade-history
GET /biller/cascade-rules
GET /biller/cascade-rule
GET /biller/cascade-step-count
GET /biller/cascade-steps
GET /biller/cascade-detail
GET /biller/cascade-list
GET /biller/count
GET /biller/detail
GET /biller/fees
GET /biller/partner-fees
GET /biller/last_poll
GET /biller/partner-last-poll
GET /biller/list
GET /biller/partner-detail
GET /biller/partner-list
GET /biller/partner-shortnames
GET /biller/process_types
GET /biller/partner-process-types
GET /biller/shortnames
GET /biller/transaction_types
GET /biller/partner-transaction-types
GET /biller/taxes
POST /biller/add
POST /biller/cascade
POST /biller/cascade-rule
POST /biller/cascade-step
POST /biller/partner
PATCH /biller/cascade
PATCH /biller/cascade-rule
PATCH /biller/cascade-step
PATCH /biller/cascade-steps-reorder
PATCH /biller/fee
PATCH /biller/partner-fee
PATCH /biller/restore
PATCH /biller/restore-cascade
PATCH /biller/restore-partner
PATCH /biller/setting
PATCH /biller/partner-setting
PATCH /biller/tax
DELETE /biller/biller
DELETE /biller/cascade
DELETE /biller/cascade-rule
DELETE /biller/cascade-step
DELETE /biller/fee
DELETE /biller/partner-fee
DELETE /biller/partner
DELETE /biller/tax
    Codes
GET /codes/affiliate-codes
GET /codes/decode
GET /codes/linkcodes
GET /codes/strack
    Config
DELETE /config/setting
GET /config/section
GET /config/sections
PATCH /config/affiliate_default
PATCH /config/section
    Include
DELETE /include/include
DELETE /include/step
GET /include/include
GET /include/includes
GET /include/templates
PATCH /include/include
PATCH /include/restore
PATCH /include/step
POST /include/include
POST /include/step
    Mailing
DELETE /mailing/mailing
DELETE /mailing/mailing-rule
DELETE /mailing/queue
GET /mailing/mailing
GET /mailing/mailings
GET /mailing/mailing-rules
GET /mailing/mailing-rule
GET /mailing/queue
GET /mailing/removelist
PATCH /mailing/mailing
PATCH /mailing/mailing-rule
PATCH /mailing/removelist
PATCH /mailing/removelist-queue
PATCH /mailing/resend-queue
PATCH /mailing/restore-queue
PATCH /mailing/send-mailing
PATCH /mailing/send-test-mailing
POST /mailing/mailing
POST /mailing/mailing-rule
POST /mailing/removelist
    Maintenance
DELETE /maintenance/log
DELETE /maintenance/cache
GET /maintenance/admin-actions
GET /maintenance/log
GET /maintenance/logs
GET /maintenance/nats
GET /maintenance/report
GET /maintenance/report-progress
GET /maintenance/reports
GET /maintenance/server
GET /maintenance/table
GET /maintenance/tables
GET /maintenance/table-clean-count
GET /maintenance/table-clean-progress
PATCH /maintenance/log
PATCH /maintenance/report
PATCH /maintenance/table
    Member
GET /member/available_flags
GET /member/encryptusername
GET /member/authstring
GET /member/details
GET /member/flags
GET /member/loginlog
GET /member/matching
GET /member/notes
GET /member/notices
GET /member/restricted-values
GET /member/search
GET /member/suggestedcanceloffers
GET /member/surfer-actions
PATCH /member/details
PATCH /member/expiration
PATCH /member/expiremanual
PATCH /member/resend-transaction-email
PATCH /member/resend-transaction-postback
PATCH /member/restricted-value
PATCH /member/forget
PATCH /member/lock
PATCH /member/unlock
POST /member/flag
POST /member/login
POST /member/note
POST /member/restricted-value
DELETE /member/flag
DELETE /member/restricted-value
    Message
DELETE /message/message
DELETE /message/permanent
GET /message/count
GET /message/messages
GET /message/view
PATCH /message/read
PATCH /message/unread
PATCH /message/undelete
POST /message/message
    News
DELETE /news/entry
DELETE /news/section
GET /news/entry
GET /news/news
GET /news/sections
PATCH /news/entry
POST /news/entry
POST /news/section
    Notification
DELETE /notification/notification
DELETE /notification/permanent
GET /notification/count
GET /notification/notifications
GET /notification/view
PATCH /notification/read
PATCH /notification/unread
PATCH /notification/undelete
    Option
GET /option/options
GET /option/rule
PATCH /option/rule
PATCH /option/text
POST /option/rule
    Payment
DELETE /payment/invoice
DELETE /payment/payout-period
DELETE /payment/payvia-field
DELETE /payment/payvia-field-mc
DELETE /payment/payvia-rule
GET /payment/dump-format
GET /payment/dump-formats
GET /payment/invoices
GET /payment/payments
GET /payment/payment-dumps
GET /payment/payment-dump
GET /payment/payment-search
GET /payment/payvia
GET /payment/payvias
GET /payment/payvia-fields
GET /payment/payvia-field-mcs
GET /payment/payout-period
GET /payment/payout-periods
GET /payment/payvia-rules
GET /payment/payvia-rule
GET /payment/payviarule
PATCH /payment/copy-dump-format
PATCH /payment/default-payout-period
PATCH /payment/dump-format
PATCH /payment/duplicate-payvia
PATCH /payment/invoice
PATCH /payment/payment
PATCH /payment/payment-paid
PATCH /payment/payment-store
PATCH /payment/payment-unstore
PATCH /payment/payments
PATCH /payment/payments-unstore
PATCH /payment/payout-period
PATCH /payment/payout-period-affiliates
PATCH /payment/payvia
PATCH /payment/payvia-field
PATCH /payment/payvia-fields-reorder
PATCH /payment/payvia-field-mc
PATCH /payment/payvia-field-mcs-reorder
PATCH /payment/payvia-rule
PATCH /payment/payviarule
PATCH /payment/restore-payout-period
PATCH /payment/restore-payvia-field
PATCH /payment/restore-payvia-field-mc
POST /payment/check-dump
POST /payment/dump-format
POST /payment/import-dump
POST /payment/invoice
POST /payment/payout-period
POST /payment/payvia
POST /payment/payvia-field
POST /payment/payvia-field-mc
POST /payment/payvia-rule
    Program
DELETE /program/program
DELETE /program/payout-change
DELETE /program/payout-change-tier
GET /program/additional-payout-change-targets
GET /program/affiliate-available
GET /program/detail
GET /program/list
GET /program/options
GET /program/payout-changes
GET /program/redirect-available
GET /program/sites
GET /program/tours
GET /program/types
PATCH /program/default_payout
PATCH /program/details
PATCH /program/disable_affiliate
PATCH /program/disable_tour
PATCH /program/enable_affiliate
PATCH /program/enable_site
PATCH /program/enable_tour
PATCH /program/move-payout-change
PATCH /program/payout-change
PATCH /program/payout-change-tier
POST /program/new
POST /program/payout-change
POST /program/payout-change-tier
    Report
GET /report/affiliate-ratios
GET /report/hits
GET /report/hit-totals
GET /report/profitloss
GET /report/profit-loss
GET /report/fields
GET /report/focus
GET /report/focuses
GET /report/groups
GET /report/perspective
GET /report/perspectives
GET /report/report
GET /report/subscription
GET /report/surfer
GET /report/surferaction
GET /report/transactionpayouts
GET /report/transactions
GET /report/transaction
GET /report/report-widget
GET /report/widgets
GET /report/widget
GET /report/widget-info
GET /report/views
POST /report/focus
POST /report/group
POST /report/perspective
PATCH /report/focus
PATCH /report/focus-enabled
PATCH /report/focus-default
PATCH /report/focuses-reorder
PATCH /report/perspective
PATCH /report/perspective-group
PATCH /report/report-widget
PATCH /report/widget
DELETE /report/focus
    Reward
DELETE /reward/category
DELETE /reward/purchase
DELETE /reward/point
DELETE /reward/reward
GET /reward/categories
GET /reward/points
GET /reward/purchases
GET /reward/rewards
PATCH /reward/move-point
PATCH /reward/point
PATCH /reward/reward
PATCH /reward/ship-purchase
PATCH /reward/unship-purchase
POST /reward/category
POST /reward/point
POST /reward/reward
    Service
GET /service/check-functions
GET /service/condition
GET /service/countries
GET /service/country
GET /service/datetime
GET /service/languages
GET /service/periods
GET /service/ping
GET /service/project
GET /service/rule-condition-data
GET /service/rule-info
GET /service/stats-breakdowns
GET /service/timezone
GET /service/timestamp
POST /service/sendemail
    Site
GET /site/base-templates
GET /site/billers
GET /site/cookies
GET /site/coupon
GET /site/coupons
GET /site/coupon-revisions
GET /site/email-settings
GET /site/groups
GET /site/option
GET /site/options
GET /site/options-available
GET /site/option-fields
GET /site/option-rules
GET /site/option-rule
GET /site/option-type
GET /site/option-types
GET /site/programs
GET /site/redirect
GET /site/redirects
GET /site/redirect-rules
GET /site/redirect-rule
GET /site/site-list
GET /site/site
GET /site/site-notices
GET /site/site-partner
GET /site/site-partners
GET /site/site-type
GET /site/sites
GET /site/template
GET /site/templates
GET /site/template-sections
GET /site/template-sites
GET /site/tour
GET /site/tours
GET /site/tour-emails
GET /site/tour-notices
POST /site/coupon
POST /site/group
POST /site/option
POST /site/option-rule
POST /site/redirect
POST /site/redirect-rule
POST /site/site-partner
POST /site/site-tour
POST /site/copy-template
POST /site/tour
PATCH /site/cookie
PATCH /site/coupon
PATCH /site/duplicate-option
PATCH /site/email-settings
PATCH /site/group
PATCH /site/move
PATCH /site/option
PATCH /site/option-rule
PATCH /site/redirect
PATCH /site/redirect-rule
PATCH /site/reset-coupon
PATCH /site/restore-group
PATCH /site/restore-option
PATCH /site/restore-redirect
PATCH /site/restore-site
PATCH /site/restore-site-partner
PATCH /site/restore-tour
PATCH /site/site
PATCH /site/site-partner
PATCH /site/template
PATCH /site/tour
DELETE /site/cookie
DELETE /site/group
DELETE /site/option
DELETE /site/option-rule
DELETE /site/site
DELETE /site/site-partner
DELETE /site/redirect
DELETE /site/redirect-rule
DELETE /site/template
DELETE /site/tour
DELETE /site/tour-field
    Skin
DELETE /skin/skin
DELETE /skin/template
GET /skin/colors
GET /skin/export
GET /skin/skins
GET /skin/sections
GET /skin/templates
GET /skin/template
PATCH /skin/colors
PATCH /skin/flush
PATCH /skin/skin
PATCH /skin/template
POST /skin/copy-template
POST /skin/import
POST /skin/skin
POST /skin/template

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. You can change the style by setting the 'Member Signup Captcha Style' value on the configuration -> surfer page in the signup form section. The current default is 'Image with Letters' for retroactive support. If you are setting CAPTCHA on your joim templates for the first time, we recommend using the 'Google reCAPCHA V2' option.

Image with Letters

To setup the classic CAPTCHA on your join forms, please add the following code to your join template(s) (if not present already) within the main form (between the <form>...</form> tags).

Basic

{if ((!empty($vars.captcha_required) || !empty($errors.captcha)) && ($config.MEMBER_SIGNUP_CAPTCHA_STYLE == 1))}
	<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)) && ($config.MEMBER_SIGNUP_CAPTCHA_STYLE == 1))}
	<fieldset>
		<legend>Verification</legend>
		<div class="form_input">
			{if !empty($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">Verify 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. Once you have these values, please go to the configuration -> surfer page, scroll down to the signup form section and enter these 2 values into the 'Member Signup Google Recaptcha Key' and the 'Member Signup Google Recaptcha Secret' fields respectively.

Please add the following code to your join template(s) (if not present already) between the <head>...</head> tags

{if (!empty($vars.captcha_required) && ($config.MEMBER_SIGNUP_CAPTCHA_STYLE == 2))}<script src="https://www.google.com/recaptcha/api.js" async defer></script>{/if}

Please add the following code to your join template(s) (if not present already) within the main form (between the <form>...</form> tags).

{if ((!empty($vars.captcha_required) || !empty($errors.captcha)) && ($config.MEMBER_SIGNUP_CAPTCHA_STYLE == 2))}
	<fieldset>
		<legend>Verification</legend>
		<div class="option-padding">
			{if !empty($errors.captcha)}<div class="join_error">{$errors.captcha}</div>{/if}
			<div class="g-recaptcha" style="width: 304px; margin: 0 auto" data-sitekey="{$config.MEMBER_SIGNUP_GOOGLE_RECAPTCHA_KEY}"></div>
		</div>
	</fieldset>
{/if}

NATS Special Options

To use Google reCAPTCHA v2 with any special options, you will need to add additional jquery code to your $(document).ready() function.
This example is designed so only one recaptcha field is required on your template, and have the recaptcha work for both normal join option form & special option form.

{literal}
	$("#specialSignupform").submit(function(){
		var g_recaptcha = $('#signupform [name=g-recaptcha-response]').val();
		$('#specialSignupform').append("<input type='hidden' name='g-recaptcha-response' value='" + g_recaptcha + "'>");
	});
{/literal}


This will also require updating your template's forms to include an id:
normal form section from (if not already set):

<body>
	<div id="container">
		<div id="form">
			<form action="signup.php">

To:

<body>
	<div id="container">
		<div id="form">
			<form id="signupform" action="signup.php">

special option form section (if not already set):

{if $have_special_options}
	<br>
	<form action="signup.php" method="POST">

To:

{if $have_special_options}
	<br>
	<form id="specialSignupform" action="signup.php" method="POST">

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 that 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.