Fix login redirect for edge cases when url need quote. Redirect doesn't
work for non-utf-8 chars.
Before validating LDAP credentials, check if user exists in local
database.