r1388: Adding password history code for ldap backend, based on a patch from