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.31 2001/11/05 00:50:54 nilsson Exp $ + // $Id: client.pike,v 1.32 2001/11/05 11:46:57 hop 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:234:    int num_entries() { return(entrycnt); }       //!    //! 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 index) +  //!    //! Returns a mapping with an entry for each attribute.    //! Each entry is an array of values of the attribute.    //!    //! @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;
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:342:    //! @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.31 $"/" ")[1] ]); +  info = ([ "code_revision" : ("$Revision: 1.32 $"/" ")[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:957:    string old_dn = ldap_basedn;       if(ldap_version == 3) {    base_dn = string_to_utf8(base_dn);    }    ldap_basedn = base_dn;    DWRITE_HI("client.SET_BASEDN = " + base_dn + "\n");    return(old_dn);    }    -  // API function (ldap_setscope) -  // -  // set_scope(string base_dn) -  // -  // scope: scope; 0: base, 1: onelevel, 2: subtree -  int set_scope (int scope) { +  //! +  //! Sets value of scope for search operation. +  //! +  //! @param scope +  //! Value can be integer or its corresponding string value. +  //! 0: base, 1: one, 2: sub +  //! +  int set_scope (int|string scope) {       int old_scope = ldap_scope;    -  +  // support for string based values +  if(stringp(scope)) +  switch (lower_case(scope)) { +  case "sub": scope = 2; break; +  case "one": scope = 1; break; +  case "base": scope = 0; break; +  default: return (-1); +  } +  else +  if(scope != 0 && scope != 1 && scope != 2) +  return (-1); +     ldap_scope = scope;    DWRITE_HI("client.SET_SCOPE = " + (string)scope + "\n");    return(old_scope);    }       // API function (ldap_setoption)    //    // set_option(int option_type, mixed value)    //    // option_type: LDAP_OPT_xxx