fix SQL operations failing when authing as an LDAP user

closes #12