Ejemplo n.º 1
0
 protected function generateVerifyCode()
 {
     if ($this->mode == self::MODE_MATH_ADVANCED) {
         return rand((int) $this->minLengthMath, (int) $this->maxLengthMath);
     } else {
         return parent::generateVerifyCode();
     }
 }
Ejemplo n.º 2
0
 /**
  * Generates a new verification code.
  * @return string the generated verification code
  */
 protected function generateVerifyCode()
 {
     switch (strtolower($this->mode)) {
         case self::MODE_MATH:
             return $this->getCodeMath();
         case self::MODE_MATHVERBAL:
             return $this->getCodeMathVerbal();
         case self::MODE_LOGICAL:
             return $this->getCodeLogical();
         case self::MODE_WORDS:
             return $this->getCodeWords();
         case self::MODE_DEFAULT:
         default:
             $code = parent::generateVerifyCode();
             return array('code' => $code, 'result' => $code);
     }
 }