HTML_QuickForm2_Captcha
[ class tree: HTML_QuickForm2_Captcha ] [ index: HTML_QuickForm2_Captcha ] [ all elements ]

Class: HTML_QuickForm2_Element_Captcha_Image

Source Location: /HTML_QuickForm2_Captcha-0.1.2/HTML/QuickForm2/Element/Captcha/Image.php

Class Overview

HTML_QuickForm2_Element_Input
   |
   --HTML_QuickForm2_Element_Captcha
      |
      --HTML_QuickForm2_Element_Captcha_TextCAPTCHA
         |
         --HTML_QuickForm2_Element_Captcha_Image

Image captcha element for HTML_QuickForm2.


Author(s):

Version:

  • Release: 0.1.2

Variables

Methods


Inherited Variables

Inherited Methods

Class: HTML_QuickForm2_Element_Captcha_TextCAPTCHA

HTML_QuickForm2_Element_Captcha_TextCAPTCHA::__construct()
Constructor. Set adapter specific data attributes.
HTML_QuickForm2_Element_Captcha_TextCAPTCHA::generateCaptcha()
Generates the captcha question and answer and prepares the session data.
HTML_QuickForm2_Element_Captcha_TextCAPTCHA::getAdapter()
Return the Text_CAPTCHA adapter
HTML_QuickForm2_Element_Captcha_TextCAPTCHA::getCaptchaHtml()
Returns the HTML for the captcha question and answer.
HTML_QuickForm2_Element_Captcha_TextCAPTCHA::getFrozenHtml()
Returns the HTML code when the form is frozen.
HTML_QuickForm2_Element_Captcha_TextCAPTCHA::loadAdapter()
Load the adapter instance
HTML_QuickForm2_Element_Captcha_TextCAPTCHA::renderQuestion()
Renders the CAPTCHA question in HTML and returns it.
HTML_QuickForm2_Element_Captcha_TextCAPTCHA::setAdapter()
Set the captcha generator
HTML_QuickForm2_Element_Captcha_TextCAPTCHA::verifyCaptcha()
Checks if the captcha is solved now.

Class: HTML_QuickForm2_Element_Captcha

HTML_QuickForm2_Element_Captcha::__construct()
Create new instance.
HTML_QuickForm2_Element_Captcha::clearCaptchaSession()
Destroys all captcha session data, so that the previously solved captcha re-appears as unsolved. Question and answers are discarded as well.
HTML_QuickForm2_Element_Captcha::generateCaptcha()
Prepares the session data for the captcha.
HTML_QuickForm2_Element_Captcha::getCaptchaHtml()
Returns the HTML for the captcha (question + input element if applicable)
HTML_QuickForm2_Element_Captcha::getSession()
Returns the captcha session object
HTML_QuickForm2_Element_Captcha::getSessionVarName()
Returns the name to use for the session variable.
HTML_QuickForm2_Element_Captcha::getType()
Returns the CAPTCHA type.
HTML_QuickForm2_Element_Captcha::getValue()
Returns the captcha answer input element value.
HTML_QuickForm2_Element_Captcha::setSession()
Sets a new session object.
HTML_QuickForm2_Element_Captcha::setValue()
Sets the input value
HTML_QuickForm2_Element_Captcha::validate()
Performs the server-side validation.
HTML_QuickForm2_Element_Captcha::verifyCaptcha()
Checks if the captcha is solved now.
HTML_QuickForm2_Element_Captcha::__toString()
Renders the captcha into a HTML string

Class Details

[line 29]
Image captcha element for HTML_QuickForm2.

Displays an captcha rendered as image. Some obfuscation is applied to the image.



[ Top ]


Class Variables

$imageDir =  null

[line 37]

Image cache path.
  • Access: protected

Type:   string


[ Top ]

$imageDirUrl =  null

[line 44]

URL to cache path.
  • Access: protected

Type:   string


[ Top ]

$imageSuffix =  '.png'

[line 51]

Image cache path.
  • Access: protected

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 78]

HTML_QuickForm2_Element_Captcha_Image __construct( [string $name = null], [mixed $attributes = null], [array $data = array()])

Set adapter specific data attributes.

Special $data attributes:

  • imageDir - Full path to captcha image storage directory
  • imageDirUrl - URL-based path to captcha image storage directory
  • output - Image format ("png", "jpg", "gif", "resource")
  • width - Image width
  • height - Image height
  • phrase - Pre-defined captcha answer
  • phraseOptions - Array of options for Text_Password
  • imageOptions: array( font_size font_path font_file text_color background_color lines_color antialias )

  • Access: public

Overrides HTML_QuickForm2_Element_Captcha_TextCAPTCHA::__construct() (Constructor. Set adapter specific data attributes.)

Parameters:

string   $name     Element name
mixed   $attributes     Attributes (either a string or an array)
array   $data     Element data (special captcha settings)

[ Top ]

fixPath   [line 113]

string fixPath( string $path)

Fix trailing slashes of path.
  • Access: protected

Parameters:

string   $path     Path to fix

[ Top ]

garbageCollection   [line 190]

void garbageCollection( )

Remove old files from image directory.
  • Access: protected

[ Top ]

generateCaptcha   [line 125]

boolean generateCaptcha( )

Generates the captcha question and answer and prepares the session data.
  • Return: TRUE when the captcha has been created newly, FALSE if it already existed.
  • Access: protected

Overrides HTML_QuickForm2_Element_Captcha_TextCAPTCHA::generateCaptcha() (Generates the captcha question and answer and prepares the session data.)
[ Top ]

renderQuestion   [line 164]

string renderQuestion( )

Renders the CAPTCHA question in HTML and returns it.

Returns empty string when "captchaRender" option is false.

  • Return: HTML
  • Access: protected

Overrides HTML_QuickForm2_Element_Captcha_TextCAPTCHA::renderQuestion() (Renders the CAPTCHA question in HTML and returns it.)
[ Top ]


Documentation generated on Mon, 04 Nov 2013 14:00:06 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.