1 <?php defined('SYSPATH') OR die('No direct access allowed.');
3 * Captcha driver for "riddle" style.
5 * $Id: Riddle.php 3769 2008-12-15 00:48:56Z zombor $
9 * @copyright (c) 2007-2008 Kohana Team
10 * @license http://kohanaphp.com/license.html
12 class Captcha_Riddle_Driver extends Captcha_Driver {
17 * Generates a new Captcha challenge.
19 * @return string the challenge answer
21 public function generate_challenge()
23 // Load riddles from the current language
24 $riddles = Kohana::lang('captcha.riddles');
26 // Pick a random riddle
27 $riddle = $riddles[array_rand($riddles)];
29 // Store the question for output
30 $this->riddle = $riddle[0];
37 * Outputs the Captcha riddle.
39 * @param boolean html output
42 public function render($html)
47 } // End Captcha Riddle Driver Class