/**
  * Show the CAPTCHA image
  *
  * @return string empty string (image is sent by view)
  */
 public function showAction()
 {
     // Get session data
     $word = $this->wordRepository->getWord();
     // Which type of hash to use
     // Store in session so can validate in form processor
     $word->setHashFunction('md5');
     $this->view->assign('word', $word);
     // Adjust settings
     $this->processSettings();
     $this->view->assign('settings', $this->settings);
     // Render the captcha image
     $this->view->render();
     // Store the session data
     $this->wordRepository->setWord($word);
 }
Esempio n. 2
0
 /**
  * Play the audio catcha
  *
  * @return string Audio content to be sent to the client
  */
 public function playAction()
 {
     $word = $this->wordRepository->getWord();
     $this->view->assign('word', $word);
 }