skip ldap security check if ldap auth is disabled in config

This fixes issue #7213 which is a reincarnation of issue #6188