Exemplo n.º 1
0
 /**
  * Check a posted hidden captcha made with getCaptchaTags
  * 
  * @param string $fieldId       [optional] The id to use to generate input elements (default = "hcptch")
  * @param integer $minLimit     [optional] Submission minimum time limit in seconds (default = 5)
  * @param integer $maxLimit     [optional] Submission maximum time limit in seconds (default = 1200)
  * @return boolean              Return false if the submitter is a robot 
  */
 public function checkCaptcha($fieldId = 'hcptch', $minLimit = 2, $maxLimit = 1200)
 {
     if (f_form_Captcha::checkCaptcha($fieldId, $minLimit, $maxLimit)) {
         unset($this->_post->{$fieldId});
         return true;
     }
     // set error and reset posted values
     $this->_errors['captcha'] = f_form_Captcha::getError();
     // if error is critical, remove post values
     if ($this->_errors['captcha'] >= 20) {
         $this->_post = array();
     }
     return false;
 }