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"forLDAP_MOD_ADDโ add these values to the attribute"r"forLDAP_MOD_REPLACEโ replace these values in the attribute"d"forLDAP_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 Handlemsgidโ 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 Handlemsgidโ Integerserverctrlsโ LDAP Control List Pointerclientctrlsโ 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 Handlednโ Stringattrsโ 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 Handlednโ Stringattrsโ LDAP Add/Modify Hashserverctrlsโ LDAP Control List Pointerclientctrlsโ LDAP Control List Pointermsgidpโ Integer
OUTPUT:
statusโ Integermsgidpโ 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 Handlednโ Stringattrsโ LDAP Add/Modify Hashserverctrlsโ LDAP Control List Pointerclientctrlsโ 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 Handlednโ Stringattrsโ 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 Pointerfreebufโ 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 Handlednโ Stringpasswdโ Stringauthmethodโ 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 Handlednโ Stringpasswdโ Stringauthmethodโ 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 Handlednโ Stringattrโ Stringvalueโ 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 Handlednโ Stringattrโ Stringbvalueโ Binary Stringserverctrlsโ LDAP Control List Pointerclientctrlsโ LDAP Control List Pointermsgidpโ Integer
OUTPUT:
statusโ Integermsgidpโ 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 Handlednโ Stringattrโ Stringbvalueโ Binary Stringserverctrlsโ LDAP Control List Pointerclientctrlsโ 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 Handlednโ Stringattrโ Stringvalueโ 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 Handleresultโ 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 Handleresultโ 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 Handleresultโ 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โ Stringbuflenโ Integerpatternโ Stringprefixโ Stringsuffixโ Stringattrโ Stringvalueโ Stringvalwordsโ 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 Handlechangetypesโ Integerchangesonlyโ Integerreturn_echg_ctrlsโ Integerctrl_iscriticalโ Integerctrlpโ LDAP Control List Pointer
OUTPUT:
statusโ Integerctrlpโ 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 HandlesortKeyListโ Sort Key Pointerctrl_iscriticalโ Integerctrlpโ LDAP Control List Pointer
OUTPUT:
statusโ Integerctrlpโ 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 Pointerstring_repโ String
OUTPUT:
statusโ IntegersortKeyListโ 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 Handlectrlpโ LDAP Control List Pointer
OUTPUT:
statusโ Integerctrlpโ 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 Handlednโ 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 Handlednโ Stringserverctrlsโ LDAP Control List Pointerclientctrlsโ LDAP Control List Pointermsgidpโ Integer
OUTPUT:
statusโ Integermsgidpโ 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 Handlednโ Stringserverctrlsโ LDAP Control List Pointerclientctrlsโ 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 Handlednโ 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โ Stringnotypesโ 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โ Stringnotypesโ 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 Handlerequestoidโ Stringrequestdataโ Binary Stringserverctrlsโ LDAP Control List Pointerclientctrlsโ LDAP Control List Pointermsgidpโ Integer
OUTPUT:
statusโ Integermsgidpโ 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 Handlerequestoidโ Stringrequestdataโ Binary Stringserverctrlsโ LDAP Control List Pointerclientctrlsโ LDAP Control List Pointerretoidpโ String
OUTPUT:
statusโ Integerretoidpโ Return OIDretdatapโ 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 Handleentryโ LDAP Message Pointerberโ Ber Element Pointer
OUTPUT:
statusโ Stringberโ 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 Handlechainโ 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 Handleresโ 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 Handleresโ 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โ Stringnameโ Stringmapโ 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 Handleentryโ 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 Handleentryโ LDAP Message Pointerserverctrlspโ LDAP Control List Pointer
OUTPUT:
statusโ Integerserverctrlspโ 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 Pointertagpatโ 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 Handleentryโ LDAP Message Pointertargetโ Stringtypeโ 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 Handleentryโ LDAP Message Pointertargetโ Stringtypeโ 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 Handlemโ 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 Handleoptionโ Integeroptdataโ Integer
OUTPUT:
statusโ Integeroptdataโ 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 Handleentryโ LDAP Message Pointertargetโ 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 Handleentryโ LDAP Message Pointertargetโ 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โ Stringportโ 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โ Stringbuflenโ 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 Pointerdnโ Stringscopeโ 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 Handlecachepโ LDAP Memory Cache Pointer
OUTPUT:
statusโ Integercachepโ 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โ Integersizeโ IntegerbaseDNsโ List Referencecachepโ LDAP Memory Cache Pointer
OUTPUT:
statusโ Integercachepโ 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 Handlecacheโ 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 Handlednโ Stringmodsโ 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 Handlednโ Stringmodsโ LDAP Add/Modify Hashserverctrlsโ LDAP Control List Pointerclientctrlsโ LDAP Control List Pointermsgidpโ Integer
OUTPUT:
statusโ Integermsgidpโ 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 Handlednโ Stringmodsโ LDAP Add/Modify Hashserverctrlsโ LDAP Control List Pointerclientctrlsโ 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 Handlednโ Stringmodsโ 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 Handlednโ Stringnewrdnโ 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 Handlednโ Stringnewrdnโ 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 Handlednโ Stringnewrdnโ Stringdeleteoldrdnโ 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 Handlednโ Stringnewrdnโ Stringdeleteoldrdnโ 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 Handlechainโ LDAP Message Pointerattrโ List Reference
OUTPUT:
statusโ Integerchainโ 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 Handleentryโ LDAP Message Pointerberโ Ber Element Pointer
OUTPUT:
statusโ Stringberโ 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 Handleentryโ 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 Handlemsgโ 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 Handlerefโ 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 Handlectrlsโ LDAP Control List Pointerchgtypepโ Integerprevdnpโ Stringchgnumpresentpโ Integerchgnumpโ Integer
OUTPUT:
statusโ Integerchgtypepโ Integerprevdnpโ Stringchgnumpresentpโ Integerchgnumpโ 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 Handleresโ LDAP Message Pointerretoidpโ Stringfreeitโ Integer
OUTPUT:
statusโ Integerretoidpโ Stringretdatapโ 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 Handlerefโ LDAP Message Pointerreferalspโ List Referenceserverctrlspโ LDAP Control List Pointerfreeitโ Integer
OUTPUT:
statusโ Integerreferalspโ List Referenceserverctrlspโ 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 Handleresโ LDAP Message Pointererrcodepโ Integermatcheddnpโ Stringerrmsgpโ Stringreferralspโ List Referenceserverctrlspโ LDAP Control List Pointerfreeitโ Integer
OUTPUT:
statusโ Integererrcodepโ Integermatcheddnpโ Stringerrmsgpโ Stringreferralspโ List Referenceserverctrlspโ 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 Handleresโ LDAP Message Pointerfreeitโ Integer
OUTPUT:
statusโ Integerservercredpโ (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 Handlectrlsโ LDAP Control List Pointerresultโ LDAP Message Pointerattributeโ String
OUTPUT:
statusโ Integerresultโ LDAP Message Pointerattributeโ 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 Handlectrlsโ LDAP Control List Pointertarget_pospโ Integerlist_sizepโ Integererrcodepโ Integer
OUTPUT:
statusโ Integertarget_pospโ Integerlist_sizepโ Integererrcodepโ 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 Handlesโ 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 Handlednโ Stringnewrdnโ Stringnewparentโ Stringdeleteoldrdnโ Integerserverctrlsโ LDAP Control List Pointerclientctrlsโ LDAP Control List Pointermsgidpโ Integer
OUTPUT:
statusโ Integermsgidpโ 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 Handlednโ Stringnewrdnโ Stringnewparentโ Stringdeleteoldrdnโ Integerserverctrlsโ LDAP Control List Pointerclientctrlsโ 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 Handlemsgidโ Integerallโ Integertimeoutโ Time in Secondsresultโ LDAP Message Pointer
OUTPUT:
statusโ Integerresultโ 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 Handlerโ LDAP Message Pointerfreeitโ 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 Handlednโ Stringmechanismโ Stringcredโ Binary Stringserverctrlsโ LDAP Control List Pointerclientctrlsโ LDAP Control List Pointermsgidpโ Integer
OUTPUT:
statusโ Integermsgidpโ 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 Handlednโ Stringmechanismโ Stringcredโ Binary Stringserverctrlsโ LDAP Control List Pointerclientctrlsโ LDAP Control List Pointer
OUTPUT:
statusโ Integerservercredpโ (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 Handlebaseโ Stringscopeโ Integerfilterโ Stringattrsโ List Referenceattrsonlyโ 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 Handlebaseโ Stringscopeโ Integerfilterโ Stringattrsโ List Referenceattrsonlyโ Integerserverctrlsโ LDAP Control List Pointerclientctrlsโ LDAP Control List Pointertimeoutpโ Time in Secondssizelimitโ Integermsgidpโ Integer
OUTPUT:
statusโ Integermsgidpโ 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 Handlebaseโ Stringscopeโ Integerfilterโ Stringattrsโ List Referenceattrsonlyโ Integerserverctrlsโ LDAP Control List Pointerclientctrlsโ LDAP Control List Pointertimeoutpโ Time in Secondssizelimitโ Integerresโ LDAP Message Pointer
OUTPUT:
statusโ Integerresโ 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 Handlebaseโ Stringscopeโ Integerfilterโ Stringattrsโ List Referenceattrsonlyโ Integerresโ LDAP Message Pointer
OUTPUT:
statusโ Integerresโ 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 Handlebaseโ Stringscopeโ Integerfilterโ Stringattrsโ List Referenceattrsonlyโ Integertimeoutโ Time in Secondsresโ LDAP Message Pointer
OUTPUT:
statusโ Integerresโ 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 Pointerprefixโ Stringsuffixโ 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 Handleeโ Integermโ Stringsโ 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 Handleoptionโ Integeroptdataโ 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 namesld, 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 Handlewhoโ Stringpasswdโ 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 Handlewhoโ Stringpasswdโ 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 Handlechainโ LDAP Message Pointerattrโ String
OUTPUT:
statusโ Integerchainโ 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 Handleurlโ Stringattrsonlyโ 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 Handleurlโ Stringattrsonlyโ Integerresโ LDAP Message Pointer
OUTPUT:
statusโ Integerresโ 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 Handleurlโ Stringattrsonlyโ Integertimeoutโ Time in Secondsresโ LDAP Message Pointer
OUTPUT:
statusโ Integerresโ 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 Handlesharedโ 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'
- You forgot a
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
- ubuntu questing: libmozilla-ldap-perl 1.5.3-3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms