/** * Executes default action * * @param sfRequest $request A request object */ public function executeCaptcha(sfWebRequest $request) { $this->setLayout(false); $captcha = new sfCryptoCaptcha(); $captcha->getCaptchaImage(); return sfView::NONE; }
/** * Returns true if the captcha is valid. (cleans the captcha attributes if all ok) * * @param $posted_captcha string The string of entered text * * @return boolean true if the captcha is valid, false otherwise */ protected function check($posted_captcha) { $captcha = new sfCryptoCaptcha(false); //The "false" option here is very important (or the captcha will display the flood error [Error - you're refreshing too fast]) return $captcha->testCaptcha($posted_captcha); }