API(3pm)

๐Ÿฆ‹ NAME ๐Ÿฆ‹

Mozilla::LDAP::API โ€” Perl methods for LDAP C API calls ๐Ÿ’…

(you'll also see this page filed under API(3pm), that's just the header vibe ok bestie)


โœจ SYNOPSIS โœจ

use Mozilla::LDAP::API;
     or
use Mozilla::LDAP::API qw(:api :ssl :constant);
     or
use Mozilla::LDAP::API qw(:api :ssl :apiv3 :constant);
     or
use Mozilla::LDAP::API qw(:api :ssl :apiv3 :nspr :constant);

๐Ÿ’œ DESCRIPTION ๐Ÿ’œ

okay so this package is giving direct interface to the LDAP C API calls from Perl โ€” like, raw, unfiltered, no middleman ๐Ÿ”ฅ

It gets used internally by all the other Mozilla::LDAP modules. And listen, the docs are begging you here: it is highly suggested that you use the object oriented interface in Mozilla::LDAP::Conn and Mozilla::LDAP::Entry instead ๐Ÿ™ˆ โ€” unless you genuinely need asynchronous calls or other functionality that the OO interface doesn't have. Then, and only then, come hang out here. iykyk.


๐ŸŽ€ THIS DOCUMENT ๐ŸŽ€

ngl, this document has a number of known errors that will be corrected in the next revision ๐Ÿ˜ญ It's just... they were not expecting users to need this interface frequently, so priority was placed on other documents. That's the tea. ๐Ÿต

If you want to actually see how to use the API calls for real, the examples live under the test_api directory. go look, bestie ๐Ÿซถ


๐ŸŒธ CREATING AN ADD/MODIFY HASH ๐ŸŒธ

So for the add and modify routines you need to generate a list of attributes and values. You do this by creating a HASH table โ€” each attribute in the hash contains associated values, and those values can be one of three things:

