@Override
public void changePassword(final Map<String, Object> session, final String oldPassword, final String pNewPassword)
{
final String newPassword = pNewPassword == null ? "" : pNewPassword;
User user = (User) session.get(Constant.CURRENT_USER);
user = getDaoFacade().getUserDAO().readByUsername(user.getUsername());
if (PasswordUtil.getInstance().checkPassword(user, oldPassword) || oldPassword.equals(user.getPassword())) {
final Date now = new Date();
user.setUpdateDate(now);
user.setUpdateTime(now);
user.setUpdater(user);
user.setPassword(PasswordUtil.getInstance().encrypt(user, newPassword));
// user.setChecksum(PasswordUtil.encrypt(user, user.getPassword() + user.getClass()));
getDaoFacade().getUserDAO().save(user);
} else {
throw new IncorrectPasswordException();
}