protected void ejecutarTarea() throws Exception {
    TmkLogger.debug("Comienzo Reporte de Socios Registrados en el mes anterior");
    sociosRegistrados = DBUtil.sociosRegistrados();

    MailUtil.sendMail(
        Globals.MAIL_MAILER,
        Globals.MAIL_REPORTE_DE_SOCIOS,
        Globals.NOMBRE_DEL_SITIO + " - Reporte de Socios Registrados en el mes anterior",
        "No se genero el listado de socios resgistrados en el mes anterior, se procesará más tarde.",
        "/mailing/sociosRegistrados.jsp");
  }
Пример #2
0
  public void doPost(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    String LOGIN = request.getParameter("LOGIN").toUpperCase();
    /*DATOS para enviar por mail*/
    String nombreCompleto = "";
    String email = "";
    String clave = "";
    /*DATOS para enviar por mail*/

    // SocioLocal socio = ShortCuts.findSocioByLogin(LOGIN);
    Socios2 socio = ShortCuts.findSocioByLogin(LOGIN);

    SocioTMK socioTMK = new SocioTMK();

    if (socio != null) {
      // nombreCompleto = Convert.nombreCompleto(socio.getNOMBRES(), socio.getAPELLIDOS());
      // email = new String(CryptUtil.desEncriptar(socio.getLOGIN()));
      // clave = new String(CryptUtil.desEncriptar(socio.getPASSWORD()));
      nombreCompleto = Convert.nombreCompleto(socio.getNombres(), socio.getApellidos());
      email = new String(CryptUtil.desEncriptar(socio.getLogin()));
      clave = new String(CryptUtil.desEncriptar(socio.getPassword()));
    } else {

      try {
        Connection conn = DBUtil.buildConnection();
        try {
          socioTMK.select(conn, new String[] {"login = '******'"});
          nombreCompleto = Convert.nombreCompleto(socioTMK.getNombres(), socioTMK.getApellidos());
          email = socioTMK.getLogin();
          clave = new String(CryptUtil.desEncriptar(socioTMK.getPassword()));
        } finally {
          conn.close();
        }
      } catch (Exception e) {
      }
    }

    if (socio != null || socioTMK.getIdSocio() != null) {
      TmkLogger.debug("Pedido de Clave. Login '" + LOGIN + "'");

      /*
      A PEDIDO DE DW SE CANCELA EL CAMBIO DE CLAVE, REUNION DEL DIA 30/3/2004
      String PASSWORD = this.generarPassword();
      socio.setPASSWORD(CryptUtil.encriptar(PASSWORD.getBytes()));
      */

      StringBuffer body = new StringBuffer();

      cantidadPerdidaDePassword++;

      body.append("Estimado/a ")
          .append(nombreCompleto)
          .append(":")
          .append(Globals.ENTER)
          .append(Globals.ENTER);
      body.append("Como fue solicitado, le enviamos su contraseña para poder ingresar a ")
          .append(Globals.NOMBRE_DEL_SITIO)
          .append(".")
          .append(Globals.ENTER);
      body.append(Globals.ENTER).append(Globals.ENTER);
      body.append("Email: ").append(email).append(Globals.ENTER);
      body.append("Clave: ").append(clave).append(Globals.ENTER);
      body.append(Globals.ENTER).append(Globals.ENTER);
      body.append("Muchas Gracias.").append(Globals.ENTER);

      MailUtil.sendMail(
          Globals.MAIL_CALL_CENTER,
          email,
          Globals.NOMBRE_DEL_SITIO + " - Pedido de Clave",
          body.toString());

      response.sendRedirect("/miCuenta/claveEnviada.jsp?LOGIN="******"Registracion.feedback", "El usuario \"" + LOGIN + "\" no esta registrado.");

      response.sendRedirect("/miCuenta/?seccionMiCuenta=5&LOGIN=" + LOGIN);
    }
  }