Returns the basedn specified in the ldap config
Escapes LDAP filter strings according to RFC2254
By default it does not escape the '*' character to keep wildcard search support.
Examples:
echo Ltool:: escape('(attribute=\abc*)');
// (attribute=\5cabc*)
echo Ltool:: escape('(attribute=\abc*)',TRUE);
// (attribute=\5cabc\2A)