예제 #1
0
  @Override
  public User changeUsername_save(User user) {
    User user0 = userDAO.getUserById(user.getId());
    user0.setUsername(user.getUsername());
    userDAO.editUser(user0);

    return user0;
  }
예제 #2
0
  public Employee changeUserPassword_save(int id, String userPassword) {
    User user = userDAO.getUserById(id);
    Employee employee = userDAO.getEmployeeById(user.getEmployee().getId());
    Encrypt te = new Encrypt();
    user.setPassword(te.StringEncrypt(userPassword, "MD5"));
    userDAO.editUser(user);

    return userDAO.getEmployeeById(employee.getId());
  }
예제 #3
0
 public User CheckLogin(User user) {
   User u = userDAO.validateUser(user.getUsername(), user.getPassword());
   if (u != null) {
     Timestamp t =
         new Timestamp(new GregorianCalendar(TimeZone.getTimeZone("GMT")).getTimeInMillis());
     u.setLastLoginTime(t);
     userDAO.editUser(u);
   }
   return u;
 }