make LDAP query scope configurable

Get the DN from the LDAP server itself rather than hardcoding its format.

Fixes bug 1122181

Change-Id: I6f70c480b5c6f1b064e74d3cbd2cd8ca5ee82b0a
Disable XML entity parsing

Fixes bug 1100282 and bug 1100279.

Change-Id: I6a7c9e7110e1c7890205d6e4550ab46295c68906
Merge "Disable XML entity parsing"
Merge "make LDAP query scope configurable"