Exemple #1
0
 public function addCaptcha()
 {
     $dumb = new Captcha\Dumb();
     $dumb->setLabel('Copia e incolla la seguente stringa:');
     $captcha = new Element\Captcha('captcha');
     $captcha->setCaptcha($dumb)->setLabel('Captcha');
     $this->add($captcha);
 }
Exemple #2
0
 protected function createCaptcha()
 {
     $captcha = new Captcha\Dumb();
     $captchaname = uniqid();
     $captcha->setName($captchaname);
     $captcha->setWordlen(3);
     $token = $captcha->generate();
     $word = $captcha->getWord();
     $returnObj = new LocalCaptcha();
     $returnObj->captchaname = $captchaname;
     $returnObj->captchatoken = $token;
     $returnObj->captchaword = strrev($word);
     return $returnObj;
 }