system/libraries/Captcha.php
Class: Captcha_Core
class Captcha_Core
Captcha library.
Methods
- Captcha_Core :: instance
- Captcha_Core -> factory
- Captcha_Core -> __construct
- Captcha_Core :: valid
- Captcha_Core -> valid_count
- Captcha_Core -> invalid_count
- Captcha_Core -> reset_count
- Captcha_Core -> promoted
- Captcha_Core -> render
- Captcha_Core -> __toString
Captcha_Core :: instance
public static function instance
Singleton instance of Captcha.
Return: object
Captcha_Core -> factory
public function factory
Constructs and returns a new Captcha object.
Parameters:
- string group
- (NULL) config group name
Return: object
Captcha_Core -> __construct
public function __construct
Constructs a new Captcha object.
Parameters:
- string group
- (NULL) config group name
Throws: Kohana_Exception
Return: void
Captcha_Core :: valid
public static function valid
Validates a Captcha response and updates response counter.
Parameters:
- string response
- captcha response
Return: boolean
Captcha_Core -> valid_count
public function valid_count
Gets or sets the number of valid Captcha responses for this session.
Parameters:
- integer new_count
- (NULL) new counter value
- boolean invalid
- (FALSE) trigger invalid counter (for internal use only)
Return: integer counter value
Captcha_Core -> invalid_count
public function invalid_count
Gets or sets the number of invalid Captcha responses for this session.
Parameters:
- integer new_count
- (NULL) new counter value
Return: integer counter value
Captcha_Core -> reset_count
public function reset_count
Resets the Captcha response counters and removes the count sessions.
Return: void
Captcha_Core -> promoted
public function promoted
Checks whether user has been promoted after having given enough valid responses.
Parameters:
- integer threshold
- (NULL) valid response count threshold
Return: boolean
Captcha_Core -> render
public function render
Returns or outputs the Captcha challenge.
Parameters:
- boolean html
- (TRUE) TRUE to output html, e.g.
Return: mixed html string or void
Captcha_Core -> __toString
public function __toString
Magically outputs the Captcha challenge.
Return: mixed