this.passwordEncoder = passwordEncoder;
}
public void createNewSeteUserProfile(CreateSeteUserProfileVo csupvo) {
SeteUser su = userDao.findById(Integer.valueOf(csupvo.getCreator())) ;
// old password validation
String oldPassword = su.getPassword() ;
String userFormOldPassword = passwordEncoder.encodePassword(csupvo.getOldPassword(), null) ;
if(!oldPassword.equals(userFormOldPassword))
{
BusinessRuleException bre = new BusinessRuleException();
bre.addCodedMessage("seteUser.OldPasswordInvalid");
throw bre;
}
// new password
su.setPassword(passwordEncoder.encodePassword(csupvo.getNewPassword(), null));
//contactInformation
ContactInformation ci = new ContactInformation();
ci.setAddress(csupvo.getAddress());
ci.setEmailAddress(csupvo.getEmailAddress());
ci.setPhoneNumber( csupvo.getPhoneNumber());
su.setContactInformation(ci);
seteUserDao.saveSeteUser(su);
}