Package modele

Examples of modele.ActionStatus


    String curUserName = request.getParameter("login");
    String curpassword = request.getParameter("password");
    String resultPage = null;
    UserSession session = UserSession.getInstance();
   
    ActionStatus a = Dao.validLogin(curUserName, curpassword);
    if (a.isStatusValue()) {
      Dao.setCurrentUser(curUserName);
      request.setAttribute("ressources", Dao.getUser(curUserName)
          .getRessources());
      session.authentifiedUser = Dao.getUser(curUserName);
      session.sessionID = request.getSession().getId();
    } else {
      request.setAttribute("Message", a.getStatusDescription());
      resultPage = "/jsp/DisplayMessage.jsp";
      forward(resultPage, request, response);
      return;
    }
    response.setContentType("text/html");
View Full Code Here


  public static ActionStatus complexityCheck(PasswordSetting passSetting,
      String pass) {
    PasswordUtil.password = pass;
    PasswordUtil.ps = passSetting;
    if (!lenghtCheck())
      return new ActionStatus(false,
          "Le mot de passe doit avoir aumoins "
              + ps.getPasswordLenght() + " caract�res");
    if (ps.isLowercaseContain()) {
      if (!lowerCaseCheck())
        return new ActionStatus(false,
            "Le mot de passe doit contenir aumoins un caract�re minuscule.");
    }
    if (ps.isNumberContain()) {
      if (!numberCheck())
        return new ActionStatus(false,
            "Le mot de passe doit contenir aumoins un chiffre.");
    }
    if (ps.isSpecialCharContain()) {
      if (!specialCharCheck())
        return new ActionStatus(false,
            "Le mot de passe doit avoir aumoins un cart�re parmi les caracteres "
                + ps.getSpecialChars());
    }
    if (ps.isUppercaseContain()) {
      if (!upperCaseCheck())
        return new ActionStatus(false,
            "Le mot de passe doit contenir aumoins un caract�re majuscule.");
    }
    return new ActionStatus(true,
        "La politique de complexit� est respect�e.");
  }
View Full Code Here

  public static ResultSet execute(String sql) {
    return Dbutil.getQueryResult(sql, false);
  }

  private static ActionStatus getAction(ResultSet rs) {
    ActionStatus action = null;
    if (rs != null) {
      try {
        while (rs.next()) {
          action = new ActionStatus(rs.getBoolean(1), rs.getString(2));
        }
      } catch (SQLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
View Full Code Here

        e.printStackTrace();
      }
    }
    if (b) { // old pass is correct.
          // Check the new password policy.
      ActionStatus a = PasswordUtil.complexityCheck(getpasswordSetting(),
          newPassword);
      if (!a.isStatusValue())
        return a;
      if (newPassword.equals(confirmPassword)) {
        // hash the new pass before store
        String npass = PasswordUtil.hasher(newPassword,
            getpasswordSetting().getSalt(), getpasswordSetting().getAlgorithm());
        if (motDePasseDisponible(userCode, npass)) {
          String stmt = "CALL userPasswordChange('" + userCode
              + "','" + npass + "')";
          return getAction(execute(stmt));

        } else {
          return new ActionStatus(false,
              "Le nouveau mot de passe ne doit pas appartenir aux "
                  + getpasswordSetting().getMaxPassStored()
                  + " derniers mot de passe utilis�s");
        }
      } else {
        return (new ActionStatus(false,
            "Le nouveau mot de passe et la confirmation ne sont pas identiques."));
      }

    } else {
      return (new ActionStatus(false,
          "L'ancien mot de passe n'est pas correct."));
    }
  }
View Full Code Here

TOP

Related Classes of modele.ActionStatus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.