pike.git / lib / modules / Protocols.pmod / LDAP.pmod / client.pike

version» Context lines:

pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1:   #pike __REAL_VERSION__      // LDAP client protocol implementation for Pike.   // - // $Id: client.pike,v 1.94 2005/04/07 18:16:02 mast Exp $ + // $Id: client.pike,v 1.95 2005/04/07 18:36:15 mast Exp $   //   // Honza Petrous, hop@unibase.cz   //   // ----------------------------------------------------------------------   //   // History:   //   // v0.0 1998-05-25 Starting up!   // v1.0 1998-06-21 Core functions (open, bind, unbind, delete, add,   // compare, search), only V2 operations,
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:553: Inside #if undefined(PARSE_RFCS)
   //! @[Protocol.LDAP.parse_ldap_url].    //!    //! @param context    //! TLS context of connection    //!    //! @seealso    //! @[LDAP.client.bind], @[LDAP.client.search]    void create(string|mapping(string:mixed)|void url, object|void context)    {    -  info = ([ "code_revision" : ("$Revision: 1.94 $"/" ")[1] ]); +  info = ([ "code_revision" : ("$Revision: 1.95 $"/" ")[1] ]);       if(!url || !sizeof(url))    url = LDAP_DEFAULT_URL;       if (mappingp (url))    lauth = url;    else    lauth = parse_ldap_url(url);       if(!stringp(lauth->scheme) ||
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1116:    "namingcontexts",    "altserver",    "supportedextension",    "supportedcontrol",    "supportedsaslmechanisms",    "supportedldapversion",    >);    attrs[attr] = 1;       mapping(string:array(string)) res = -  simple_read ("", get_cached_filter ("(objectClass=*)", ldap_version), -  indices (attrs)); +  simple_read ("", get_cached_filter ("(objectClass=*)"), indices (attrs));       foreach (indices (res), string attr)    // Microsoft AD has several attributes in its root DSE that    // they haven't bothered to include in their schema. Send    // the nowarn flag to get_attr_encoder to avoid complaints    // about that.    if (function(string:string) decoder =    get_attr_decoder (attr, DO_IF_DEBUG (1)))    res[attr] = map (res[attr], decoder);   
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1179:   //! connection.   //!   //! @throws   //! If there's a parse error in the filter then a   //! @[Protocols.LDAP.FilterError] is thrown as from   //! @[Protocols.LDAP.make_filter].   {    return Protocols.LDAP.make_filter (filter, ldap_version);   }    + object get_cached_filter (string filter) + //! This is a wrapper for @[Protocols.LDAP.get_cached_filter] which + //! passes the LDAP protocol version currently in use by this + //! connection. + //! + //! @throws + //! If there's a parse error in the filter then a + //! @[Protocols.LDAP.FilterError] is thrown as from + //! @[Protocols.LDAP.make_filter]. + { +  return Protocols.LDAP.get_cached_filter (filter, ldap_version); + } +    object get_default_filter()   //! Returns the ASN1 object parsed from the filter specified in the   //! LDAP URL, or zero if the URL doesn't specify any filter.   //!   //! @throws   //! If there's a parse error in the filter then a   //! @[Protocols.LDAP.FilterError] is thrown as from   //! @[Protocols.LDAP.make_filter].   {    if (!default_filter_obj && lauth->filter)
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1487:    if (chk_binded())    return 0;    if(ldap_version == 3) {    object_name = string_to_utf8 (object_name);    if (filter) filter = string_to_utf8(filter);    }       object|int search_request =    make_search_op (object_name, 0, ldap_deref,    ldap_sizelimit, ldap_timelimit, attrsonly, -  filter || get_cached_filter ("(objectClass=*)", ldap_version), +  filter || get_cached_filter ("(objectClass=*)"),    attrs);       if(intp(search_request)) {    THROW(({error_string()+"\n",backtrace()}));    return 0;    }       object ctrls;    if (controls) {    array(object) control_list = allocate (sizeof (controls));
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1916:   // useful or not - haven't got a good grasp on how multiple schemas   // interact in the same server. /mast)   {    mapping(string:array(string)) subschema_response;    int utf8_decode_dns;       if (dn == "" && root_dse)    subschema_response = root_dse;    else {    subschema_response = -  simple_read (dn, get_cached_filter ("(objectClass=*)", ldap_version), -  ({"subschemaSubentry"})); +  simple_read (dn, get_cached_filter ("(objectClass=*)"), ({"subschemaSubentry"}));    utf8_decode_dns = 1;    }       if (subschema_response)    if (array(string) subschema_dns = subschema_response->subschemasubentry) {    if (sizeof (subschema_dns) == 1)    return simple_read (    utf8_decode_dns ? utf8_to_string (subschema_dns[0]) : subschema_dns[0], -  get_cached_filter ("(objectClass=subschema)", ldap_version), attrs); +  get_cached_filter ("(objectClass=subschema)"), attrs);       else {    // This should afaics only occur for the root DSE, but it's a    // bit confusing: RFC 2252 section 5.1.5 specifies that    // subschemaSubentry is single valued, while RFC 2251 section    // 3.4 says that it can contain zero or more values in the    // root DSE. /mast    mapping(string:array(string)) res = ([]);    foreach (subschema_dns, string subschema_dn) {    if (mapping(string:array(string)) subres = simple_read (    utf8_decode_dns ? utf8_to_string (subschema_dn) : subschema_dn, -  get_cached_filter ("(objectClass=subschema)", ldap_version), attrs)) +  get_cached_filter ("(objectClass=subschema)"), attrs))    foreach (indices (subres), string attr)    res[attr] += subres[attr];    }    return res;    }    }       return 0;   }