Extension:VisualMathCaptcha

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png
VisualMathCaptcha

Release status: unmaintained

Special VisualMathCaptcha.png
Implementation Special page
Description Visual (image) and math captcha
Author(s) Cchanteptalk
Latest version 1.0-SNAPSHOT
MediaWiki 1.11.x-1.16.0
License No license specified
Download here
Example example 1,
example 2
Parameters

$wgVisualMathCaptchaItemMax, $wgVisualMathCaptchaItemNum, $wgVisualMathCaptchaOperators

Translate the VisualMathCaptcha extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

VisualMathCaptcha extension gives your wiki a moderately strong captcha with a math operation generated as image.

Installation[edit | edit source]

This extension requires you have GD module for PHP.

Download VisualMathExtension from here (this is not a direct link; extension can't be located by clicking this link).

To install this extension, add the following to LocalSettings.php:

require_once( "$IP/extensions/VisualMathCaptcha/VisualMathCaptcha.setup.php" );

Configuration parameters[edit | edit source]

  • $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 | edit source]

With ConfirmEdit[edit | edit source]

This captcha can be used instead of standard captcha of ConfirmEdit extension. To do so :

  1. Open ConfirmEdit.php, in ConfirmEdit extension directory, and change $wgCaptchaClass value to VisualMathConfirmCaptcha.
  2. 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 | edit source]

VisualMathCaptcha uses a special page: SpecialPage:VisualMathCaptcha.

Add in LocalSettings.php

$wgSpecialPageLockdown['VisualMathCaptcha'] = array('*');

With CorporateContact[edit | edit source]