Skip to content

Commit a2d55a0

Browse files
authored
Update captchas.md
General improvements to the captcha docs.
1 parent d4bd820 commit a2d55a0

File tree

1 file changed

+30
-16
lines changed

1 file changed

+30
-16
lines changed

docs/security/captchas.md

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,56 @@
1111

1212
[TOC]
1313

14-
ExpressionEngine supports what are known as "CAPTCHAs", or Completely Automated Public Turing tests to tell Computers and Humans Apart. A CAPTCHA is a computer-generated test that humans can easily pass, but that is computationally difficult for a computer to do.
14+
A CAPTCHA, as a general concept, is a computer-generated test that humans can easily pass, but that is computationally difficult for a computer to do. They are used when you want to ensure that a human is performing an action, not an automated script -- often to block spam.
1515

16-
So how does this work? An image is generated in real time for a user loading a web page. This image contains a word that the user must enter in a form. The concept is effective because computers are generally not very good at reading images, but it is something humans can do with little effort.
16+
ExpressionEngine has built-in support for CAPTCHAs (Completely Automated Public Turing tests to tell Computers and Humans Apart), and can also use (Google's reCAPTCHA v3)[https://cloud.google.com/security/products/recaptcha].
17+
18+
So how does the built-in CAPTCHA functionality work?
19+
20+
When a user loads a web page with a form protected by a CAPTCHA, EE generates a unique image in real time. This image contains a word that the user must enter when they submit a form. The CAPTCHA is effective because computers are generally not very good at reading images, but it is something humans can do with little effort.
1721

1822
In ExpressionEngine, CAPTCHAs can be used in several places:
1923

20-
- [CAPTCHAs](#captchas)
21-
- [Comment Forms](#comment-forms)
22-
- [Member Registration Form](#member-registration-form)
23-
- [Contact and Tell-a-Friend Email Forms](#contact-and-tell-a-friend-email-forms)
24-
- [CAPTCHA Code](#captcha-code)
25-
- [Notes](#notes)
26-
- [CAPTCHA Words](#captcha-words)
24+
- [To submit a comment](#comment-forms)
25+
- [To register a new member](#member-registration-form)
26+
- [In the Contact and Tell-a-Friend email forms](#contact-and-tell-a-friend-email-forms)
27+
- [In Channel Forms](#channel-forms)
2728

28-
The settings to require CAPTCHAs for these forms are located at `Settings --> CAPTCHA` in the control panel.
29+
The settings to require CAPTCHAs for these forms are located at [`Settings --> CAPTCHA`](control-panel/settings/captcha.md) in the control panel.
30+
31+
The CAPTCHA settings are applied site-wide. If other add-ons allow the use of captchas, they will also be controlled by the same settings.
2932

3033
## Comment Forms
3134

32-
Once you have the preference turned on, you'll need to add the CAPTCHA code to your [Comment Submission Form](comment/form.md). See below for the [CAPTCHA Code](#captcha-code).
35+
If you have the setting turned on, you'll need to add the CAPTCHA code to your [Comment Submission Form](comment/form.md). See below for the [CAPTCHA Code](#captcha-code).
3336

3437
## Member Registration Form
3538

3639
The necessary CAPTCHA code already exists in the Member Templates by default, so you should not need to add it. If you have a version of ExpressionEngine from before the CAPTCHA feature was added or if you otherwise need the code, see below for the [CAPTCHA Code](#captcha-code).
3740

3841
## Contact and Tell-a-Friend Email Forms
3942

40-
Once you have the preference turned on, you'll need to add the CAPTCHA code. See below for the [CAPTCHA Code](#captcha-code).
43+
If you have the setting turned on, you'll need to add the CAPTCHA code to the form. See below for the [CAPTCHA Code](#captcha-code).
44+
45+
## Channel Forms
46+
47+
If you have the setting turned on, you'll need to add the CAPTCHA code to your [Channel Entry Form](channels/channel-form/overview.md#captcha). See below for the [CAPTCHA Code](#captcha-code).
4148

4249
## CAPTCHA Code
4350

51+
This is the code for Comment forms, Contact forms, and Channel Entry forms.
52+
4453
{if captcha}
4554
<p>Please enter the word you see in the image below:</p>
46-
<p>{captcha}<br /> <input type="text" name="captcha" value="{captcha_word}" size="20" maxlength="20" style="width:140px;" /></p>
55+
<p>{captcha}<br />
56+
<input type="text" name="captcha" value="{captcha_word}" size="20" maxlength="20" style="width:140px;" /></p>
4757
{/if}
4858

49-
The contents of the conditional {if captcha} tag will only appear if you have the CAPTCHA preference turned on for either the comment or member registration forms.
59+
The contents of the conditional `{if captcha}` tag will appear if you:
60+
61+
- have the CAPTCHA setting turned on
62+
- are not logged in as a superadmin (Superadmins never have to pass a CAPTCHA test)
63+
- are using the built-in CAPTCHA (Google's reCAPTCHA v3 does not display anything)
5064

5165
The code used inside the Member Registration Form is very similar, with only the omission of the {captcha_word} variable:
5266

@@ -56,7 +70,7 @@ The code used inside the Member Registration Form is very similar, with only the
5670
<input type="text" name="captcha" value="" size="20" maxlength="20" style="width:140px;" /></p>
5771
{/if}
5872

59-
If using using [reCAPTCHA v3](security/captchas.md), use a simplified tag that will output the required javascript, with the CAPTCHA otherwise invisible.
73+
If using using [reCAPTCHA v3](security/captchas.md), use this simplified code. It will output the required javascript with the CAPTCHA being otherwise invisible.
6074

6175
{if captcha}
6276
{captcha}
@@ -72,7 +86,7 @@ For ExpressionEngine installations that power multiple domains or subdomains, yo
7286

7387
## CAPTCHA Words
7488

75-
The CAPTCHA system uses a default dictionary. You can override these by adding a special user config file and returning an array of words you want to use instead. Create a PHP file at `system/user/config/captcha.php` with the format:
89+
The CAPTCHA system uses a default dictionary. You can override these by adding a special user config file that returns an array of words you want to use instead. Create a PHP file at `system/user/config/captcha.php` with the format:
7690

7791
<?php
7892

0 commit comments

Comments
 (0)