better check whether string resembles a DN, fixes #9887
adjust login test to code changes
unify tests
Merge pull request #10340 from owncloud/fix-9887

better check whether string resembles a DN, fixes #9887