skip ldap security check if ldap auth is disabled in config

This fixes issue #7213 which is a reincarnation of issue #6188
@jvanbaarsen That's a good idea. I'll update the branch later today.