created preliminary function for login, will not work with a
database without uids i.e ldapstaging