Exemple #1
0
 public function numeroIntentos($email)
 {
     $aux = FALSE;
     $usuario = new Usuario_model();
     $fecha_esp = str_replace("/", "-", $usuario->fechaUltimoIntento($email));
     $fecha1 = strtotime($fecha_esp);
     $fecha2 = strtotime(date('Y/m/d H:i:s'));
     $resultado = $fecha2 - $fecha1;
     $horas = $resultado / 60 / 60;
     if ($usuario->numeroIntentos($email) <= 3) {
         $aux = TRUE;
     } else {
         if ($usuario->numeroIntentos($email) > 3 && $horas >= 2) {
             $act = array('Email' => $email, 'NumeroIntentos' => 0);
             $usuario->actualizar($email, $act);
             $aux = TRUE;
         }
     }
     return $aux;
 }