Rename ldap_to_attribute and ldap_from_attribute to:

ldap_get_attribute (the attribute to get the username from)
ldap_search_user_filter (the filter to find the user)

This is for clarity. The to/from were used as generic LDAP functions, but were very confusing otherwise.