[fix #4165] fetch ldap config directly from DAO
fix pep8 warnings