class HibernateUserDAO extends HibernatePersistentObjectDAO<User> implements UserDAO {

	public boolean validateUser(String username, String password) {
		boolean result = true;

		try {
			User user = null;
			if (ignoreCaseLogin())
				user = findByUsernameIgnoreCase(username);
			else
				user = findByUsername(username);

			if (!validateUser(user))
				return false;

			// Check the password match
			if (!user.getPassword().equals(CryptUtil.cryptString(password)))
				result = false;
		} catch (Throwable e) {
			log.error(e.getMessage(), e);
			result = false;
		}
		return result;
	}

	private  HibernateUserDAO();

}