- SCALAR VALUE    (ex. "Clayton Donley")
- ARRAY REFERENCE (ex. ["Clayton Donley","Clay Donley"])
- HASH REFERENCE  (ex. {"r",["Clayton Donley"]}
     note:  the value inside the HASH REFERENCE must currently
             be an ARRAY REFERENCE.

And for a modify operation, the key inside that HASH REFERENCE has to be one of these:

  • "a" for LDAP_MOD_ADD โ€” add these values to the attribute
  • "r" for LDAP_MOD_REPLACE โ€” replace these values in the attribute
  • "d" for LDAP_MOD_DELETE โ€” delete these values from the attribute

Also โœจ in add and modify operations you may specify "b" if the attributes you're adding are BINARY (so like "rb" = replace binary, periodt).

๐Ÿšจ currently it is only possible to do one operation per add/modify operation, meaning you literally cannot do something like this:
   {"d",["Clayton"],"a",["Clay"]}   <-- WRONG!

Using any combination of the above value types though? You can absolutely do things like:

%ldap_modifications = (
   "cn", "Clayton Donley",                    # Replace 'cn' values
   "givenname", ["Clayton","Clay"],           # Replace 'givenname'
values
   "mail", {"a",["donley\@cig.mcel.mot.com"],  #Add 'mail' values
   "jpegphoto", {"rb",[$jpegphotodata]},      # Replace Binary jpegPhoto
);

Then remember to call the add or modify operations with a REFERENCE to this HASH ๐Ÿ‘‘


๐Ÿ‘‘ API Methods ๐Ÿ‘‘

The following are the available API methods for Mozilla::LDAP::API. Many of these items have bad examples and OUTPUT information ๐Ÿ˜ญ Other information should be correct. We're being honest about it, ok?


๐Ÿ’ซ ldap_abandon(ld,msgid) ๐Ÿ’ซ

DESCRIPTION:

Abandon an asynchronous LDAP operation. bye felicia ๐Ÿ‘‹

INPUT:

  • ld โ€” LDAP Session Handle
  • msgid โ€” Integer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_abandon($ld,$msgid);

๐Ÿ’ซ ldap_abandon_ext(ld,msgid,serverctrls,clientctrls) ๐Ÿ’ซ

DESCRIPTION:

Abandon an asynchronous LDAP operation w/ Controls โ€” same ghosting energy, now with controls โœจ

INPUT:

  • ld โ€” LDAP Session Handle
  • msgid โ€” Integer
  • serverctrls โ€” LDAP Control List Pointer
  • clientctrls โ€” LDAP Control List Pointer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_abandon_ext($ld,$msgid,$serverctrls,$clientctrls);

๐Ÿ’ซ ldap_add(ld,dn,attrs) ๐Ÿ’ซ

DESCRIPTION:

Asynchronously add a LDAP entry. dropping a new entry like it's a fit pic ๐Ÿ“ธ

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • attrs โ€” LDAP Add/Modify Hash

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_add($ld,$dn,$attrs);

๐Ÿ’ซ ldap_add_ext(ld,dn,attrs,serverctrls,clientctrls,msgidp) ๐Ÿ’ซ

DESCRIPTION:

Asynchronously add a LDAP entry w/ Controls

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • attrs โ€” LDAP Add/Modify Hash
  • serverctrls โ€” LDAP Control List Pointer
  • clientctrls โ€” LDAP Control List Pointer
  • msgidp โ€” Integer

OUTPUT:

  • status โ€” Integer
  • msgidp โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_add_ext($ld,$dn,$attrs,$serverctrls,$clientctrls,$msgidp);

๐Ÿ’ซ ldap_add_ext_s(ld,dn,attrs,serverctrls,clientctrls) ๐Ÿ’ซ

DESCRIPTION:

Synchronously add a LDAP entry w/ Controls โ€” the _s is the "wait for it" version, no chaos ๐Ÿ’…

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • attrs โ€” LDAP Add/Modify Hash
  • serverctrls โ€” LDAP Control List Pointer
  • clientctrls โ€” LDAP Control List Pointer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_add_ext_s($ld,$dn,$attrs,$serverctrls,$clientctrls);

๐Ÿ’ซ ldap_add_s(ld,dn,attrs) ๐Ÿ’ซ

DESCRIPTION:

Synchronously add a LDAP entry. patient, calm, main character energy ๐Ÿ‘‘

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • attrs โ€” LDAP Add/Modify Hash

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_add_s($ld,$dn,$attrs);

๐Ÿ’ซ ldap_ber_free(ber,freebuf) ๐Ÿ’ซ

DESCRIPTION:

Free a BER element pointer. let it go, release it ๐Ÿฆ‹

INPUT:

  • ber โ€” BER Element Pointer
  • freebuf โ€” Integer

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_ber_free($ber,$freebuf);

๐Ÿ’ซ ldap_bind(ld,dn,passwd,authmethod) ๐Ÿ’ซ

DESCRIPTION:

Asynchronously bind to the LDAP server. saying hi to the server, but make it async ๐Ÿ’–

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • passwd โ€” String
  • authmethod โ€” Integer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_bind($ld,$dn,$passwd,$authmethod);

๐Ÿ’ซ ldap_bind_s(ld,dn,passwd,authmethod) ๐Ÿ’ซ

DESCRIPTION:

Synchronously bind to a LDAP server. you wait, respectfully.

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • passwd โ€” String
  • authmethod โ€” Integer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_bind_s($ld,$dn,$passwd,$authmethod);

๐Ÿ’ซ ldap_compare(ld,dn,attr,value) ๐Ÿ’ซ

DESCRIPTION:

Asynchronously compare an attribute/value pair and an entry. it's giving "are we matching or not" ๐Ÿ”

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • attr โ€” String
  • value โ€” String

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_compare($ld,$dn,$attr,$value);

๐Ÿ’ซ ldap_compare_ext(ld,dn,attr,bvalue,serverctrls,clientctrls,msgidp) ๐Ÿ’ซ

DESCRIPTION:

Asynchronously compare an attribute/value pair and an entry w/ Controls

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • attr โ€” String
  • bvalue โ€” Binary String
  • serverctrls โ€” LDAP Control List Pointer
  • clientctrls โ€” LDAP Control List Pointer
  • msgidp โ€” Integer

OUTPUT:

  • status โ€” Integer
  • msgidp โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_compare_ext($ld,$dn,$attr,$bvalue,$serverctrls,$clientctrls,$msgidp);

๐Ÿ’ซ ldap_compare_ext_s(ld,dn,attr,bvalue,serverctrls,clientctrls) ๐Ÿ’ซ

DESCRIPTION:

Synchronously compare an attribute/value pair to an entry w/ Controls

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • attr โ€” String
  • bvalue โ€” Binary String
  • serverctrls โ€” LDAP Control List Pointer
  • clientctrls โ€” LDAP Control List Pointer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_compare_ext_s($ld,$dn,$attr,$bvalue,$serverctrls,$clientctrls);

๐Ÿ’ซ ldap_compare_s(ld,dn,attr,value) ๐Ÿ’ซ

DESCRIPTION:

Synchronously compare an attribute/value pair to an entry. no rush, we'll wait ๐ŸŒธ

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • attr โ€” String
  • value โ€” String

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_compare_s($ld,$dn,$attr,$value);

๐Ÿ’ซ ldap_control_free(ctrl) ๐Ÿ’ซ

DESCRIPTION:

Free a LDAP control pointer. release the control, you're not controlling it anymore bestie ๐Ÿ™ˆ

INPUT:

  • ctrl โ€” LDAP Control Pointer

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V3

EXAMPLE:

$status = ldap_control_free($ctrl);

๐Ÿ’ซ ldap_controls_count(ctrls) ๐Ÿ’ซ

DESCRIPTION:

Count the number of LDAP controls in a LDAP Control List. math but make it cute ๐Ÿ”ข

INPUT:

  • ctrls โ€” LDAP Control List Pointer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_controls_count($ctrls);

๐Ÿ’ซ ldap_controls_free(ctrls) ๐Ÿ’ซ

DESCRIPTION:

Free a list of LDAP controls. plural release. we love a clean slate โœจ

INPUT:

  • ctrls โ€” LDAP Control List Pointer

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V3

EXAMPLE:

$status = ldap_controls_free($ctrls);

๐Ÿ’ซ ldap_count_entries(ld,result) ๐Ÿ’ซ

DESCRIPTION:

Count the number of LDAP entries returned. tally time ๐Ÿงฎ

INPUT:

  • ld โ€” LDAP Session Handle
  • result โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$count = ldap_count_entries($ld,$result);

(and yes, this one returns into $count, not $status โ€” the example said so, we're not fighting it ๐Ÿ˜ญ)


๐Ÿ’ซ ldap_count_messages(ld,result) ๐Ÿ’ซ

DESCRIPTION:

Count the number of LDAP messages returned. it's giving inbox energy ๐Ÿ“ฌ

INPUT:

  • ld โ€” LDAP Session Handle
  • result โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_count_messages($ld,$result);

๐Ÿ’ซ ldap_count_references(ld,result) ๐Ÿ’ซ

DESCRIPTION:

Count the number of LDAP references returned. refs, but the LDAP kind ๐Ÿซถ

INPUT:

  • ld โ€” LDAP Session Handle
  • result โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_count_references($ld,$result);

๐Ÿ’ซ ldap_create_filter(buf,buflen,pattern,prefix,suffix,attr,value,valwords) ๐Ÿ’ซ

DESCRIPTION:

Create a LDAP search filter. building the filter, slay ๐ŸŽ€

INPUT:

  • buf โ€” String
  • buflen โ€” Integer
  • pattern โ€” String
  • prefix โ€” String
  • suffix โ€” String
  • attr โ€” String
  • value โ€” String
  • valwords โ€” List Reference

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

Okay so wrapping up ldap_create_filter's example, that last line goes exactly like:

$status = ldap_create_filter($buf,$buflen,$pattern,$prefix,$suffix,$attr,$value,$valwords);

ldap_create_persistentsearch_control(ld,changetypes,changesonly,return_echg_ctrls,ctrl_iscritical,ctrlp)

DESCRIPTION: bestie we are building a persistent search control ๐Ÿ’…

INPUT:

  • ld โ€” LDAP Session Handle
  • changetypes โ€” Integer
  • changesonly โ€” Integer
  • return_echg_ctrls โ€” Integer
  • ctrl_iscritical โ€” Integer
  • ctrlp โ€” LDAP Control List Pointer

OUTPUT:

  • status โ€” Integer
  • ctrlp โ€” LDAP Control List Pointer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_create_persistentsearch_control($ld,$changetypes,$changesonly,$return_echg_ctrls,$ctrl_iscritical,$ctrlp);

ldap_create_sort_control(ld,sortKeyList,ctrl_iscritical,ctrlp)

DESCRIPTION: spins up a LDAP sort control, no biggie โœจ

INPUT:

  • ld โ€” LDAP Session Handle
  • sortKeyList โ€” Sort Key Pointer
  • ctrl_iscritical โ€” Integer
  • ctrlp โ€” LDAP Control List Pointer

OUTPUT:

  • status โ€” Integer
  • ctrlp โ€” LDAP Control List Pointer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_create_sort_control($ld,$sortKeyList,$ctrl_iscritical,$ctrlp);

ldap_create_sort_keylist(sortKeyList,string_rep)

DESCRIPTION: makes the whole list of keys that a sort control is gonna snack on ๐Ÿ”‘

INPUT:

  • sortKeyList โ€” Sort Key Pointer
  • string_rep โ€” String

OUTPUT:

  • status โ€” Integer
  • sortKeyList โ€” Sort Key Pointer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_create_sort_keylist($sortKeyList,$string_rep);

ldap_create_virtuallist_control(ld,ldvlistp,ctrlp)

DESCRIPTION: one (1) LDAP virtual list control, coming right up ๐ŸŽ€

INPUT:

  • ld โ€” LDAP Session Handle
  • ctrlp โ€” LDAP Control List Pointer

OUTPUT:

  • status โ€” Integer
  • ctrlp โ€” LDAP Control List Pointer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_create_virtuallist_control($ld,$ldvlistp,$ctrlp);

ldap_delete(ld,dn)

DESCRIPTION: yeets a LDAP entry into the void, asynchronously โ€” meaning you do NOT sit around waiting for it, you just move on with your life ๐Ÿ’€

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_delete($ld,$dn);

ldap_delete_ext(ld,dn,serverctrls,clientctrls,msgidp)

DESCRIPTION: same async entry-deletion energy, but now w/ Controls โœจ

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • serverctrls โ€” LDAP Control List Pointer
  • clientctrls โ€” LDAP Control List Pointer
  • msgidp โ€” Integer

OUTPUT:

  • status โ€” Integer
  • msgidp โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_delete_ext($ld,$dn,$serverctrls,$clientctrls,$msgidp);

ldap_delete_ext_s(ld,dn,serverctrls,clientctrls)

DESCRIPTION: the synchronous delete-a-LDAP-entry w/ Controls โ€” this one you actually wait on, bestie ๐Ÿซถ

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • serverctrls โ€” LDAP Control List Pointer
  • clientctrls โ€” LDAP Control List Pointer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_delete_ext_s($ld,$dn,$serverctrls,$clientctrls);

ldap_delete_s(ld,dn)

DESCRIPTION: deletes a LDAP entry the synchronous way โ€” you ask, you wait, you get your answer ๐Ÿ’…

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_delete_s($ld,$dn);

ldap_dn2ufn(dn)

DESCRIPTION: glows a DN up into a "Friendly" name ๐ŸŒธ

INPUT:

  • dn โ€” String

OUTPUT:

  • status โ€” String

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_dn2ufn($dn);

ldap_err2string(err)

DESCRIPTION: hands you the string value that belongs to a LDAP error code โ€” so the number actually means something ๐Ÿ˜ญ

INPUT:

  • err โ€” Integer

OUTPUT:

  • status โ€” String

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_err2string($err);

ldap_explode_dn(dn,notypes)

DESCRIPTION: splits a given DN into its components, kaboom ๐Ÿ’ฅ and listen: setting 'notypes' to 1 returns the components without their type names

INPUT:

  • dn โ€” String
  • notypes โ€” Integer

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_explode_dn($dn,$notypes);

ldap_explode_rdn(dn,notypes)

DESCRIPTION: same explode energy, but for a Relative DN โ€” components go flying ๐Ÿงจ

INPUT:

  • dn โ€” String
  • notypes โ€” Integer

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_explode_rdn($dn,$notypes);

ldap_extended_operation(ld,requestoid,requestdata,serverctrls,clientctrls,msgidp)

DESCRIPTION: does an asynchronous extended operation, main character energy, no waiting around ๐Ÿ”ฅ

INPUT:

  • ld โ€” LDAP Session Handle
  • requestoid โ€” String
  • requestdata โ€” Binary String
  • serverctrls โ€” LDAP Control List Pointer
  • clientctrls โ€” LDAP Control List Pointer
  • msgidp โ€” Integer

OUTPUT:

  • status โ€” Integer
  • msgidp โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_extended_operation($ld,$requestoid,$requestdata,$serverctrls,$clientctrls,$msgidp);

ldap_extended_operation_s(ld,requestoid,requestdata,serverctrls,clientctrls,retoidp,retdatap)

DESCRIPTION: the synchronous extended operation โ€” you ask, you wait, you get the goods back ๐ŸŽ

INPUT:

  • ld โ€” LDAP Session Handle
  • requestoid โ€” String
  • requestdata โ€” Binary String
  • serverctrls โ€” LDAP Control List Pointer
  • clientctrls โ€” LDAP Control List Pointer
  • retoidp โ€” String

OUTPUT:

  • status โ€” Integer
  • retoidp โ€” Return OID
  • retdatap โ€” Return Data

AVAILABILITY: V3

EXAMPLE:

$status = ldap_extended_operation_s($ld,$requestoid,$requestdata,$serverctrls,$clientctrls,$retoidp,$retdatap);

ldap_first_attribute(ld,entry,ber)

DESCRIPTION: gives you the very first attribute that came back for a LDAP entry โ€” first one up, bestie ๐ŸŒŸ

INPUT:

  • ld โ€” LDAP Session Handle
  • entry โ€” LDAP Message Pointer
  • ber โ€” Ber Element Pointer

OUTPUT:

  • status โ€” String
  • ber โ€” Ber Element Pointer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_first_attribute($ld,$entry,$ber);

ldap_first_entry(ld,chain)

DESCRIPTION: returns the first entry sitting in a LDAP result chain โ›“๏ธ

INPUT:

  • ld โ€” LDAP Session Handle
  • chain โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” LDAP Message Pointer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_first_entry($ld,$chain);

ldap_first_message(ld,res)

DESCRIPTION: the first message in a LDAP result, opening the show ๐Ÿ’Œ

INPUT:

  • ld โ€” LDAP Session Handle
  • res โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” LDAP Message Pointer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_first_message($ld,$res);

ldap_first_reference(ld,res)

DESCRIPTION: the first reference inside a LDAP result โ€” the little pointer that says "actually, look over there" ๐Ÿ‘€

INPUT:

  • ld โ€” LDAP Session Handle
  • res โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” LDAP Message Pointer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_first_reference($ld,$res);

ldap_free_friendlymap(map)

DESCRIPTION: frees a LDAP friendly map pointer โ€” release it, it served its purpose ๐Ÿซถ

INPUT:

  • map โ€” Friendly Map Pointer

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_free_friendlymap($map);

ldap_free_sort_keylist(sortKeyList)

DESCRIPTION: frees a LDAP sort key pointer โ€” bye bestie, thanks for the keys ๐Ÿ—๏ธ

INPUT:

  • sortKeyList โ€” Sort Key Pointer

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V3

EXAMPLE:

$status = ldap_free_sort_keylist($sortKeyList);

ldap_free_urldesc(ludp)

DESCRIPTION: frees a LDAP URL description hash reference ๐ŸŒˆ

INPUT:

  • ludp โ€” URL Description Hash Reference

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V3

EXAMPLE:

$status = ldap_free_urldesc($ludp);

ldap_friendly_name(filename,name,map)

DESCRIPTION: creates a LDAP friendly name map โ€” yes, the name is literally friendly, it's giving sweetie ๐Ÿ“

INPUT:

  • filename โ€” String
  • name โ€” String
  • map โ€” Friendly Map Pointer

OUTPUT:

  • status โ€” String

AVAILABILITY: V3

EXAMPLE:

$status = ldap_friendly_name($filename,$name,$map);

ldap_get_dn(ld,entry)

DESCRIPTION: hands back the distinguished name for an entry ๐Ÿ‘‘

INPUT:

  • ld โ€” LDAP Session Handle
  • entry โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” String

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_get_dn($ld,$entry);

ldap_get_entry_controls(ld,entry,serverctrlsp)

DESCRIPTION: returns the controls attached to a LDAP entry ๐ŸŽ›๏ธ

INPUT:

  • ld โ€” LDAP Session Handle
  • entry โ€” LDAP Message Pointer
  • serverctrlsp โ€” LDAP Control List Pointer

OUTPUT:

  • status โ€” Integer
  • serverctrlsp โ€” LDAP Control List Pointer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_get_entry_controls($ld,$entry,$serverctrlsp);

ldap_getfilter_free(lfdp)

DESCRIPTION: frees a LDAP filter ๐Ÿงน

INPUT:

  • lfdp โ€” LDAP Filter Description Pointer

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V3

EXAMPLE:

$status = ldap_getfilter_free($lfdp);

ldap_getfirstfilter(lfdp,tagpat,value)

DESCRIPTION: gets the first generated filter, first one out the gate ๐Ÿ

INPUT:

  • lfdp โ€” LDAP Filter Description Pointer
  • tagpat โ€” String

OUTPUT:

  • status โ€” LDAP Filter Information Pointer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_getfirstfilter($lfdp,$tagpat,$value);

ldap_get_lang_values(ld,entry,target,type)

DESCRIPTION: grabs values for an entry ๐ŸŒธ

INPUT:

  • ld โ€” LDAP Session Handle
  • entry โ€” LDAP Message Pointer
  • target โ€” String
  • type โ€” String

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V3

EXAMPLE:

$status = ldap_get_lang_values($ld,$entry,$target,$type);

ldap_get_lang_values_len(ld,entry,target,type)

DESCRIPTION: gets binary values for an entry ๐Ÿ’พ

INPUT:

  • ld โ€” LDAP Session Handle
  • entry โ€” LDAP Message Pointer
  • target โ€” String
  • type โ€” String

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V3

EXAMPLE:

$status = ldap_get_lang_values_len($ld,$entry,$target,$type);

โœจ ldap_get_lderrno(ld,m,s) โœจ

DESCRIPTION: It's giving mystery, bestie โ€” the manpage left this one blank. Just peep the inputs and outputs.

INPUT:

  • ld โ€” LDAP Session Handle
  • m โ€” String Reference (or undef)
  • s โ€” String Reference (or undef)

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_get_lderrno($ld,\$m,\$s);

๐Ÿฆ‹ ldap_getnextfilter(lfdp) ๐Ÿฆ‹

DESCRIPTION: Grab the next generated LDAP filter โ€” it's giving next-filter energy.

INPUT:

  • lfdp โ€” LDAP Filter Information Pointer

OUTPUT:

  • status โ€” LDAP Filter Information Pointer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_getnextfilter($lfdp);

๐ŸŽ€ ldap_get_option(ld,option,optdata) ๐ŸŽ€

DESCRIPTION: Get an option for a LDAP session โ€” like checking the settings, but make it LDAP.

INPUT:

  • ld โ€” LDAP Session Handle
  • option โ€” Integer
  • optdata โ€” Integer

OUTPUT:

  • status โ€” Integer
  • optdata โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_get_option($ld,$option,$optdata);

๐Ÿ’… ldap_get_values(ld,entry,target) ๐Ÿ’…

DESCRIPTION: Get the values for a LDAP entry and attribute โ€” slay.

INPUT:

  • ld โ€” LDAP Session Handle
  • entry โ€” LDAP Message Pointer
  • target โ€” String

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V3

EXAMPLE:

$status = ldap_get_values($ld,$entry,$target);

๐ŸŒธ ldap_get_values_len(ld,entry,target) ๐ŸŒธ

DESCRIPTION: Get the binary values for a LDAP entry and attribute โ€” for when the data is built different.

INPUT:

  • ld โ€” LDAP Session Handle
  • entry โ€” LDAP Message Pointer
  • target โ€” String

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V3

EXAMPLE:

$status = ldap_get_values_len($ld,$entry,$target);

โœจ ldap_init(host,port) โœจ

DESCRIPTION: Initialize a LDAP session โ€” it's the main character moment.

INPUT:

  • host โ€” String
  • port โ€” Integer

OUTPUT:

  • status โ€” LDAP Session Handle

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_init($host,$port);

๐Ÿงš ldap_init_getfilter(fname) ๐Ÿงš

DESCRIPTION: Initialize the LDAP filter generation routines to a filename โ€” filter fairy vibes.

INPUT:

  • fname โ€” Filename String

OUTPUT:

  • status โ€” LDAP Filter Description Pointer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_init_getfilter($fname);

๐Ÿซถ ldap_init_getfilter_buf(buf,buflen) ๐Ÿซถ

DESCRIPTION: Initialize the LDAP filter generation routines to a buffer โ€” same energy, but buffer mode.

INPUT:

  • buf โ€” String
  • buflen โ€” Integer

OUTPUT:

  • status โ€” LDAP Filter Description Pointer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_init_getfilter_buf($buf,$buflen);

โญ ldap_is_ldap_url(url) โญ

DESCRIPTION: Returns 1 if the argument is a valid LDAP URL โ€” vibe check for URLs.

INPUT:

  • url โ€” String

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_is_ldap_url($url);

๐Ÿ’œ ldap_memcache_destroy(cache) ๐Ÿ’œ

DESCRIPTION: Destroy a memory cache โ€” bye bye, cache.

INPUT:

  • cache โ€” LDAP Memory Cache Pointer

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V3

EXAMPLE:

$status = ldap_memcache_destroy($cache);

๐Ÿ“ ldap_memcache_flush(cache,dn,scope) ๐Ÿ“

DESCRIPTION: Flush a specific DN from the memory cache โ€” clean slate for that DN.

INPUT:

  • cache โ€” LDAP Memory Cache Pointer
  • dn โ€” String
  • scope โ€” Integer

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V3

EXAMPLE:

$status = ldap_memcache_flush($cache,$dn,$scope);

๐ŸŒˆ ldap_memcache_get(ld,cachep) ๐ŸŒˆ

DESCRIPTION: Get the memory cache for a LDAP session โ€” cache me outside, how bow dah.

INPUT:

  • ld โ€” LDAP Session Handle
  • cachep โ€” LDAP Memory Cache Pointer

OUTPUT:

  • status โ€” Integer
  • cachep โ€” LDAP Memory Cache Pointer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_memcache_get($ld,$cachep);

๐Ÿ‘‘ ldap_memcache_init(ttl,size,baseDNs,cachep) ๐Ÿ‘‘

DESCRIPTION: Initialize a LDAP memory cache โ€” cache royalty activated.

INPUT:

  • ttl โ€” Integer
  • size โ€” Integer
  • baseDNs โ€” List Reference
  • cachep โ€” LDAP Memory Cache Pointer

OUTPUT:

  • status โ€” Integer
  • cachep โ€” LDAP Memory Cache Pointer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_memcache_init($ttl,$size,$baseDNs,$cachep);

๐Ÿ’– ldap_memcache_set(ld,cache) ๐Ÿ’–

DESCRIPTION: Set the LDAP memory cache for the session โ€” lock it in.

INPUT:

  • ld โ€” LDAP Session Handle
  • cache โ€” LDAP Memory Cache Pointer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_memcache_set($ld,$cache);

๐Ÿ”ฅ ldap_memcache_update(cache) ๐Ÿ”ฅ

DESCRIPTION: Update the specified memory cache โ€” refresh that cache, bestie.

INPUT:

  • cache โ€” LDAP Memory Cache Pointer

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V3

EXAMPLE:

$status = ldap_memcache_update($cache);

๐Ÿงน ldap_memfree(p) ๐Ÿงน

DESCRIPTION: Free memory allocated by the LDAP C API โ€” clean up on aisle LDAP.

INPUT:

  • p โ€” Pointer

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_memfree($p);

๐Ÿ› ๏ธ ldap_modify(ld,dn,mods) ๐Ÿ› ๏ธ

DESCRIPTION: Asynchronously modify a LDAP entry โ€” glow up in progress.

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • mods โ€” LDAP Add/Modify Hash

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_modify($ld,$dn,$mods);

๐ŸŽ›๏ธ ldap_modify_ext(ld,dn,mods,serverctrls,clientctrls,msgidp) ๐ŸŽ›๏ธ

DESCRIPTION: Asynchronously modify a LDAP entry w/ Controls โ€” same as above but with extra knobs and dials.

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • mods โ€” LDAP Add/Modify Hash
  • serverctrls โ€” LDAP Control List Pointer
  • clientctrls โ€” LDAP Control List Pointer
  • msgidp โ€” Integer

OUTPUT:

  • status โ€” Integer
  • msgidp โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_modify_ext($ld,$dn,$mods,$serverctrls,$clientctrls,$msgidp);

๐ŸŽ›๏ธ ldap_modify_ext_s(ld,dn,mods,serverctrls,clientctrls) ๐ŸŽ›๏ธ

DESCRIPTION: Synchronously modify a LDAP entry w/ Controls โ€” same energy, but sync.

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • mods โ€” LDAP Add/Modify Hash
  • serverctrls โ€” LDAP Control List Pointer
  • clientctrls โ€” LDAP Control List Pointer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_modify_ext_s($ld,$dn,$mods,$serverctrls,$clientctrls);

๐Ÿ› ๏ธ ldap_modify_s(ld,dn,mods) ๐Ÿ› ๏ธ

DESCRIPTION: Synchronously modify a LDAP entry โ€” wait for it modification.

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • mods โ€” LDAP Add/Modify Hash

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_modify_s($ld,$dn,$mods);

โœ๏ธ ldap_modrdn(ld,dn,newrdn) โœ๏ธ

DESCRIPTION: Asynchronously modify the relative distinguished name of an entry โ€” rename era.

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • newrdn โ€” String

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_modrdn($ld,$dn,$newrdn);

โœ๏ธ ldap_modrdn_s(ld,dn,newrdn) โœ๏ธ

DESCRIPTION: Synchronously modify the relative distinguished name of an entry โ€” rename, but wait for it.

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • newrdn โ€” String

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_modrdn_s($ld,$dn,$newrdn);

โœ๏ธ ldap_modrdn2(ld,dn,newrdn,deleteoldrdn) โœ๏ธ

DESCRIPTION: Asynchronously modify the relative distinguished name of an entry. Now with deleteoldrdn control.

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • newrdn โ€” String
  • deleteoldrdn โ€” Integer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_modrdn2($ld,$dn,$newrdn,$deleteoldrdn);

โœ๏ธ ldap_modrdn2_s(ld,dn,newrdn,deleteoldrdn) โœ๏ธ

DESCRIPTION: Synchronously modify the relative distinguished name of an entry. Same, but sync and with deleteoldrdn.

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • newrdn โ€” String
  • deleteoldrdn โ€” Integer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_modrdn2_s($ld,$dn,$newrdn,$deleteoldrdn);

๐Ÿ—‘๏ธ ldap_msgfree(lm) ๐Ÿ—‘๏ธ

DESCRIPTION: Free memory allocated by a LDAP Message โ€” bye, message.

INPUT:

  • lm โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_msgfree($lm);

๐Ÿ†” ldap_msgid(lm) ๐Ÿ†”

DESCRIPTION: Get the message id number from a LDAP message โ€” ID check.

INPUT:

  • lm โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_msgid($lm);

๐Ÿท๏ธ ldap_msgtype(lm) ๐Ÿท๏ธ

DESCRIPTION: Get the message type of a LDAP message โ€” what kind of message is this.

INPUT:

  • lm โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_msgtype($lm);

๐Ÿ”€ ldap_multisort_entries(ld,chain,attr) ๐Ÿ”€

DESCRIPTION: Sort entries by multiple keys โ€” multi-key sorting, no cap.

INPUT:

  • ld โ€” LDAP Session Handle
  • chain โ€” LDAP Message Pointer
  • attr โ€” List Reference

OUTPUT:

  • status โ€” Integer
  • chain โ€” LDAP Message Pointer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_multisort_entries($ld,$chain,$attr);

โžก๏ธ ldap_next_attribute(ld,entry,ber) โžก๏ธ

DESCRIPTION: Get the next attribute for a LDAP entry โ€” next.

INPUT:

  • ld โ€” LDAP Session Handle
  • entry โ€” LDAP Message Pointer
  • ber โ€” Ber Element Pointer

OUTPUT:

  • status โ€” String
  • ber โ€” BER Element Pointer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_next_attribute($ld,$entry,$ber);

โญ๏ธ ldap_next_entry(ld,entry) โญ๏ธ

DESCRIPTION: Get the next entry in the result chain โ€” next up.

INPUT:

  • ld โ€” LDAP Session Handle
  • entry โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” LDAP Message Pointer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_next_entry($ld,$entry);

ldap_next_message(ld,msg) โœจ

DESCRIPTION: Grab the next message off the result chain. Like scrolling to the next one in the thread, but make it LDAP. ๐Ÿฆ‹

INPUT:

  • ld โ€” LDAP Session Handle
  • msg โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” LDAP Message Pointer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_next_message($ld,$msg);

ldap_next_reference(ld,ref) ๐Ÿ’ซ

DESCRIPTION: Get the next reference in the result chain. Same energy as above, but for references instead of messages. ๐ŸŽ€

INPUT:

  • ld โ€” LDAP Session Handle
  • ref โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” LDAP Message Pointer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_next_reference($ld,$ref);

ldap_parse_entrychange_control(ld,ctrls,chgtypep,prevdnp,chgnumpresentp,chgnump) ๐Ÿ”

DESCRIPTION: Parse an LDAP entry change control. Basically decoding what the server just told you about a change. ๐Ÿ’…

INPUT:

  • ld โ€” LDAP Session Handle
  • ctrls โ€” LDAP Control List Pointer
  • chgtypep โ€” Integer
  • prevdnp โ€” String
  • chgnumpresentp โ€” Integer
  • chgnump โ€” Integer

OUTPUT:

  • status โ€” Integer
  • chgtypep โ€” Integer
  • prevdnp โ€” String
  • chgnumpresentp โ€” Integer
  • chgnump โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_parse_entrychange_control($ld,$ctrls,$chgtypep,$prevdnp,$chgnumpresentp,$chgnump);

ldap_parse_extended_result(ld,res,retoidp,retdatap,freeit) ๐ŸŒˆ

DESCRIPTION: Parse an LDAP extended result. Note that retdatap comes back out as a Binary List Reference โ€” that's a binary one, bestie, not a string, don't fight it. ๐Ÿซถ

INPUT:

  • ld โ€” LDAP Session Handle
  • res โ€” LDAP Message Pointer
  • retoidp โ€” String
  • freeit โ€” Integer

OUTPUT:

  • status โ€” Integer
  • retoidp โ€” String
  • retdatap โ€” Binary List Reference

AVAILABILITY: V3

EXAMPLE:

$status = ldap_parse_extended_result($ld,$res,$retoidp,$retdatap,$freeit);

ldap_parse_reference(ld,ref,referalsp,serverctrlsp,freeit) ๐ŸŽ€

DESCRIPTION: Parse a LDAP Reference. Hands you back the referrals list and the server controls list, all tidy. ๐Ÿ’–

INPUT:

  • ld โ€” LDAP Session Handle
  • ref โ€” LDAP Message Pointer
  • referalsp โ€” List Reference
  • serverctrlsp โ€” LDAP Control List Pointer
  • freeit โ€” Integer

OUTPUT:

  • status โ€” Integer
  • referalsp โ€” List Reference
  • serverctrlsp โ€” LDAP Control List Pointer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_parse_reference($ld,$ref,$referalsp,$serverctrlsp,$freeit);
ngl that spelling is referalsp, one L, and that's literally how it is in the page โ€” copy it exactly, don't "correct" it, fr fr. ๐Ÿ™ˆ

ldap_parse_result(ld,res,errcodep,matcheddnp,errmsgp,referralsp,serverctrlsp,freeit) ๐Ÿ‘‘

DESCRIPTION: Parse a LDAP result โ€” the big one. Gives you the error code, the matched DN, the error message, the referrals, and the server controls. It's giving main character energy, lowkey the most useful parse in the whole squad. โœจ

INPUT:

  • ld โ€” LDAP Session Handle
  • res โ€” LDAP Message Pointer
  • errcodep โ€” Integer
  • matcheddnp โ€” String
  • errmsgp โ€” String
  • referralsp โ€” List Reference
  • serverctrlsp โ€” LDAP Control List Pointer
  • freeit โ€” Integer

OUTPUT:

  • status โ€” Integer
  • errcodep โ€” Integer
  • matcheddnp โ€” String
  • errmsgp โ€” String
  • referralsp โ€” List Reference
  • serverctrlsp โ€” LDAP Control List Pointer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_parse_result($ld,$res,$errcodep,$matcheddnp,$errmsgp,$referralsp,$serverctrlsp,$freeit);

ldap_parse_sasl_bind_result(ld,res,servercredp,freeit) ๐Ÿงš

DESCRIPTION: Parse the results of an SASL bind operation. Because SASL binds deserve their own little result-parsing moment. ๐Ÿฆ‹

INPUT:

  • ld โ€” LDAP Session Handle
  • res โ€” LDAP Message Pointer
  • freeit โ€” Integer

OUTPUT:

  • status โ€” Integer
  • servercredp โ€” (left blank in the original, bestie โ€” nothing to see here) ๐Ÿ’€

AVAILABILITY: V3

EXAMPLE:

$status = ldap_parse_sasl_bind_result($ld,$res,$servercredp,$freeit);

ldap_parse_sort_control(ld,ctrls,result,attribute) ๐Ÿ“

DESCRIPTION: Parse a LDAP sort control. You get the result and the attribute back out โ€” very demure, very mindful. ๐Ÿ’…

INPUT:

  • ld โ€” LDAP Session Handle
  • ctrls โ€” LDAP Control List Pointer
  • result โ€” LDAP Message Pointer
  • attribute โ€” String

OUTPUT:

  • status โ€” Integer
  • result โ€” LDAP Message Pointer
  • attribute โ€” String

AVAILABILITY: V3

EXAMPLE:

$status = ldap_parse_sort_control($ld,$ctrls,$result,$attribute);

ldap_parse_virtuallist_control(ld,ctrls,target_posp,list_sizep,errcodep) ๐ŸŒธ

DESCRIPTION: Parse a LDAP virtual list control. Out come the target position, the list size, and the error code. Obsessed with a control that gives you three things at once. ๐Ÿ˜Œ

INPUT:

  • ld โ€” LDAP Session Handle
  • ctrls โ€” LDAP Control List Pointer
  • target_posp โ€” Integer
  • list_sizep โ€” Integer
  • errcodep โ€” Integer

OUTPUT:

  • status โ€” Integer
  • target_posp โ€” Integer
  • list_sizep โ€” Integer
  • errcodep โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_parse_virtuallist_control($ld,$ctrls,$target_posp,$list_sizep,$errcodep);

ldap_perror(ld,s) ๐Ÿ“ข

DESCRIPTION: Print a LDAP error message. Straight to output, no filter. Heads up though โ€” the status it gives you back is literally NONE, so don't go assigning it and expecting a value, bestie, that's not the vibe. ๐Ÿ˜ญ

INPUT:

  • ld โ€” LDAP Session Handle
  • s โ€” String

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_perror($ld,$s);

ldap_rename(ld,dn,newrdn,newparent,deleteoldrdn,serverctrls,clientctrls,msgidp) ๐Ÿฆ‹

DESCRIPTION: Asynchronously rename a LDAP entry. You hand it the DN, the new RDN, the new parent, whether to delete the old RDN, plus your server and client controls, and it gives you back a message ID. Fire and forget, iconic behaviour. ๐Ÿ’–

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • newrdn โ€” String
  • newparent โ€” String
  • deleteoldrdn โ€” Integer
  • serverctrls โ€” LDAP Control List Pointer
  • clientctrls โ€” LDAP Control List Pointer
  • msgidp โ€” Integer

OUTPUT:

  • status โ€” Integer
  • msgidp โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_rename($ld,$dn,$newrdn,$newparent,$deleteoldrdn,$serverctrls,$clientctrls,$msgidp);

ldap_rename_s(ld,dn,newrdn,newparent,deleteoldrdn,serverctrls,clientctrls) โœจ

DESCRIPTION: Synchronously rename a LDAP entry. Same deal as ldap_rename, but it waits for you instead of handing back a message ID โ€” no msgidp here, she's patient. ๐ŸŽ€

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • newrdn โ€” String
  • newparent โ€” String
  • deleteoldrdn โ€” Integer
  • serverctrls โ€” LDAP Control List Pointer
  • clientctrls โ€” LDAP Control List Pointer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_rename_s($ld,$dn,$newrdn,$newparent,$deleteoldrdn,$serverctrls,$clientctrls);

ldap_result(ld,msgid,all,timeout,result) โณ

DESCRIPTION: Get the result for an asynchronous LDAP operation. Give it the message ID, the all flag, and a timeout in seconds, and it hands back the result. This is the "so what happened to my async call" function, and yes she's essential. ๐Ÿ’…

INPUT:

  • ld โ€” LDAP Session Handle
  • msgid โ€” Integer
  • all โ€” Integer
  • timeout โ€” Time in Seconds
  • result โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” Integer
  • result โ€” LDAP Message Pointer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_result($ld,$msgid,$all,$timeout,$result);

ldap_result2error(ld,r,freeit) ๐Ÿ”

DESCRIPTION: Get the error number for a given result. Turns your result pointer into a number you can actually compare against stuff. Slay. ๐ŸŒˆ

INPUT:

  • ld โ€” LDAP Session Handle
  • r โ€” LDAP Message Pointer
  • freeit โ€” Integer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_result2error($ld,$r,$freeit);

ldap_sasl_bind(ld,dn,mechanism,cred,serverctrls,clientctrls,msgidp) ๐Ÿงš

DESCRIPTION: Asynchronously bind to the LDAP server using a SASL mechanism. You pass the DN, the mechanism, the credentials (binary string, mind you), your server and client controls, and out comes a message ID. Go do your thing, we'll check back later. ๐Ÿ’–

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • mechanism โ€” String
  • cred โ€” Binary String
  • serverctrls โ€” LDAP Control List Pointer
  • clientctrls โ€” LDAP Control List Pointer
  • msgidp โ€” Integer

OUTPUT:

  • status โ€” Integer
  • msgidp โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_sasl_bind($ld,$dn,$mechanism,$cred,$serverctrls,$clientctrls,$msgidp);

ldap_sasl_bind_s(ld,dn,mechanism,cred,serverctrls,clientctrls,servercredp) โœจ

DESCRIPTION: Synchronously bind to a LDAP server using a SASL mechanism. No message ID this time โ€” she blocks and gives you servercredp on the way out. ๐ŸŽ€

INPUT:

  • ld โ€” LDAP Session Handle
  • dn โ€” String
  • mechanism โ€” String
  • cred โ€” Binary String
  • serverctrls โ€” LDAP Control List Pointer
  • clientctrls โ€” LDAP Control List Pointer

OUTPUT:

  • status โ€” Integer
  • servercredp โ€” (left blank in the original, bestie โ€” no description given) ๐Ÿ’€

AVAILABILITY: V3

EXAMPLE:

$status = ldap_sasl_bind_s($ld,$dn,$mechanism,$cred,$serverctrls,$clientctrls,$servercredp);

ldap_search(ld,base,scope,filter,attrs,attrsonly) ๐Ÿ”ฅ

DESCRIPTION: Asynchronously search the LDAP server. Base, scope, filter, the attrs list, and whether you only want attribute names (attrsonly). Classic. Foundational. Ate. ๐Ÿ’…

INPUT:

  • ld โ€” LDAP Session Handle
  • base โ€” String
  • scope โ€” Integer
  • filter โ€” String
  • attrs โ€” List Reference
  • attrsonly โ€” Integer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_search($ld,$base,$scope,$filter,$attrs,$attrsonly);

ldap_search_ext(ld,base,scope,filter,attrs,attrsonly,serverctrls,clientctrls,timeoutp,sizelimit,msgidp) ๐ŸŒŸ

DESCRIPTION: Asynchronously search the LDAP server w/ Controls. Same as ldap_search but she also takes server controls, client controls, a timeout, and a size limit โ€” and gives you back a message ID. The glow-up version. โœจ

INPUT:

  • ld โ€” LDAP Session Handle
  • base โ€” String
  • scope โ€” Integer
  • filter โ€” String
  • attrs โ€” List Reference
  • attrsonly โ€” Integer
  • serverctrls โ€” LDAP Control List Pointer
  • clientctrls โ€” LDAP Control List Pointer
  • timeoutp โ€” Time in Seconds
  • sizelimit โ€” Integer
  • msgidp โ€” Integer

OUTPUT:

  • status โ€” Integer
  • msgidp โ€” Integer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_search_ext($ld,$base,$scope,$filter,$attrs,$attrsonly,$serverctrls,$clientctrls,$timeoutp,$sizelimit,$msgidp);

ldap_search_ext_s(ld,base,scope,filter,attrs,attrsonly,serverctrls,clientctrls,timeoutp,sizelimit,res) ๐Ÿฆ‹

DESCRIPTION: Synchronously search the LDAP server w/ Controls. Same arguments as the async one, except instead of a message ID you get res โ€” the LDAP Message Pointer โ€” because she waits for the whole thing. Patient queen. ๐Ÿ‘‘

INPUT:

  • ld โ€” LDAP Session Handle
  • base โ€” String
  • scope โ€” Integer
  • filter โ€” String
  • attrs โ€” List Reference
  • attrsonly โ€” Integer
  • serverctrls โ€” LDAP Control List Pointer
  • clientctrls โ€” LDAP Control List Pointer
  • timeoutp โ€” Time in Seconds
  • sizelimit โ€” Integer
  • res โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” Integer
  • res โ€” LDAP Message Pointer

AVAILABILITY: V3

EXAMPLE:

$status = ldap_search_ext_s($ld,$base,$scope,$filter,$attrs,$attrsonly,$serverctrls,$clientctrls,$timeoutp,$sizelimit,$res);

ldap_search_s(ld,base,scope,filter,attrs,attrsonly,res) ๐ŸŽ€

DESCRIPTION: Synchronously search the LDAP server

and this is exactly where part 4 taps out, bestie โ€” ldap_search_s finishes up in the next chunk ๐Ÿ’–

okay so we're still deep in ldap_search_s โ€” here's what you hand it and what it hands back ๐Ÿ’–

INPUT:

  • ld โ€” LDAP Session Handle
  • base โ€” String
  • scope โ€” Integer
  • filter โ€” String
  • attrs โ€” List Reference
  • attrsonly โ€” Integer
  • res โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” Integer
  • res โ€” LDAP Message Pointer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_search_s($ld,$base,$scope,$filter,$attrs,$attrsonly,$res);

๐ŸŒธ ldap_search_st(ld,base,scope,filter,attrs,attrsonly,timeout,res)

DESCRIPTION:

Synchronously search the LDAP server w/ Timeout (same energy as the synchronous search, but now it knows how to โœจwaitโœจ)

INPUT:

  • ld โ€” LDAP Session Handle
  • base โ€” String
  • scope โ€” Integer
  • filter โ€” String
  • attrs โ€” List Reference
  • attrsonly โ€” Integer
  • timeout โ€” Time in Seconds
  • res โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” Integer
  • res โ€” LDAP Message Pointer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_search_st($ld,$base,$scope,$filter,$attrs,$attrsonly,$timeout,$res);

๐ŸŽ€ ldap_set_filter_additions(lfdp,prefix,suffix)

DESCRIPTION:

Add a prefix and suffix for filter generation (dress your filters up, basically ๐Ÿ’…)

INPUT:

  • lfdp โ€” LDAP Filter Description Pointer
  • prefix โ€” String
  • suffix โ€” String

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_set_filter_additions($lfdp,$prefix,$suffix);

๐Ÿฆ‹ ldap_set_lderrno(ld,e,m,s)

DESCRIPTION:

Set the LDAP error structure (yes bestie, you can justโ€ฆ decide what the error says. iconic, honestly)

INPUT:

  • ld โ€” LDAP Session Handle
  • e โ€” Integer
  • m โ€” String
  • s โ€” String

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_set_lderrno($ld,$e,$m,$s);

๐Ÿ’œ ldap_set_option(ld,option,optdata)

DESCRIPTION:

Set a LDAP session option

INPUT:

  • ld โ€” LDAP Session Handle
  • option โ€” Integer
  • optdata โ€” Integer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_set_option($ld,$option,$optdata);

๐Ÿงš ldap_set_rebind_proc(ld,rebindproc)

DESCRIPTION:

Set the LDAP rebind process

INPUT:

  • ld โ€” LDAP Session Handle

OUTPUT:

  • status โ€” NONE

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_set_rebind_proc($ld,$rebindproc);
heads up bestie โ€” the INPUT list really only names ld, but the example still passes $rebindproc. That's just how the page is written, so I'm keeping it exactly like that ๐Ÿซถ

๐ŸŒˆ ldap_simple_bind(ld,who,passwd)

DESCRIPTION:

Asynchronously bind to the LDAP server using simple authentication

INPUT:

  • ld โ€” LDAP Session Handle
  • who โ€” String
  • passwd โ€” String

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_simple_bind($ld,$who,$passwd);

โญ ldap_simple_bind_s(ld,who,passwd)

DESCRIPTION:

Synchronously bind to the LDAP server using simple authentication

INPUT:

  • ld โ€” LDAP Session Handle
  • who โ€” String
  • passwd โ€” String

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_simple_bind_s($ld,$who,$passwd);

๐Ÿ“ ldap_sort_entries(ld,chain,attr)

DESCRIPTION:

Sort the results of a LDAP search (putting your results in order, main character energy only)

INPUT:

  • ld โ€” LDAP Session Handle
  • chain โ€” LDAP Message Pointer
  • attr โ€” String

OUTPUT:

  • status โ€” Integer
  • chain โ€” LDAP Message Pointer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_sort_entries($ld,$chain,$attr);

๐ŸŽ€ ldap_unbind(ld)

DESCRIPTION:

Asynchronously unbind from the LDAP server

INPUT:

  • ld โ€” LDAP Session Handle

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_unbind($ld);

๐ŸŽ€ ldap_unbind_s(ld)

DESCRIPTION:

Synchronously unbind from a LDAP server

INPUT:

  • ld โ€” LDAP Session Handle

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_unbind_s($ld);

๐Ÿ”ฅ ldap_url_parse(url)

DESCRIPTION:

Parse a LDAP URL, returning a HASH of its components (it's giving "unpack the whole URL into a lil hash for you")

INPUT:

  • url โ€” String

OUTPUT:

  • status โ€”

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_url_parse($url);
ngl the OUTPUT line here is literally empty in the original โ€” no description after the dash. Not me adding one, because I will NOT be inventing facts ๐Ÿ™ˆ

๐Ÿฆ‹ ldap_url_search(ld,url,attrsonly)

DESCRIPTION:

Asynchronously search using a LDAP URL

INPUT:

  • ld โ€” LDAP Session Handle
  • url โ€” String
  • attrsonly โ€” Integer

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_url_search($ld,$url,$attrsonly);

๐Ÿฆ‹ ldap_url_search_s(ld,url,attrsonly,res)

DESCRIPTION:

Synchronously search using a LDAP URL

INPUT:

  • ld โ€” LDAP Session Handle
  • url โ€” String
  • attrsonly โ€” Integer
  • res โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” Integer
  • res โ€” LDAP Message Pointer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_url_search_s($ld,$url,$attrsonly,$res);

โœจ ldap_url_search_st(ld,url,attrsonly,timeout,res)

DESCRIPTION:

Synchronously search using a LDAP URL w/ timeout

INPUT:

  • ld โ€” LDAP Session Handle
  • url โ€” String
  • attrsonly โ€” Integer
  • timeout โ€” Time in Seconds
  • res โ€” LDAP Message Pointer

OUTPUT:

  • status โ€” Integer
  • res โ€” LDAP Message Pointer

AVAILABILITY: V2/V3

EXAMPLE:

$status = ldap_url_search_st($ld,$url,$attrsonly,$timeout,$res);

๐ŸŒธ prldap_install_routines(ld,shared)

DESCRIPTION:

Install NSPR I/O, threading, and DNS functions so they can be used by the LDAP connection (ld).

If ld is NULL, the functions are installed as the default functions for all new LDAP * handles).

INPUT:

  • ld โ€” LDAP Session Handle
  • shared โ€” True if the LDAP * handle is used in an MT context

OUTPUT:

  • status โ€” Integer

AVAILABILITY: V3

no example for this one in the original, so no example here either. We respect the source ๐Ÿ’…

๐Ÿ‘‘ CREDITS

Most of the Perl API module was written by Clayton Donley to interface with C API routines from Netscape Communications Corp., Inc.


๐Ÿ’€ BUGS

okay bestie, the tea:

  • Documentation needs much work.
  • LDAPv3 calls not tested or supported in this version.
  • NT can not use Perl Rebind processes, must use ldap_set_default_rebindproc.
  • Possible memory leak in ldap_search* is being investigated.

๐Ÿซถ SEE ALSO

Mozilla::LDAP::Conn, Mozilla::LDAP::Entry, and Perl


๐Ÿ˜ญ POD ERRORS

Hey! The above document had some coding errors, which are explained below:

  • Around line 500:
    • '=item' outside of any '=over'
  • Around line 2959:
    • You forgot a '=back' before a '=head1'

and that's a wrap on the whole page, bestie ๐ŸŽ€ this one's from perl v5.40.0 and dated 2025-01-03 โ€” go forth and LDAP responsibly, you absolute icon ๐ŸŒŸ

๐Ÿ“ฆ where this page comes from