You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/security/captchas.md
+30-16Lines changed: 30 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,42 +11,56 @@
11
11
12
12
[TOC]
13
13
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.
15
15
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.
17
21
18
22
In ExpressionEngine, CAPTCHAs can be used in several places:
-[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)
27
28
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.
29
32
30
33
## Comment Forms
31
34
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).
33
36
34
37
## Member Registration Form
35
38
36
39
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).
37
40
38
41
## Contact and Tell-a-Friend Email Forms
39
42
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).
41
48
42
49
## CAPTCHA Code
43
50
51
+
This is the code for Comment forms, Contact forms, and Channel Entry forms.
52
+
44
53
{if captcha}
45
54
<p>Please enter the word you see in the image below:</p>
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)
50
64
51
65
The code used inside the Member Registration Form is very similar, with only the omission of the {captcha_word} variable:
52
66
@@ -56,7 +70,7 @@ The code used inside the Member Registration Form is very similar, with only the
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.
60
74
61
75
{if captcha}
62
76
{captcha}
@@ -72,7 +86,7 @@ For ExpressionEngine installations that power multiple domains or subdomains, yo
72
86
73
87
## CAPTCHA Words
74
88
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:
0 commit comments