Statusstub
TodoWrite me

Captcha Library

Captchas are used to protect your site by showing something that a computer can't recognize but a human can. They are usually placed on your registration page but they can be placed anywhere you want to make reasonably sure you are dealing with a person and not a bot.

Kohana's Captcha library can currently generates basic, alpha, word, math, riddle captchas. Captcha configuration is defined in groups which allows you to easily switch between different Captcha settings for different forms on your website.

Configuration

Configuration is done in the application/config/captcha.php file, if it's not there take the one from system/config and copy it to the application folder (see cascading filesystem):

$config['default'] = array
(
    'style'      => 'basic',
    'width'      => 150,
    'height'     => 50,
    'complexity' => 4,
    'background' => '',
    'fontpath'   => SYSPATH.'fonts/',
    'fonts'      => array('DejaVuSerif.ttf'),
    'promote'    => FALSE,
);

Note: all groups inherit and overwrite the default group.

Styles

style defines the captcha type, e.g. basic, alpha, word, math, riddle. There are 5 different drivers:

Picture height and width

For basic and alpha styles drawing a picture, height and width define the size of the picture.

Complexity

It defines the difficulty level of the generated captcha. Usage depends on chosen style:

Background

background is the path to background image file used for basic and alpha Captcha

Fonts

fontpath is the font file used for basic and alpha Captcha. fonts is an array of font files. Several fonts means that characters have randomized fonts choosen in the array.

Promote

promote is a valid response count threshold to promote user (FALSE to disable)

libraries/captcha.txt · Last modified: 2008/08/21 08:13 by spirit