Example #1
0
  /**
   * Method description
   *
   * @param user
   */
  @Override
  protected void preUpate(User user) {
    if (DUMMY_PASSWORT.equals(user.getPassword())) {
      User o = manager.get(user.getName());

      AssertUtil.assertIsNotNull(o);
      user.setPassword(o.getPassword());
    } else {
      encryptPassword(user);
    }
  }
Example #2
0
  /**
   * Method description
   *
   * @param user
   */
  private void encryptPassword(User user) {
    String password = user.getPassword();

    if (Util.isNotEmpty(password)) {
      user.setPassword(encryptionHandler.encrypt(password));
    }
  }