Extension:VisualMathCaptcha
|
VisualMathCaptcha Release status: stable |
|||
|---|---|---|---|
![]() |
|||
| Implementation | Special page | ||
| Description | Visual (image) and math captcha | ||
| Author(s) | Cchanteptalk | ||
| Last version | 1.0-SNAPSHOT | ||
| MediaWiki | 1.11.x-1.16.0 | ||
| License | No license specified | ||
| Download | here | ||
| Example | example 1, example 2 |
||
|
|||
| Check usage and version matrix | |||
VisualMathCaptcha extension gives your wiki a moderately strong captcha with a math operation generated as image.
Contents |
Installation [edit]
This extension requires you have GD module for PHP.
Download VisualMathExtension from here.
To install this extension, add the following to LocalSettings.php:
require_once( "$IP/extensions/VisualMathCaptcha/VisualMathCaptcha.setup.php" );
Configuration parameters [edit]
- $wgVisualMathCaptchaItemMax : [int] max value (included) for each number in operation ; Defaulted to 9. Needs to be increased as a trivial single-digit challenge will let 10% of the spam through.
- $wgVisualMathCaptchaItemNum : [int] count of number in generated operator; Defaulted to 2.
- $wgVisualMathCaptchaOperators : [array] operators allowed for generation; Defaulted to { '+', '-' }.
To adjust the minimum/maximum brightness of both the text characters and the random background, one must edit VisualMathCaptcha.body.php as these are not assigned parameters. The $bgCol = imagecolorallocate(...) and $txtCol = imagecolorallocate(...) lines control background and text colour, respectively.
The last three parameters of each contain a random function for brightness, where each controls one primary colour. The maximum range of each must be within 0 to 255, so (for example) rand(0,255) would allow any random intensity, rand(0,127) would be between black and grey, rand(128,255) between grey and white.
Adjust the foreground and background intensity to the lowest contrast which is still human-readable.
With other extensions [edit]
With ConfirmEdit [edit]
This captcha can be used instead of standard captcha of ConfirmEdit extension. To do so :
- Open ConfirmEdit.php, in ConfirmEdit extension directory, and change $wgCaptchaClass value to VisualMathConfirmCaptcha.
- Add following line in LocalSettings.php, after content copied from provided file LocalSettings.part :
$wgAutoloadClasses['VisualMathConfirmCaptcha'] = "$IP/extensions/VisualMathCaptcha/VisualMathConfirmCaptcha.class.php";
With Lockdown extension [edit]
VisualMathCaptcha uses a special page: SpecialPage:VisualMathCaptcha.
Add in LocalSettings.php
$wgSpecialPageLockdown['VisualMathCaptcha'] = array('*');
With CorporateContact [edit]
- VisualMathCaptcha can be used with CorporateContact.
