Added LDAP, fixed some bugs with database.php