libraries/drivers/Captcha/Riddle – Kohana API 2.3 Documentation

system/libraries/drivers/Captcha/Riddle.php

Class: Captcha_Riddle_Driver

class Captcha_Riddle_Driver extends Captcha_Driver

Captcha driver for "riddle" style.


Methods

Captcha_Riddle_Driver -> generate_challenge

public function generate_challenge

Generates a new Captcha challenge.

Return: string the challenge answer


Captcha_Riddle_Driver -> render

public function render

Outputs the Captcha riddle.

Parameters:

boolean html
html output

Return: mixed


Captcha_Riddle_Driver -> __construct

public function __construct

Constructs a new challenge.

Return: void


Captcha_Riddle_Driver -> update_response_session

public function update_response_session

Stores the response for the current Captcha challenge in a session so it is available on the next page load for Captcha::valid(). This method is called after controller execution (in the system.post_controller event) in order not to overwrite itself too soon.

Return: void


Captcha_Riddle_Driver -> valid

public function valid

Validates a Captcha response from a user.

Parameters:

string response
captcha response

Return: boolean


Captcha_Riddle_Driver -> image_type

public function image_type

Returns the image type.

Parameters:

string filename
filename

Return: string or FALSE image type ("png", "gif" or "jpeg")


Captcha_Riddle_Driver -> image_create

public function image_create

Creates an image resource with the dimensions specified in config. If a background image is supplied, the image dimensions are used.

Parameters:

string background
(NULL) path to the background image file

Throws: Kohana_Exception if no GD2 support

Return: void


Captcha_Riddle_Driver -> image_gradient

public function image_gradient

Fills the background with a gradient.

Parameters:

resource color1
gd image color identifier for start color
resource color2
gd image color identifier for end color
string direction
(NULL) direction: 'horizontal' or 'vertical', 'random' by default

Return: void


Captcha_Riddle_Driver -> image_render

public function image_render

Returns the img html element or outputs the image to the browser.

Parameters:

boolean html
html output

Return: mixed html string or void