Example #1
0
 /**
  * Método que se utiliza en la respuesta a los efs_captcha
  * @todo Este esquema solo se banca un solo ef_captcha. Para poder bancarse mas habria que 
  * pensar por ejemplo, pasarle al GET "id_ef + text-captcha" para identificar que texto se 
  * quiere recuperar. De todas maneras para que mas de un captcha???.
  */
 function servicio__mostrar_captchas_efs()
 {
     $texto = toba::memoria()->get_dato_operacion('texto-captcha');
     $parametros = toba::memoria()->get_dato_operacion('parametros-captcha');
     $refrescar = toba::memoria()->get_parametro('refrescar');
     if (isset($refrescar)) {
         $texto = null;
     }
     $antispam = new toba_imagen_captcha($texto);
     if (!isset($texto)) {
         $tamanio = toba::memoria()->get_dato_operacion('tamanio-texto-captcha');
         toba::logger()->debug($tamanio);
         $texto = $antispam->generateCode($tamanio);
         $antispam->set_codigo($texto);
         toba::memoria()->set_dato_operacion('texto-captcha', $texto);
     }
     toba::logger()->debug('Texto CAPTCHA: ' . $texto);
     if (isset($parametros)) {
         $antispam->set_parametros_captcha($parametros);
     }
     $antispam->show();
 }
 /**
  * Genera el texto aleatorio que se muestra en la imagen distorsionada.
  */
 function generar_texto_aleatorio()
 {
     $this->texto = $this->antispam->generateCode($this->longitud);
 }