class ExpiredPasswordBean extends AbstractPasswordBean {

    @Override
    public String changePassword() {
        User user = authMgr.getCurrentPrincipal().getUser();
        if (user.isLdapAuthentication()) {
            setPasswordOld(user.getLdapPassword());
        } else {
            setPasswordOld(user.getPassword());
        }
        return super.changePassword();
    }

}