ldap authentication implemented and some bug fixes