Add method LdapAdapter.valid_user? that checks memberships and attributes.

Hi,

We need to be able to check whether a user belongs to the correct LDAP groups (for synchronization purposes). This commits adds a method for that.