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); }
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; }