LDAP: fix TLS detection
remove unused variables
LDAP: only read config from database, if configID is given. Not what we want to do when on-the-fly-testing settings from the admin page
typo, grammar