コード例 #1
0
ファイル: actions.class.php プロジェクト: jfesquet/tempos
 /**
  * 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;
 }
コード例 #2
0
 /**
  * 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);
 }