MediaWiki REL1_34
|
Demo CAPTCHA (not for production usage) and base class for real CAPTCHAs. More...
Public Member Functions | |
addFormInformationToOutput (OutputPage $out, array $formInformation) | |
Processes the given $formInformation array and adds the options (see getFormInformation()) to the given OutputPage object. | |
addFormToOutput (OutputPage $out, $tabIndex=1) | |
Uses getFormInformation() to get the CAPTCHA form and adds it to the given OutputPage object. | |
apiGetAllowedParams (&$module, &$params, $flags) | |
canSkipCaptcha ( $user, Config $config) | |
Check whether the user provided / IP making the request is allowed to skip captchas. | |
captchaTriggers ( $title, $action) | |
clearCaptcha ( $index) | |
Clear out existing captcha info from the session, to ensure it can't be reused. | |
confirmEditMerged ( $context, $content, $status, $summary, $user, $minorEdit) | |
An efficient edit filter callback based on the text after section merging. | |
confirmEmailUser ( $from, $to, $subject, $text, &$error) | |
Check the captcha on Special:EmailUser. | |
createAuthenticationRequest () | |
describeCaptchaType () | |
Describes the captcha type for API clients. | |
editShowCaptcha ( $editPage) | |
Insert the captcha prompt into an edit form. | |
getCaptcha () | |
Returns an array with 'question' and 'answer' keys. | |
getCaptchaInfo ( $captchaData, $id) | |
getError () | |
Return the error from the last passCaptcha* call. | |
getFormInformation ( $tabIndex=1) | |
Insert a captcha prompt into the edit form. | |
getMessage ( $action) | |
Show a message asking the user to enter a captcha on edit The result will be treated as wiki text. | |
increaseBadLoginCounter ( $username) | |
Increase bad login counter after a failed login. | |
injectEmailUser (&$form) | |
Inject whazawhoo @fixme if multiple thingies insert a header, could break. | |
isBadLoginPerUserTriggered ( $u) | |
Is the per-user captcha triggered? | |
isBadLoginTriggered () | |
Check if a bad login has already been registered for this IP address. | |
needCreateAccountCaptcha (User $creatingUser=null) | |
Logic to check if we need to pass a captcha for the current user to create a new account, or not. | |
onAuthChangeFormFields (array $requests, array $fieldInfo, array &$formDescriptor, $action) | |
Modify the appearance of the captcha field. | |
passCaptchaFromRequest (WebRequest $request, User $user) | |
Given a required captcha run, test form input for correct input on the open session. | |
passCaptchaLimited ( $index, $word, User $user) | |
Checks, if the user reached the amount of false CAPTCHAs and give him some vacation or run self::passCaptcha() and clear counter if correct. | |
passCaptchaLimitedFromRequest (WebRequest $request, User $user) | |
Checks, if the user reached the amount of false CAPTCHAs and give him some vacation or run self::passCaptcha() and clear counter if correct. | |
resetBadLoginCounter ( $username) | |
Reset bad login counter after a successful login. | |
retrieveCaptcha ( $index) | |
Fetch this session's captcha info. | |
setAction ( $action) | |
setTrigger ( $trigger) | |
shouldCheck (WikiPage $page, $content, $section, $context, $oldtext=null) | |
showEditFormFields (&$editPage, &$out) | |
Show error message for missing or incorrect captcha on EditPage. | |
showHelp () | |
Show a page explaining what this wacky thing is. | |
storeCaptcha ( $info) | |
Generate a captcha session ID and save the info in PHP's session storage. | |
triggersCaptcha ( $action, $title=null) | |
Checks, whether the passed action should trigger a CAPTCHA. | |
Protected Member Functions | |
addCaptchaAPI (&$resultArr) | |
getCaptchaParamsFromRequest (WebRequest $request) | |
isAPICaptchaModule ( $module) | |
keyMatch ( $answer, $info) | |
Check if the submitted form matches the captcha session data provided by the plugin when the form was generated. | |
log ( $message) | |
Log the status and any triggering info for debugging or statistics. | |
passCaptcha ( $index, $word) | |
Given a required captcha run, test form input for correct input on the open session. | |
Protected Attributes | |
string | $action |
Used to select the right message. | |
string | $trigger |
Used in log messages. | |
Static Protected Attributes | |
static | $messagePrefix = 'captcha-' |
Private Member Functions | |
badLoginKey (BagOStuff $cache) | |
Internal cache key for badlogin checks. | |
badLoginPerUserKey ( $username, BagOStuff $cache) | |
Cache key for badloginPerUser checks. | |
buildRegexes ( $lines) | |
Build regex from whitelist. | |
buildValidIPs (array $input) | |
From a list of unvalidated input, get all the valid IP addresses and IP ranges from it. | |
doConfirmEdit (WikiPage $page, $newtext, $section, IContextSource $context) | |
Backend function for confirmEditMerged() | |
filterLink ( $url) | |
Filter callback function for URL whitelisting. | |
findLinks ( $title, $text) | |
Extract a list of all recognized HTTP links in the text. | |
getLinksFromTracker ( $title) | |
Load external links from the externallinks table. | |
getWikiIPWhitelist (Message $msg) | |
Get the on-wiki IP whitelist stored in [[MediaWiki:Captcha-ip-whitelist]] page from cache if possible. | |
isIPWhitelisted () | |
Check if the current IP is allowed to skip captchas. | |
loadText ( $title, $section, $flags=Revision::READ_LATEST) | |
Retrieve the current version of the page or section being edited... | |
Private Attributes | |
boolean null | $captchaSolved = null |
Was the CAPTCHA already passed and if yes, with which result? | |
Demo CAPTCHA (not for production usage) and base class for real CAPTCHAs.
Definition at line 9 of file SimpleCaptcha.php.
|
protected |
array | &$resultArr |
Reimplemented in FancyCaptcha, MediaWiki\Extensions\ConfirmEdit\hCaptcha\HCaptcha, MathCaptcha, QuestyCaptcha, and ReCaptchaNoCaptcha.
Definition at line 72 of file SimpleCaptcha.php.
References describeCaptchaType(), getCaptcha(), and storeCaptcha().
Referenced by confirmEditMerged().
SimpleCaptcha::addFormInformationToOutput | ( | OutputPage | $out, |
array | $formInformation ) |
Processes the given $formInformation array and adds the options (see getFormInformation()) to the given OutputPage object.
OutputPage | $out | The OutputPage object to which the form should be added |
array | $formInformation |
Definition at line 171 of file SimpleCaptcha.php.
References OutputPage\addHeadItems(), OutputPage\addHTML(), OutputPage\addModules(), and OutputPage\addModuleStyles().
Referenced by addFormToOutput(), and injectEmailUser().
SimpleCaptcha::addFormToOutput | ( | OutputPage | $out, |
$tabIndex = 1 ) |
Uses getFormInformation() to get the CAPTCHA form and adds it to the given OutputPage object.
OutputPage | $out | The OutputPage object to which the form should be added |
int | $tabIndex | See self::getFormInformation |
Definition at line 160 of file SimpleCaptcha.php.
References addFormInformationToOutput(), and getFormInformation().
Referenced by editShowCaptcha(), and showEditFormFields().
SimpleCaptcha::apiGetAllowedParams | ( | & | $module, |
& | $params, | ||
$flags ) |
ApiBase | &$module | |
array | &$params | |
int | $flags |
Reimplemented in ReCaptchaNoCaptcha.
Definition at line 927 of file SimpleCaptcha.php.
References isAPICaptchaModule().
|
private |
Internal cache key for badlogin checks.
BagOStuff | $cache |
Definition at line 434 of file SimpleCaptcha.php.
References $cache, and $wgRequest.
Referenced by increaseBadLoginCounter().
|
private |
Cache key for badloginPerUser checks.
string | $username | |
BagOStuff | $cache |
Definition at line 447 of file SimpleCaptcha.php.
References $cache.
Referenced by increaseBadLoginCounter(), isBadLoginPerUserTriggered(), and resetBadLoginCounter().
|
private |
Build regex from whitelist.
string[] | $lines | string from [[MediaWiki:Captcha-addurl-whitelist]] |
Definition at line 691 of file SimpleCaptcha.php.
References $line, $lines, $matches, and wfDebug().
Referenced by filterLink().
|
private |
From a list of unvalidated input, get all the valid IP addresses and IP ranges from it.
Note that only lines with just the IP address or IP range is considered as valid. Whitespace is allowed but if there is any other character on the line, it's not considered as a valid entry.
string[] | $input |
Definition at line 414 of file SimpleCaptcha.php.
Referenced by getWikiIPWhitelist().
SimpleCaptcha::canSkipCaptcha | ( | $user, | |
Config | $config ) |
Check whether the user provided / IP making the request is allowed to skip captchas.
ConfigException |
Definition at line 1174 of file SimpleCaptcha.php.
References Config\get(), isIPWhitelisted(), and wfDebug().
Referenced by confirmEmailUser(), injectEmailUser(), needCreateAccountCaptcha(), and shouldCheck().
SimpleCaptcha::captchaTriggers | ( | $title, | |
$action ) |
Title | $title | |
string | $action | (edit/create/addurl...) |
Definition at line 477 of file SimpleCaptcha.php.
References $title, and triggersCaptcha().
SimpleCaptcha::clearCaptcha | ( | $index | ) |
Clear out existing captcha info from the session, to ensure it can't be reused.
string | $index |
Definition at line 1077 of file SimpleCaptcha.php.
References CaptchaStore\get().
Referenced by passCaptcha().
SimpleCaptcha::confirmEditMerged | ( | $context, | |
$content, | |||
$status, | |||
$summary, | |||
$user, | |||
$minorEdit ) |
An efficient edit filter callback based on the text after section merging.
RequestContext | $context | |
Content | $content | |
Status | $status | |
string | $summary | |
User | $user | |
bool | $minorEdit |
Definition at line 817 of file SimpleCaptcha.php.
References $content, $context, $title, addCaptchaAPI(), EditPage\AS_HOOK_ERROR_EXPECTED, doConfirmEdit(), and wfDebug().
SimpleCaptcha::confirmEmailUser | ( | $from, | |
$to, | |||
$subject, | |||
$text, | |||
& | $error ) |
Check the captcha on Special:EmailUser.
MailAddress | $from | |
MailAddress | $to | |
string | $subject | |
string | $text | |
string | &$error |
Definition at line 889 of file SimpleCaptcha.php.
References $wgRequest, canSkipCaptcha(), passCaptchaLimitedFromRequest(), CaptchaTriggers\SENDEMAIL, and triggersCaptcha().
SimpleCaptcha::createAuthenticationRequest | ( | ) |
Reimplemented in MediaWiki\Extensions\ConfirmEdit\hCaptcha\HCaptcha, and ReCaptchaNoCaptcha.
Definition at line 1137 of file SimpleCaptcha.php.
References getCaptcha(), and storeCaptcha().
SimpleCaptcha::describeCaptchaType | ( | ) |
Describes the captcha type for API clients.
Reimplemented in FancyCaptcha, MediaWiki\Extensions\ConfirmEdit\hCaptcha\HCaptcha, MathCaptcha, QuestyCaptcha, and ReCaptchaNoCaptcha.
Definition at line 85 of file SimpleCaptcha.php.
Referenced by addCaptchaAPI().
|
private |
Backend function for confirmEditMerged()
WikiPage | $page | |
Content | string | $newtext | |
string | $section | |
IContextSource | $context |
Definition at line 785 of file SimpleCaptcha.php.
References $context, $wgRequest, passCaptchaLimitedFromRequest(), shouldCheck(), and wfDebug().
Referenced by confirmEditMerged().
SimpleCaptcha::editShowCaptcha | ( | $editPage | ) |
Insert the captcha prompt into an edit form.
EditPage | $editPage |
Definition at line 221 of file SimpleCaptcha.php.
References $context, addFormToOutput(), and getMessage().
|
private |
Filter callback function for URL whitelisting.
string | $url | string to check |
Definition at line 660 of file SimpleCaptcha.php.
References $source, buildRegexes(), and wfMessage().
|
private |
Extract a list of all recognized HTTP links in the text.
Title | $title | |
string | $text |
Definition at line 1112 of file SimpleCaptcha.php.
References $title, and $wgParser.
Referenced by shouldCheck().
SimpleCaptcha::getCaptcha | ( | ) |
Returns an array with 'question' and 'answer' keys.
Subclasses might use different structure. Since MW 1.27 all subclasses must implement this method.
Reimplemented in FancyCaptcha, MediaWiki\Extensions\ConfirmEdit\hCaptcha\HCaptcha, MathCaptcha, QuestyCaptcha, and ReCaptchaNoCaptcha.
Definition at line 54 of file SimpleCaptcha.php.
Referenced by addCaptchaAPI(), createAuthenticationRequest(), and getFormInformation().
SimpleCaptcha::getCaptchaInfo | ( | $captchaData, | |
$id ) |
array | $captchaData | Data given by getCaptcha |
string | $id | ID given by storeCaptcha |
Reimplemented in FancyCaptcha, MathCaptcha, QuestyCaptcha, and ReCaptchaNoCaptcha.
Definition at line 194 of file SimpleCaptcha.php.
|
protected |
WebRequest | $request |
Reimplemented in MediaWiki\Extensions\ConfirmEdit\hCaptcha\HCaptcha, and ReCaptchaNoCaptcha.
Definition at line 957 of file SimpleCaptcha.php.
References WebRequest\getVal().
Referenced by passCaptchaFromRequest(), and passCaptchaLimitedFromRequest().
SimpleCaptcha::getError | ( | ) |
Return the error from the last passCaptcha* call.
Not implemented but needed by some child classes.
Reimplemented in MediaWiki\Extensions\ConfirmEdit\hCaptcha\HCaptcha, and ReCaptchaNoCaptcha.
Definition at line 44 of file SimpleCaptcha.php.
Referenced by CaptchaPreAuthenticationProvider\makeError().
SimpleCaptcha::getFormInformation | ( | $tabIndex = 1 | ) |
Insert a captcha prompt into the edit form.
This sample implementation generates a simple arithmetic operation; it would be easy to defeat by machine.
Override this!
It is not guaranteed that the CAPTCHA will load synchronously with the main page content. So you can not rely on registering handlers before page load. E.g.:
NOT SAFE: $( window ).on( 'load', handler ) SAFE: $( handler )
However, if the HTML is loaded dynamically via AJAX, the following order will be used.
headitems => modulestyles + modules => add main HTML to DOM when modulestyles + modules are ready.
int | $tabIndex | Tab index to start from |
Reimplemented in FancyCaptcha, MediaWiki\Extensions\ConfirmEdit\hCaptcha\HCaptcha, MathCaptcha, QuestyCaptcha, and ReCaptchaNoCaptcha.
Definition at line 121 of file SimpleCaptcha.php.
References getCaptcha(), and storeCaptcha().
Referenced by addFormToOutput(), and injectEmailUser().
|
private |
Load external links from the externallinks table.
Title | $title |
Definition at line 764 of file SimpleCaptcha.php.
References $dbr, $res, $title, DB_REPLICA, and wfGetDB().
Referenced by shouldCheck().
SimpleCaptcha::getMessage | ( | $action | ) |
Show a message asking the user to enter a captcha on edit The result will be treated as wiki text.
string | $action | Action being performed |
Reimplemented in MediaWiki\Extensions\ConfirmEdit\hCaptcha\HCaptcha, and ReCaptchaNoCaptcha.
Definition at line 241 of file SimpleCaptcha.php.
References wfMessage().
Referenced by editShowCaptcha(), injectEmailUser(), FancyCaptcha\onAuthChangeFormFields(), and showEditFormFields().
|
private |
Get the on-wiki IP whitelist stored in [[MediaWiki:Captcha-ip-whitelist]] page from cache if possible.
Definition at line 380 of file SimpleCaptcha.php.
References $cache, buildValidIPs(), and Message\plain().
Referenced by isIPWhitelisted().
SimpleCaptcha::increaseBadLoginCounter | ( | $username | ) |
Increase bad login counter after a failed login.
The user might be required to solve a captcha if the count is high.
string | $username | TODO use Throttler |
Definition at line 284 of file SimpleCaptcha.php.
References $cache, CaptchaTriggers\BAD_LOGIN, CaptchaTriggers\BAD_LOGIN_PER_USER, badLoginKey(), badLoginPerUserKey(), and triggersCaptcha().
SimpleCaptcha::injectEmailUser | ( | & | $form | ) |
Inject whazawhoo @fixme if multiple thingies insert a header, could break.
HTMLForm | &$form |
Definition at line 257 of file SimpleCaptcha.php.
References addFormInformationToOutput(), canSkipCaptcha(), getFormInformation(), getMessage(), CaptchaTriggers\SENDEMAIL, and triggersCaptcha().
|
protected |
ApiBase | $module |
Definition at line 917 of file SimpleCaptcha.php.
Referenced by ReCaptchaNoCaptcha\apiGetAllowedParams(), and apiGetAllowedParams().
SimpleCaptcha::isBadLoginPerUserTriggered | ( | $u | ) |
Is the per-user captcha triggered?
Definition at line 331 of file SimpleCaptcha.php.
References $cache, CaptchaTriggers\BAD_LOGIN_PER_USER, badLoginPerUserKey(), and triggersCaptcha().
SimpleCaptcha::isBadLoginTriggered | ( | ) |
Check if a bad login has already been registered for this IP address.
If so, require a captcha.
Definition at line 317 of file SimpleCaptcha.php.
References $cache, CaptchaTriggers\BAD_LOGIN, and triggersCaptcha().
|
private |
Check if the current IP is allowed to skip captchas.
This checks the whitelist from two sources. 1) From the server-side config array $wgCaptchaWhitelistIP 2) From the local [[MediaWiki:Captcha-ip-whitelist]] message
Definition at line 352 of file SimpleCaptcha.php.
References $wgRequest, getWikiIPWhitelist(), and wfMessage().
Referenced by canSkipCaptcha().
|
protected |
Check if the submitted form matches the captcha session data provided by the plugin when the form was generated.
Override this!
string | $answer | |
array | $info |
Reimplemented in FancyCaptcha, MathCaptcha, and QuestyCaptcha.
Definition at line 465 of file SimpleCaptcha.php.
Referenced by passCaptcha().
|
private |
Retrieve the current version of the page or section being edited...
Definition at line 1089 of file SimpleCaptcha.php.
References $content, $title, and $wgParser.
Referenced by shouldCheck().
|
protected |
Log the status and any triggering info for debugging or statistics.
string | $message |
Definition at line 1039 of file SimpleCaptcha.php.
References wfDebugLog().
Referenced by passCaptcha(), and passCaptchaLimited().
SimpleCaptcha::needCreateAccountCaptcha | ( | User | $creatingUser = null | ) |
Logic to check if we need to pass a captcha for the current user to create a new account, or not.
User | null | $creatingUser |
Definition at line 866 of file SimpleCaptcha.php.
References canSkipCaptcha(), CaptchaTriggers\CREATE_ACCOUNT, and triggersCaptcha().
SimpleCaptcha::onAuthChangeFormFields | ( | array | $requests, |
array | $fieldInfo, | ||
array & | $formDescriptor, | ||
$action ) |
Modify the appearance of the captcha field.
AuthenticationRequest[] | $requests | |
array | $fieldInfo | Field description as given by AuthenticationRequest::mergeFieldInfo |
array | &$formDescriptor | A form descriptor suitable for the HTMLForm constructor |
string | $action | One of the AuthManager::ACTION_* constants |
Reimplemented in FancyCaptcha, MediaWiki\Extensions\ConfirmEdit\hCaptcha\HCaptcha, MathCaptcha, QuestyCaptcha, and ReCaptchaNoCaptcha.
Definition at line 1150 of file SimpleCaptcha.php.
|
protected |
Given a required captcha run, test form input for correct input on the open session.
string | $index | Captcha idenitifier |
string | $word | Captcha solution |
Reimplemented in MediaWiki\Extensions\ConfirmEdit\hCaptcha\HCaptcha, ReCaptchaNoCaptcha, and FancyCaptcha.
Definition at line 1009 of file SimpleCaptcha.php.
References clearCaptcha(), keyMatch(), log(), and retrieveCaptcha().
Referenced by passCaptchaFromRequest(), and passCaptchaLimited().
SimpleCaptcha::passCaptchaFromRequest | ( | WebRequest | $request, |
User | $user ) |
Given a required captcha run, test form input for correct input on the open session.
WebRequest | $request | |
User | $user |
Definition at line 997 of file SimpleCaptcha.php.
References getCaptchaParamsFromRequest(), and passCaptcha().
SimpleCaptcha::passCaptchaLimited | ( | $index, | |
$word, | |||
User | $user ) |
Checks, if the user reached the amount of false CAPTCHAs and give him some vacation or run self::passCaptcha() and clear counter if correct.
string | $index | Captcha idenitifier |
string | $word | Captcha solution |
User | $user | User for throttling captcha solving attempts |
Definition at line 973 of file SimpleCaptcha.php.
References log(), passCaptcha(), and User\pingLimiter().
Referenced by passCaptchaLimitedFromRequest(), and CaptchaPreAuthenticationProvider\verifyCaptcha().
SimpleCaptcha::passCaptchaLimitedFromRequest | ( | WebRequest | $request, |
User | $user ) |
Checks, if the user reached the amount of false CAPTCHAs and give him some vacation or run self::passCaptcha() and clear counter if correct.
WebRequest | $request | |
User | $user |
Definition at line 948 of file SimpleCaptcha.php.
References getCaptchaParamsFromRequest(), and passCaptchaLimited().
Referenced by confirmEmailUser(), and doConfirmEdit().
SimpleCaptcha::resetBadLoginCounter | ( | $username | ) |
Reset bad login counter after a successful login.
string | $username |
Definition at line 304 of file SimpleCaptcha.php.
References $cache, CaptchaTriggers\BAD_LOGIN_PER_USER, badLoginPerUserKey(), and triggersCaptcha().
SimpleCaptcha::retrieveCaptcha | ( | $index | ) |
Fetch this session's captcha info.
string | $index |
Reimplemented in MediaWiki\Extensions\ConfirmEdit\hCaptcha\HCaptcha, and ReCaptchaNoCaptcha.
Definition at line 1068 of file SimpleCaptcha.php.
References CaptchaStore\get().
Referenced by FancyCaptcha\passCaptcha(), passCaptcha(), and FancyCaptcha\showImage().
SimpleCaptcha::setAction | ( | $action | ) |
string | $action |
Definition at line 28 of file SimpleCaptcha.php.
SimpleCaptcha::setTrigger | ( | $trigger | ) |
string | $trigger |
Definition at line 35 of file SimpleCaptcha.php.
SimpleCaptcha::shouldCheck | ( | WikiPage | $page, |
$content, | |||
$section, | |||
$context, | |||
$oldtext = null ) |
WikiPage | $page | |
Content | string | $content | |
string | $section | |
IContextSource | $context | |
string | null | $oldtext | The content of the revision prior to $content When null this will be loaded from the database. |
Definition at line 525 of file SimpleCaptcha.php.
References $content, $context, $title, canSkipCaptcha(), CONTENT_MODEL_WIKITEXT, findLinks(), getLinksFromTracker(), WikiPage\getTitle(), loadText(), WikiPage\prepareContentForEdit(), triggersCaptcha(), and wfDebug().
Referenced by doConfirmEdit().
SimpleCaptcha::showEditFormFields | ( | & | $editPage, |
& | $out ) |
Show error message for missing or incorrect captcha on EditPage.
EditPage | &$editPage | |
OutputPage | &$out |
Definition at line 203 of file SimpleCaptcha.php.
References addFormToOutput(), and getMessage().
SimpleCaptcha::showHelp | ( | ) |
Show a page explaining what this wacky thing is.
Reimplemented in QuestyCaptcha.
Definition at line 1125 of file SimpleCaptcha.php.
References $wgOut, CaptchaStore\get(), and wfMessage().
SimpleCaptcha::storeCaptcha | ( | $info | ) |
Generate a captcha session ID and save the info in PHP's session storage.
(Requires the user to have cookies enabled to get through the captcha.)
A random ID is used so legit users can make edits in multiple tabs or windows without being unnecessarily hobbled by a serial order requirement. Pass the returned id value into the edit form as wpCaptchaId.
array | $info | data to store |
Reimplemented in MediaWiki\Extensions\ConfirmEdit\hCaptcha\HCaptcha, and ReCaptchaNoCaptcha.
Definition at line 1054 of file SimpleCaptcha.php.
References CaptchaStore\get().
Referenced by FancyCaptcha\addCaptchaAPI(), MathCaptcha\addCaptchaAPI(), QuestyCaptcha\addCaptchaAPI(), addCaptchaAPI(), createAuthenticationRequest(), FancyCaptcha\getFormInformation(), MathCaptcha\getFormInformation(), QuestyCaptcha\getFormInformation(), getFormInformation(), and FancyCaptcha\showImage().
SimpleCaptcha::triggersCaptcha | ( | $action, | |
$title = null ) |
Checks, whether the passed action should trigger a CAPTCHA.
The optional $title parameter will be used to check namespace specific CAPTCHA triggers.
string | $action | The CAPTCHA trigger to check (see CaptchaTriggers for ConfirmEdit built-in triggers) |
Title | null | $title | An optional Title object, if the namespace specific triggers should be checked, too. |
Definition at line 491 of file SimpleCaptcha.php.
References $title, and CaptchaTriggers\EXT_REG_ATTRIBUTE_NAME.
Referenced by captchaTriggers(), confirmEmailUser(), increaseBadLoginCounter(), injectEmailUser(), isBadLoginPerUserTriggered(), isBadLoginTriggered(), needCreateAccountCaptcha(), resetBadLoginCounter(), and shouldCheck().
|
protected |
Used to select the right message.
One of sendmail, createaccount, badlogin, edit, create, addurl.
Definition at line 20 of file SimpleCaptcha.php.
Referenced by MediaWiki\Extensions\ConfirmEdit\hCaptcha\HCaptcha\getMessage(), ReCaptchaNoCaptcha\getMessage(), and FancyCaptcha\onAuthChangeFormFields().
|
private |
Was the CAPTCHA already passed and if yes, with which result?
Definition at line 13 of file SimpleCaptcha.php.
|
staticprotected |
Definition at line 10 of file SimpleCaptcha.php.
|
protected |
Used in log messages.
Definition at line 23 of file SimpleCaptcha.php.