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.28 2001/09/14 12:56:24 hop Exp $ + // $Id: client.pike,v 1.29 2001/10/04 19:35:59 nilsson 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:86:   #define ASN1_DECODE_RESULTAPP(X) (.ldap_privates.ldap_der_decode(X)->elements[1]->get_tag())   #define ASN1_DECODE_RESULTCODE(X) (int)(.ldap_privates.ldap_der_decode(X)->elements[1]->elements[0]->value->cast_to_int())   #define ASN1_DECODE_RESULTSTRING(X) (.ldap_privates.ldap_der_decode(X)->elements[1]->elements[2]->value)   #define ASN1_DECODE_RESULTREFS(X) (.ldap_privates.ldap_der_decode(X)->elements[1]->elements[3]->elements)   #define ASN1_DECODE_ENTRIES(X) _New_decode(X)   #define ASN1_DECODE_DN(X) (string)((X)->elements[0]->value)   #define ASN1_DECODE_RAWDEBUG(X) (.ldap_privates.ldap_der_decode(X)->debug_string())   #define ASN1_GET_ATTR_ARRAY(X) (array)((X)->elements[1]->elements)   #define ASN1_GET_ATTR_NAME(X) ((X)->elements[0]->value)    -  //! module Protocols -  //! submodule LDAP -  //! -  //! class client -  //! +     //! Contains the client implementation of the LDAP protocol.    //! All of the version 2 protocol features are implemented    //! but only the base parts of the version 3.       inherit .protocol;       private int binded = 0; // flag for v2 operations    private string ldap_basedn = ""; // baseDN    private int ldap_scope = 0; // 0: base, 1: onelevel, 2: subtree    private int ldap_deref = 0; // 0: ...
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:240:       //!    //! Returns the number of entries from current cursor    //! possition till end of the list.    //!    //! @seealso    //! @[LDAP.client.result.first], @[LDAP.client.result.next]    int count_entries() { return(entrycnt - actnum); }       //! @decl mapping(string:array(string)) fetch() -  //! @decl mapping(string:array(string)) fetch(int) +  //! @decl mapping(string:array(string)) fetch(int index)    //!    //! Returns a mapping with an entry for each attribute.    //! Each entry is an array of values of the attribute.    //! -  //! @param idx +  //! @param index    //! Optional argument can be used for direct access    //! to the entry other then currently pointed by cursor.    int|mapping(string:array(string)) fetch(int|void idx) {       if (!idx)    idx = actnum + 1;    if ((idx <= num_entries()) && (idx > 0)) {    actnum = idx - 1;    return(entry[actnum]);    }
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:329:    THROW(({"LDAP: Invalid DN syntax.\n",backtrace()}));    return(-ldap_errno);    }    return(0);    }       //! Several information about code itself and about active connection too    mapping info;       //! @decl void create() -  //! @decl void create(string) -  //! @decl void create(string, object) +  //! @decl void create(string url) +  //! @decl void create(string url, object context)    //!    //! Create object. The first optional argument can be used later    //! for subsequence operations. The second one can specify    //! TLS context of connection.    //!    //! @param url    //! LDAP server URL in form    //! @tt{"ldap://hostname/basedn?attrlist?scope?ext"@}    //!    //! @param context    //! TLS context of connection    //!    //! @seealso    //! @[LDAP.client.bind], @[LDAP.client.search]    void create(string|void url, object|void context)    {    -  info = ([ "code_revision" : ("$Revision: 1.28 $"/" ")[1] ]); +  info = ([ "code_revision" : ("$Revision: 1.29 $"/" ")[1] ]);       if(!url || !sizeof(url))    url = LDAP_DEFAULT_URL;       lauth = parse_url(url);       if(!stringp(lauth->scheme) ||    ((lauth->scheme != "ldap") && (lauth->scheme != "ldaps"))) {    THROW(({"Unknown scheme in server URL.\n",backtrace()}));    }
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:425:    namedn = Standards.ASN1.Types.asn1_octet_string(name);    auth = ASN1_CONTEXT_OCTET_STRING(0, password);    // SASL credentials ommited       msgval = ASN1_APPLICATION_SEQUENCE(0, ({vers, namedn, auth}));       return (do_op(msgval));    }       //! @decl int bind() -  //! @decl int bind(string, string) -  //! @decl int bind(string, string, version) +  //! @decl int bind(string dn, string password) +  //! @decl int bind(string dn, string password, int version)    //!    //! Authenticates connection to the direcory.    //!    //! First form uses default value previously entered in create.    //!    //! Second form uses value from parameters:    //!    //! @param dn    //! The distinguished name (DN) of an entry aginst which will    //! be made authentication.