User user = UserHelper.getUser(session.get(), username);
if (user != null && !user.isValidated()) {
MD5 md5 = new MD5();
md5.Update(user.getEmail());
md5.Update(user.getPasswordHash());
if (validationCode.equals(md5.asHex())) {
// validation successful
user.setValidated(true);
login(session.get(), getThreadLocalRequest(), getThreadLocalResponse(), username, user.getPasswordHash(), true);
tx.commit();
} else {