예제 #1
0
  @Override
  public boolean save(User user) {
    user.setEnabled(1);
    if (user.getPassword().contains("???")) {
      user.setPassword(user.getPassword().substring(3));
    } else {
      user.setPassword(JCrypt.encrypt(user.getPassword()));
    }

    user = dao.saveOrUpdate(user);
    return true;
  }
예제 #2
0
  @Override
  public int createUser(String name, String username, String password, int perfil) {
    log.debug(username + " " + password + " " + perfil);

    User user = new User();
    user.setUser(username);
    user.setPassword(password);
    user.setGrtUser(name);
    user.setPerfil(userPerfilDao.get(perfil));
    user.setEnabled(1);
    user = dao.saveOrUpdate(user);

    return user.getId();
  }