From f45befed113542181aed472eef727b25f897d599 Mon Sep 17 00:00:00 2001 From: Mehdi Achour Date: Sun, 4 Feb 2007 22:48:23 +0000 Subject: [PATCH] ref.ldap: switch to new style Also document the following functions thanks to user notes ldap_8859_to_t61() git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@228999 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/ldap/functions/ldap-8859-to-t61.xml | 49 ++- reference/ldap/functions/ldap-add.xml | 110 +++++-- reference/ldap/functions/ldap-bind.xml | 59 +++- reference/ldap/functions/ldap-close.xml | 3 +- reference/ldap/functions/ldap-compare.xml | 74 ++++- reference/ldap/functions/ldap-connect.xml | 107 ++++-- .../ldap/functions/ldap-count-entries.xml | 49 ++- reference/ldap/functions/ldap-delete.xml | 46 ++- reference/ldap/functions/ldap-dn2ufn.xml | 37 ++- reference/ldap/functions/ldap-err2str.xml | 55 +++- reference/ldap/functions/ldap-errno.xml | 62 +++- reference/ldap/functions/ldap-error.xml | 63 ++-- reference/ldap/functions/ldap-explode-dn.xml | 56 +++- .../ldap/functions/ldap-first-attribute.xml | 82 +++-- reference/ldap/functions/ldap-first-entry.xml | 64 +++- .../ldap/functions/ldap-first-reference.xml | 13 +- reference/ldap/functions/ldap-free-result.xml | 49 ++- .../ldap/functions/ldap-get-attributes.xml | 81 +++-- reference/ldap/functions/ldap-get-dn.xml | 45 ++- reference/ldap/functions/ldap-get-entries.xml | 63 +++- reference/ldap/functions/ldap-get-option.xml | 143 ++++++-- .../ldap/functions/ldap-get-values-len.xml | 71 ++-- reference/ldap/functions/ldap-get-values.xml | 73 ++++- reference/ldap/functions/ldap-list.xml | 238 +++++++++++--- reference/ldap/functions/ldap-mod-add.xml | 64 +++- reference/ldap/functions/ldap-mod-del.xml | 58 +++- reference/ldap/functions/ldap-mod-replace.xml | 64 +++- reference/ldap/functions/ldap-modify.xml | 61 +++- .../ldap/functions/ldap-next-attribute.xml | 65 +++- reference/ldap/functions/ldap-next-entry.xml | 73 +++-- .../ldap/functions/ldap-next-reference.xml | 13 +- .../ldap/functions/ldap-parse-reference.xml | 13 +- .../ldap/functions/ldap-parse-result.xml | 13 +- reference/ldap/functions/ldap-read.xml | 217 +++++++++++-- reference/ldap/functions/ldap-rename.xml | 84 ++++- reference/ldap/functions/ldap-sasl-bind.xml | 20 +- reference/ldap/functions/ldap-search.xml | 307 +++++++++++------- reference/ldap/functions/ldap-set-option.xml | 180 +++++++--- .../ldap/functions/ldap-set-rebind-proc.xml | 13 +- reference/ldap/functions/ldap-sort.xml | 13 +- reference/ldap/functions/ldap-start-tls.xml | 13 +- reference/ldap/functions/ldap-t61-to-8859.xml | 13 +- reference/ldap/functions/ldap-unbind.xml | 22 +- 43 files changed, 2266 insertions(+), 732 deletions(-) diff --git a/reference/ldap/functions/ldap-8859-to-t61.xml b/reference/ldap/functions/ldap-8859-to-t61.xml index b586979d93..549358facd 100644 --- a/reference/ldap/functions/ldap-8859-to-t61.xml +++ b/reference/ldap/functions/ldap-8859-to-t61.xml @@ -1,21 +1,60 @@ - - + ldap_8859_to_t61 Translate 8859 characters to t61 characters - - Description + + + &reftitle.description; stringldap_8859_to_t61 stringvalue - &warn.undocumented.func; + Translate ISO-8859 characters to t61 + characters. + + + This function is useful if you have to talk to a legacy + LDAPv2 server. + + + &reftitle.parameters; + + + + value + + + The text to be translated. + + + + + + + + + &reftitle.returnvalues; + + Return the t61 translation of + value. + + + + + &reftitle.seealso; + + + ldap_t61_to_8859 + + + + - + ldap_add Add entries to LDAP directory - - Description + + + &reftitle.description; boolldap_add resourcelink_identifier @@ -15,47 +15,85 @@ arrayentry - &return.success; + Add entries in the LDAP directory. + + + + &reftitle.parameters; - The ldap_add function is used to add entries - in the LDAP directory. The DN of the entry to be added is - specified by dn. - Array entry specifies the information about the - entry. The values in the entries are indexed by individual attributes. - In case of multiple values for an attribute, they are indexed using - integers starting with 0. - - - - + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + dn + + + The distinguished name of an LDAP entity. + + + + + entry + + + An array that specifies the information about the entry. The values in + the entries are indexed by individual attributes. + In case of multiple values for an attribute, they are indexed using + integers starting with 0. + + + -]]> - - - - Complete example with authenticated bind - + ]]> + + + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; + + + Complete example with authenticated bind + ]]> - - - - ¬e.bin-safe; - + + + + + + &reftitle.notes; + ¬e.bin-safe; + + - + ldap_bind Bind to LDAP directory - - Description + + + &reftitle.description; boolldap_bind resourcelink_identifier @@ -15,15 +15,53 @@ stringbind_password - Binds to the LDAP directory with specified RDN and - password. &return.success; + Binds to the LDAP directory with specified RDN and password. + + + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + bind_rdn + + + + + + + bind_password + + + + + + - ldap_bind does a bind operation on the - directory. bind_rdn and - bind_password are optional. If not - specified, anonymous bind is attempted. + If bind_rdn and bind_password + are not specified, an anonymous bind is attempted. + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; Using LDAP Bind @@ -88,6 +126,7 @@ if ($ldapconn) { + - + ldap_close diff --git a/reference/ldap/functions/ldap-compare.xml b/reference/ldap/functions/ldap-compare.xml index 551d17bf0d..3713f5ad3a 100644 --- a/reference/ldap/functions/ldap-compare.xml +++ b/reference/ldap/functions/ldap-compare.xml @@ -1,13 +1,13 @@ - - + ldap_compare Compare value of attribute found in entry specified with DN - - Description + + + &reftitle.description; mixedldap_compare resourcelink_identifier @@ -16,13 +16,61 @@ stringvalue - Returns &true; if value matches otherwise returns &false;. Returns -1 on error. + Compare value of attribute + with value of same attribute in an LDAP directory entry. + + + + &reftitle.parameters; - ldap_compare is used to compare value - of attribute to value of same attribute in LDAP directory - entry specified with dn. + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + dn + + + The distinguished name of an LDAP entity. + + + + + attribute + + + The attribute name. + + + + + value + + + The compared value. + + + + + + + + &reftitle.returnvalues; + + Returns &true; if value matches otherwise returns + &false;. Returns -1 on error. + + + + + &reftitle.examples; The following example demonstrates how to check whether or not given password matches the one defined in DN specified entry. @@ -72,17 +120,17 @@ if ($ds) { + + + + &reftitle.notes; ldap_compare can NOT be used to compare BINARY values! - - - This function was added in 4.0.2. - - + - + ldap_connect Connect to an LDAP server - - Description + + + &reftitle.description; resourceldap_connect stringhostname intport - Returns a positive LDAP link identifier on success, or &false; on - error. When OpenLDAP 2.x.x is used, ldap_connect - will always return a resource as it does not actually - connect but just initializes the connecting parameters. The actual - connect happens with the next calls to ldap_* funcs, usually with + Establishes a connection to a LDAP server on a specified + hostname and port. + + + + + &reftitle.parameters; + + + + hostname + + + If you are using OpenLDAP 2.x.x you can specify a URL instead of the + hostname. To use LDAP with SSL, compile OpenLDAP 2.x.x with SSL + support, configure PHP with SSL, and set this parameter as + ldaps://hostname/. + + + + + port + + + The port to connect to. Not used when using URLs. Defaults to 389. + + + + + + + + + &reftitle.returnvalues; + + Returns a positive LDAP link identifier on success, or &false; on error. + When OpenLDAP 2.x.x is used, ldap_connect will always + return a resource as it does not actually connect but just + initializes the connecting parameters. The actual connect happens with + the next calls to ldap_* funcs, usually with ldap_bind. - ldap_connect establishes a connection to a - LDAP server on a specified hostname and - port. Both the arguments are optional. If - no arguments are specified then the link identifier of the - already opened link will be returned. If only - hostname is specified, then the port - defaults to 389. + If no arguments are specified then the link identifier of the already + opened link will be returned. + + + + &reftitle.changelog; - If you are using OpenLDAP 2.x.x you can specify a URL instead of the - hostname. To use LDAP with SSL, compile OpenLDAP 2.x.x with SSL - support, configure PHP with SSL, and use ldaps://hostname/ as - host parameter. The port parameter is not used when using URLs. + + + + + &Version; + &Description; + + + + + 4.0.4 + + URL and SSL support was added. + + + + + - - - URL and SSL support were added in 4.0.4. - - + + + + &reftitle.examples; Example of connecting to LDAP server. @@ -79,11 +126,17 @@ $ldapconn = ldap_connect($ldaphost) + + + + &reftitle.seealso; - See also - ldap_bind. + + ldap_bind + + - + ldap_count_entries Count the number of entries in a search - - Description + + + &reftitle.description; intldap_count_entries resourcelink_identifier resourceresult_identifier - Returns number of entries in the result or &false; on error. - - - ldap_count_entries returns the number of - entries stored in the result of previous search - operations. result_identifier identifies - the internal ldap result. + Returns the number of entries stored in the result of previous search + operations. + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + result_identifier + + + The internal LDAP result. + + + + + + + + + &reftitle.returnvalues; + + Returns number of entries in the result or &false; on error. + + + - + ldap_delete Delete an entry from a directory - - Description + + + &reftitle.description; boolldap_delete resourcelink_identifier stringdn - &return.success; - - - ldap_delete function delete a particular - entry in LDAP directory specified by dn. + Deletes a particular entry in LDAP directory. + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + dn + + + The distinguished name of an LDAP entity. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + - + ldap_dn2ufn Convert DN to User Friendly Naming format - - Description + + + &reftitle.description; stringldap_dn2ufn stringdn - ldap_dn2ufn function is used to turn a DN, - specified by dn, into a more user-friendly form, - stripping off type names. + Turns the specified dn, into a more user-friendly + form, stripping off type names. + + + &reftitle.parameters; + + + + dn + + + The distinguished name of an LDAP entity. + + + + + + + + + &reftitle.returnvalues; + + Returns the user friendly name. + + + - + ldap_err2str Convert LDAP error number into string error message - - Description + + + &reftitle.description; stringldap_err2str interrno - Returns string error message. + Returns the string error message explaining the error number + errno. While LDAP errno numbers are standardized, + different libraries return different or even localized textual error + messages. Never check for a specific error message text, but always use an + error number to check. + + + + &reftitle.parameters; - This function returns the string error message explaining the - error number errno. While LDAP errno numbers - are standardized, different libraries return different or even localized - textual error messages. Never check for a specific error message text, - but always use an error number to check. + + + errno + + + The error number. + + + + + + + + &reftitle.returnvalues; - See also ldap_errno and - ldap_error. + Returns the error message, as a string. + + + + &reftitle.examples; Enumerating all LDAP error messages @@ -41,6 +61,17 @@ + + + &reftitle.seealso; + + + ldap_errno + ldap_error + + + + - + ldap_errno Return the LDAP error number of the last LDAP command - - Description + + + &reftitle.description; intldap_errno resourcelink_identifier + + Returns the standardized error number returned by the last LDAP command. + This number can be converted into a textual error message using + ldap_err2str. + + + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + + + + + &reftitle.returnvalues; Return the LDAP error number of the last LDAP command for this link. + + + + &reftitle.examples; - This function returns the standardized error number returned by - the last LDAP command for the given - link_identifier. This number - can be converted into a textual error message using - ldap_err2str. - - - Unless you lower your warning level in your &php.ini; sufficiently - or prefix your LDAP commands with @ (at) characters to suppress - warning output, the errors generated will also show up in your - HTML output. + Unless you lower your warning level in your &php.ini; sufficiently or + prefix your LDAP commands with @ (at) characters to suppress warning + output, the errors generated will also show up in your HTML output. Generating and catching an error @@ -51,11 +72,18 @@ echo $info["count"] . " matching entries.
\n";
+
+ + + &reftitle.seealso; - See also ldap_err2str and - ldap_error. + + ldap_err2str + ldap_error + +
- + ldap_error Return the LDAP error message of the last LDAP command - - Description + + + &reftitle.description; stringldap_error resourcelink_identifier - Returns string error message. + Returns the string error message explaining the error generated by the + last LDAP command for the given link_identifier. + While LDAP errno numbers are standardized, different libraries return + different or even localized textual error messages. Never check for a + specific error message text, but always use an error number to check. - This function returns the string error message explaining the - error generated by the last LDAP command for the given - link_identifier While LDAP errno numbers - are standardized, different libraries return different or even - localized textual error messages. Never check for a specific error - message text, but always use an error number to check. - - - Unless you lower your warning level in your - &php.ini; sufficiently or prefix your LDAP - commands with @ (at) characters to suppress - warning output, the errors generated will also show up in your + Unless you lower your warning level in your &php.ini; sufficiently or + prefix your LDAP commands with @ (at) characters to + suppress warning output, the errors generated will also show up in your HTML output. + + + + &reftitle.parameters; - See also ldap_err2str and - ldap_errno. + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + + + &reftitle.returnvalues; + + Returns string error message. + + + + + &reftitle.seealso; + + + ldap_err2str + ldap_errno + + + + - + ldap_explode_dn Splits DN into its component parts - - Description + + + &reftitle.description; arrayldap_explode_dn stringdn intwith_attrib - ldap_explode_dn function is used to split - the DN returned by ldap_get_dn and breaks - it up into its component parts. Each part is known as Relative - Distinguished Name, or RDN. ldap_explode_dn - returns an array of all those components. - with_attrib is used to request if the RDNs - are returned with only values or their attributes as well. To - get RDNs with the attributes (i.e. in attribute=value format) set - with_attrib to 0 and to get only values - set it to 1. + Splits the DN returned by ldap_get_dn and breaks it + up into its component parts. Each part is known as Relative Distinguished + Name, or RDN. + + + &reftitle.parameters; + + + + dn + + + The distinguished name of an LDAP entity. + + + + + with_attrib + + + Used to request if the RDNs are returned with only values or their + attributes as well. To get RDNs with the attributes (i.e. in + attribute=value format) set with_attrib to 0 + and to get only values set it to 1. + + + + + + + + + &reftitle.returnvalues; + + Returns an array of all DN components. + + + - + ldap_first_attribute Return first attribute - - Description + + + &reftitle.description; stringldap_first_attribute resourcelink_identifier resourceresult_entry_identifier intber_identifier + + Gets the first attribute in the given entry. Remaining attributes are + retrieved by calling ldap_next_attribute successively. + + + Similar to reading entries, attributes are also read one by one from a + particular entry. + + + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + result_entry_identifier + + + + + + + ber_identifier + + + ber_identifier is the identifier to internal + memory location pointer. It is passed by reference. The same + ber_identifier is passed to + ldap_next_attribute , which modifies that + pointer. + + + + + + + + + &reftitle.returnvalues; Returns the first attribute in the entry on success and &false; on error. - - Similar to reading entries, attributes are also read one by one - from a particular entry. - ldap_first_attribute returns the first - attribute in the entry pointed by the - result_entry_identifier. - Remaining attributes are retrieved by calling - ldap_next_attribute successively. - ber_identifier is the identifier to - internal memory location pointer. It is passed by reference. The - same ber_identifier is passed to the - ldap_next_attribute function, which modifies - that pointer. - - - See also ldap_get_attributes + + + &reftitle.seealso; + + + ldap_next_attribute + ldap_get_attributes + + + + - + ldap_first_entry Return first result id - - Description + + + &reftitle.description; resourceldap_first_entry resourcelink_identifier resourceresult_identifier - Returns the result entry identifier for the first entry on - success and &false; on error. + Returns the entry identifier for first entry in the result. This entry + identifier is then supplied to ldap_next_entry + routine to get successive entries from the result. Entries in the LDAP result are read sequentially using the ldap_first_entry and - ldap_next_entry - functions. ldap_first_entry returns the - entry identifier for first entry in the result. This entry - identifier is then supplied to - ldap_next_entry routine to get successive - entries from the result. - - - See also ldap_get_entries. + ldap_next_entry functions. + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + result_identifier + + + + + + + + + + + &reftitle.returnvalues; + + Returns the result entry identifier for the first entry on success and + &false; on error. + + + + + &reftitle.seealso; + + + ldap_get_entries + + + + - + ldap_first_reference Return first reference - - Description + + + &reftitle.description; resourceldap_first_reference resourcelink resourceresult - - &warn.undocumented.func; - + &warn.undocumented.func; + - + ldap_free_result Free result memory - - Description + + + &reftitle.description; boolldap_free_result resourceresult_identifier - &return.success; + Frees up the memory allocated internally to store the result. All result + memory will be automatically freed when the script terminates. - ldap_free_result frees up the memory - allocated internally to store the result and pointed by the - result_identifier. All result memory will - be automatically freed when the script terminates. - - - Typically all the memory allocated for the ldap result gets freed - at the end of the script. In case the script is making successive - searches which return large result sets, - ldap_free_result could be called to keep the - runtime memory usage by the script low. + Typically all the memory allocated for the LDAP result gets freed at the + end of the script. In case the script is making successive searches which + return large result sets, ldap_free_result could be + called to keep the runtime memory usage by the script low. + + + &reftitle.parameters; + + + + result_identifier + + + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + - + ldap_get_attributes Get attributes from a search result entry - - Description + + + &reftitle.description; arrayldap_get_attributes resourcelink_identifier resourceresult_entry_identifier - Returns a complete entry information in a multi-dimensional array - on success and &false; on error. - - - ldap_get_attributes function is used to - simplify reading the attributes and values from an entry in the - search result. The return value is a multi-dimensional array of - attributes and values. - - - Having located a specific entry in the directory, you can find - out what information is held for that entry by using this - call. You would use this call for an application which "browses" - directory entries and/or where you do not know the structure of - the directory entries. In many applications you will be searching - for a specific attribute such as an email address or a surname, - and won't care what other data is held. + Reads attributes and values from an entry in the search result. + Having located a specific entry in the directory, you can find out what + information is held for that entry by using this call. You would use this + call for an application which "browses" directory entries and/or where you + do not know the structure of the directory entries. In many applications + you will be searching for a specific attribute such as an email address or + a surname, and won't care what other data is held. + + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + result_entry_identifier + + + + + + + + + + + &reftitle.returnvalues; + + Returns a complete entry information in a multi-dimensional array + on success and &false; on error. + + + + + &reftitle.examples; + Show the list of attributes held for a particular directory entry @@ -65,7 +91,7 @@ $attrs = ldap_get_attributes($ds, $entry); echo $attrs["count"] . " attributes held for this entry:<p>"; -for ($i=0; $i<$attrs["count"]; $i++) { +for ($i=0; $i < $attrs["count"]; $i++) { echo $attrs[$i] . "<br />"; } ?> @@ -73,11 +99,18 @@ for ($i=0; $i<$attrs["count"]; $i++) { </programlisting> </example> </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also <function>ldap_first_attribute</function> and - <function>ldap_next_attribute</function>. + <simplelist> + <member><function>ldap_first_attribute</function></member> + <member><function>ldap_next_attribute</function></member> + </simplelist> </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file diff --git a/reference/ldap/functions/ldap-get-dn.xml b/reference/ldap/functions/ldap-get-dn.xml index b3fb3ef73f..d5a5a56ebc 100644 --- a/reference/ldap/functions/ldap-get-dn.xml +++ b/reference/ldap/functions/ldap-get-dn.xml @@ -1,26 +1,53 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- splitted from ./en/functions/ldap.xml, last change in rev 1.2 --> +<!-- $Revision: 1.4 $ --> <refentry id="function.ldap-get-dn"> <refnamediv> <refname>ldap_get_dn</refname> <refpurpose>Get the DN of a result entry</refpurpose> </refnamediv> - <refsect1> - <title>Description + + + &reftitle.description; stringldap_get_dn resourcelink_identifier resourceresult_entry_identifier - Returns the DN of the result entry and &false; on error. - - - ldap_get_dn function is used to find out the - DN of an entry in the result. + Finds out the DN of an entry in the result. + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + result_entry_identifier + + + + + + + + + + + &reftitle.returnvalues; + + Returns the DN of the result entry and &false; on error. + + + - + ldap_get_entries Get all result entries - - Description + + + &reftitle.description; arrayldap_get_entries resourcelink_identifier resourceresult_identifier - Returns a complete result information in a multi-dimensional - array on success and &false; on error. - - - ldap_get_entries function is used to - simplify reading multiple entries from the result, specified with - result_identifier, and then - reading the attributes and multiple values. The entire - information is returned by one function call in a - multi-dimensional array. The structure of the array is as - follows. + Reads multiple entries from the given result, and then reading the + attributes and multiple values. + + + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + result_identifier + + + + + + + + + + + &reftitle.returnvalues; + + Returns a complete result information in a multi-dimensional array on + success and &false; on error. + The structure of the array is as follows. The attribute index is converted to lowercase. (Attributes are case-insensitive for directory servers, but not when used as array indices.) @@ -48,12 +71,18 @@ return_value[i]["attribute"][j] = jth value of attribute in ith entry + + + &reftitle.seealso; - See also ldap_first_entry and - ldap_next_entry. + + ldap_first_entry + ldap_next_entry + + - + ldap_get_option Get the current value for given option - - Description + + + &reftitle.description; boolldap_get_option resourcelink_identifier @@ -16,22 +16,110 @@ Sets retval to the value of the specified option. + + + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + option + + + The parameter option can be one of: + + + + + Option + Type + + + + + LDAP_OPT_DEREF + integer + + + LDAP_OPT_SIZELIMIT + integer + + + LDAP_OPT_TIMELIMIT + integer + + + LDAP_OPT_PROTOCOL_VERSION + integer + + + LDAP_OPT_ERROR_NUMBER + integer + + + LDAP_OPT_REFERRALS + bool + + + LDAP_OPT_RESTART + bool + + + LDAP_OPT_HOST_NAME + string + + + LDAP_OPT_ERROR_STRING + string + + + LDAP_OPT_MATCHED_DN + string + + + LDAP_OPT_SERVER_CONTROLS + array + + + LDAP_OPT_CLIENT_CONTROLS + array + + + + + + + + + retval + + + This will be set to the option value. + + + + + + + + + &reftitle.returnvalues; + &return.success; - - The parameter option can be one of: - LDAP_OPT_DEREF, LDAP_OPT_SIZELIMIT, LDAP_OPT_TIMELIMIT, - LDAP_OPT_PROTOCOL_VERSION, LDAP_OPT_ERROR_NUMBER, LDAP_OPT_REFERRALS, - LDAP_OPT_RESTART, LDAP_OPT_HOST_NAME, LDAP_OPT_ERROR_STRING, - LDAP_OPT_MATCHED_DN. These are described in - draft-ietf-ldapext-ldap-c-api-xx.txt - - - - This function is only available when using OpenLDAP 2.x.x OR - Netscape Directory SDK x.x, and was added in PHP 4.0.4 - - + + + + &reftitle.examples; Check protocol version @@ -49,10 +137,27 @@ if (ldap_get_option($ds, LDAP_OPT_PROTOCOL_VERSION, $version)) { + + + + &reftitle.notes; + + + This function is only available when using OpenLDAP 2.x.x OR Netscape + Directory SDK x.x. + + + + + + &reftitle.seealso; - See also ldap_set_option. + + ldap_set_option + + - + ldap_get_values_len Get all binary values from a result entry - - Description + + + &reftitle.description; arrayldap_get_values_len resourcelink_identifier @@ -15,29 +15,54 @@ stringattribute - Returns an array of values for the attribute on success and &false; - on error. + Reads all the values of the attribute in the entry in the result. - ldap_get_values_len function is used to read all - the values of the attribute in the entry in the result. entry is - specified by the - result_entry_identifier. The number of - values can be found by indexing "count" in the resultant - array. Individual values are accessed by integer index in the - array. The first index is 0. + This function is used exactly like ldap_get_values + except that it handles binary data and not string data. - - This function is used exactly like - ldap_get_values except that it handles - binary data and not string data. - - - - This function was added in 4.0. - - + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + result_entry_identifier + + + + + + + attribute + + + + + + + + + + + &reftitle.returnvalues; + + Returns an array of values for the attribute on success and &false; on + error. Individual values are accessed by integer index in the array. The + first index is 0. The number of values can be found by indexing "count" + in the resultant array. + + + - + ldap_get_values Get all values from a result entry - - Description + + + &reftitle.description; arrayldap_get_values resourcelink_identifier @@ -15,17 +15,7 @@ stringattribute - Returns an array of values for the attribute on success and &false; - on error. - - - ldap_get_values function is used to read all - the values of the attribute in the entry in the result. entry is - specified by the - result_entry_identifier. The number of - values can be found by indexing "count" in the resultant - array. Individual values are accessed by integer index in the - array. The first index is 0. + Reads all the values of the attribute in the entry in the result. This call needs a result_entry_identifier, @@ -38,10 +28,50 @@ the ldap_get_attributes call to work out what attributes exist for a given entry. + + + + &reftitle.parameters; - LDAP allows more than one entry for an attribute, so it can, for - example, store a number of email addresses for one person's - directory entry all labeled with the attribute "mail" + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + result_entry_identifier + + + + + + + attribute + + + + + + + + + + + &reftitle.returnvalues; + + Returns an array of values for the attribute on success and &false; on + error. The number of values can be found by indexing "count" in the + resultant array. Individual values are accessed by integer index in the + array. The first index is 0. + + + LDAP allows more than one entry for an attribute, so it can, for example, + store a number of email addresses for one person's directory entry all + labeled with the attribute "mail" return_value["count"] = number of values for attribute @@ -49,6 +79,12 @@ return_value[i] = ith value of attribute + + + + + &reftitle.examples; + List all values of the "mail" attribute for a directory entry @@ -76,6 +112,7 @@ for ($i=0; $i < $values["count"]; $i++) { + - + ldap_list Single-level search - - Description + + + &reftitle.description; resourceldap_list resourcelink_identifier @@ -19,38 +19,194 @@ inttimelimit intderef + + Performs the search for a specified filter on the + directory with the scope LDAP_SCOPE_ONELEVEL. + + + LDAP_SCOPE_ONELEVEL means that the search should only + return information that is at the level immediately below the + base_dn given in the call. + (Equivalent to typing "ls" and getting a list of files and folders in the + current working directory.) + + + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + base_dn + + + The base DN for the directory. + + + + + filter + + + + + + + attributes + + + An array of the required attributes, e.g. array("mail", "sn", "cn"). + Note that the "dn" is always returned irrespective of which attributes + types are requested. + + + Using this parameter is much more efficient than the default action + (which is to return all attributes and their associated values). + The use of this parameter should therefore be considered good + practice. + + + + + attrsonly + + + Should be set to 1 if only attribute types are wanted. If set to 0 + both attributes types and attribute values are fetched which is the + default behaviour. + + + + + sizelimit + + + Enables you to limit the count of entries fetched. Setting this to 0 + means no limit. + + + + This parameter can NOT override server-side preset sizelimit. You can + set it lower though. + + + Some directory server hosts will be configured to return no more than + a preset number of entries. If this occurs, the server will indicate + that it has only returned a partial results set. This also occurs if + you use this parameter to limit the count of fetched entries. + + + + + + timelimit + + + Sets the number of seconds how long is spend on the search. Setting + this to 0 means no limit. + + + + This parameter can NOT override server-side preset sizelimit. You can + set it lower though. + + + + + + deref + + + Specifies how aliases should be handled during the search. It can be + one of the following: + + + + LDAP_DEREF_NEVER - (default) aliases are never + dereferenced. + + + + + LDAP_DEREF_SEARCHING - aliases should be + dereferenced during the search but not when locating the base object + of the search. + + + + + LDAP_DEREF_FINDING - aliases should be + dereferenced when locating the base object but not during the search. + + + + + LDAP_DEREF_ALWAYS - aliases should be dereferenced + always. + + + + + + + + + + + + &reftitle.returnvalues; Returns a search result identifier or &false; on error. - - ldap_list performs the search for a specified - filter on the directory with the scope - LDAP_SCOPE_ONELEVEL. - - - LDAP_SCOPE_ONELEVEL means that the search should only return - information that is at the level immediately below the - base_dn given in the call. - (Equivalent to typing "ls" and getting a list - of files and folders in the current working directory.) - - - This call takes 5 optional parameters. See ldap_search - notes. - - - These optional parameters were added in 4.0.2: - attrsonly, - sizelimit, - timelimit, - deref. - - + - - Produce a list of all organizational units of an organization - - + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 4.0.5 + + Parallel searches support was added. See + ldap_search for details. + + + + 4.0.2 + + The attrsonly, sizelimit, + timelimit and deref were + added. + + + + + + + + + + &reftitle.examples; + + + Produce a list of all organizational units of an organization + - - - From 4.0.5 on it's also possible to do parallel searches. See - ldap_search for details. - - - + + + + &reftitle.seealso; + + + ldap_search + + + + - + ldap_mod_add Add attribute values to current attributes - - Description + + + &reftitle.description; boolldap_mod_add resourcelink_identifier stringdn arrayentry + + Adds one or more attributes to the specified dn. + It performs the modification at the attribute level as opposed to the + object level. Object-level additions are done by the + ldap_add function. + + + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + dn + + + The distinguished name of an LDAP entity. + + + + + entry + + + + + + + + + + + &reftitle.returnvalues; &return.success; - - This function adds attribute(s) to the specified - dn. It performs the modification at the - attribute level as opposed to the object level. Object-level additions - are done by the ldap_add function. - - - ¬e.bin-safe; - + + + &reftitle.notes; + ¬e.bin-safe; + + - + ldap_mod_del Delete attribute values from current attributes - - Description + + + &reftitle.description; boolldap_mod_del resourcelink_identifier @@ -15,15 +15,51 @@ arrayentry - &return.success; - - - This function removes attribute(s) from the specified - dn. It performs the modification at the - attribute level as opposed to the object level. Object-level - deletions are done by the ldap_delete function. + Removes one or more attributes from the specified dn. + It performs the modification at the attribute level as opposed to the object + level. Object-level deletions are done by the + ldap_delete function. + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + dn + + + The distinguished name of an LDAP entity. + + + + + entry + + + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + - + ldap_mod_replace Replace attribute values with new ones - - Description + + + &reftitle.description; boolldap_mod_replace resourcelink_identifier stringdn arrayentry + + Replaces one or more attributes from the specified dn. + It performs the modification at the attribute level as opposed to the object + level. Object-level modifications are done by the + ldap_modify function. + + + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + dn + + + The distinguished name of an LDAP entity. + + + + + entry + + + + + + + + + + + &reftitle.returnvalues; &return.success; - - This function replaces attribute(s) from the specified - dn. It performs the modification at the attribute - level as opposed to the object level. Object-level modifications are done - by the ldap_modify function. - - - ¬e.bin-safe; - + + + &reftitle.notes; + ¬e.bin-safe; + + - + ldap_modify Modify an LDAP entry - - Description + + + &reftitle.description; boolldap_modify resourcelink_identifier @@ -15,17 +15,54 @@ arrayentry - &return.success; - - - ldap_modify function is used to modify the - existing entries in the LDAP directory. The structure of the + Modify the existing entries in the LDAP directory. The structure of the entry is same as in ldap_add. - - ¬e.bin-safe; - + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + dn + + + The distinguished name of an LDAP entity. + + + + + entry + + + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.notes; + ¬e.bin-safe; + + - + ldap_next_attribute Get the next attribute in result - - Description + + + &reftitle.description; stringldap_next_attribute resourcelink_identifier @@ -15,22 +15,61 @@ resourceber_identifier - Returns the next attribute in an entry on success and &false; on - error. - - - ldap_next_attribute is called to retrieve - the attributes in an entry. The internal state of the pointer is - maintained by the ber_identifier. It is - passed by reference to the function. The first call to + Retrieves the attributes in an entry. The first call to ldap_next_attribute is made with the result_entry_identifier returned from ldap_first_attribute. + + + + &reftitle.parameters; - See also ldap_get_attributes + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + result_entry_identifier + + + + + + + ber_identifier + + + The internal state of the pointer is maintained by this parameter. + + + + + + + &reftitle.returnvalues; + + Returns the next attribute in an entry on success and &false; on + error. + + + + + &reftitle.seealso; + + + ldap_get_attributes + + + + - + ldap_next_entry Get next result entry - - Description + + + &reftitle.description; resourceldap_next_entry resourcelink_identifier resourceresult_entry_identifier - Returns entry identifier for the next entry in the result whose - entries are being read starting with - ldap_first_entry. If there are no more - entries in the result then it returns &false;. - - - ldap_next_entry function is used to retrieve - the entries stored in the result. Successive calls to the - ldap_next_entry return entries one by one - till there are no more entries. The first call to - ldap_next_entry is made after the call to - ldap_first_entry with the - result_entry_identifier - as returned from the ldap_first_entry. - - - See also ldap_get_entries + Retrieve the entries stored in the result. Successive calls to the + ldap_next_entry return entries one by one till there + are no more entries. The first call to ldap_next_entry + is made after the call to ldap_first_entry with the + result_entry_identifier as returned from the + ldap_first_entry. + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + result_entry_identifier + + + + + + + + + + + &reftitle.returnvalues; + + Returns entry identifier for the next entry in the result whose entries + are being read starting with ldap_first_entry. If + there are no more entries in the result then it returns &false;. + + + + + &reftitle.seealso; + + + ldap_get_entries + + + + - + ldap_next_reference Get next reference - - Description + + + &reftitle.description; resourceldap_next_reference resourcelink resourceentry - - &warn.undocumented.func; - + &warn.undocumented.func; + - + ldap_parse_reference Extract information from reference entry - - Description + + + &reftitle.description; boolldap_parse_reference resourcelink resourceentry arrayreferrals - - &warn.undocumented.func; - + &warn.undocumented.func; + - + ldap_parse_result Extract information from result - - Description + + + &reftitle.description; boolldap_parse_result resourcelink @@ -17,10 +17,9 @@ stringerrmsg arrayreferrals - - &warn.undocumented.func; - + &warn.undocumented.func; + - + ldap_read Read an entry - - Description + + + &reftitle.description; resourceldap_read resourcelink_identifier @@ -20,39 +20,186 @@ intderef - Returns a search result identifier or &false; on error. - - - ldap_read performs the search for a - specified filter on the directory with the scope - LDAP_SCOPE_BASE. So it is equivalent to reading an entry from the - directory. - - - An empty filter is not allowed. If you want to retrieve - absolutely all information for this entry, use a filter of - "objectClass=*". If you know which entry types are used on the - directory server, you might use an appropriate filter such as - "objectClass=inetOrgPerson". - - - This call takes 5 optional parameters. See ldap_search - notes. - - - - These optional parameters were added in 4.0.2: - attrsonly, - sizelimit, - timelimit, - deref. - - - - From 4.0.5 on it's also possible to do parallel searches. See - ldap_search for details. + Performs the search for a specified filter on the + directory with the scope LDAP_SCOPE_BASE. So it is + equivalent to reading an entry from the directory. + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + base_dn + + + The base DN for the directory. + + + + + filter + + + An empty filter is not allowed. If you want to retrieve absolutely all + information for this entry, use a filter of + objectClass=*. If you know which entry types are + used on the directory server, you might use an appropriate filter such + as objectClass=inetOrgPerson. + + + + + attributes + + + An array of the required attributes, e.g. array("mail", "sn", "cn"). + Note that the "dn" is always returned irrespective of which attributes + types are requested. + + + Using this parameter is much more efficient than the default action + (which is to return all attributes and their associated values). + The use of this parameter should therefore be considered good + practice. + + + + + attrsonly + + + Should be set to 1 if only attribute types are wanted. If set to 0 + both attributes types and attribute values are fetched which is the + default behaviour. + + + + + sizelimit + + + Enables you to limit the count of entries fetched. Setting this to 0 + means no limit. + + + + This parameter can NOT override server-side preset sizelimit. You can + set it lower though. + + + Some directory server hosts will be configured to return no more than + a preset number of entries. If this occurs, the server will indicate + that it has only returned a partial results set. This also occurs if + you use this parameter to limit the count of fetched entries. + + + + + + timelimit + + + Sets the number of seconds how long is spend on the search. Setting + this to 0 means no limit. + + + + This parameter can NOT override server-side preset sizelimit. You can + set it lower though. + + + + + + deref + + + Specifies how aliases should be handled during the search. It can be + one of the following: + + + + LDAP_DEREF_NEVER - (default) aliases are never + dereferenced. + + + + + LDAP_DEREF_SEARCHING - aliases should be + dereferenced during the search but not when locating the base object + of the search. + + + + + LDAP_DEREF_FINDING - aliases should be + dereferenced when locating the base object but not during the search. + + + + + LDAP_DEREF_ALWAYS - aliases should be dereferenced + always. + + + + + + + + + + + + &reftitle.returnvalues; + + Returns a search result identifier or &false; on error. + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 4.0.5 + + Parallel searches support was added. + See ldap_search for details. + + + + 4.0.2 + + The attrsonly, sizelimit, + timelimit and deref were + added. + + + + + + + + - + ldap_rename Modify the name of an entry - - Description + + + &reftitle.description; boolldap_rename resourcelink_identifier @@ -18,21 +18,77 @@ The entry specified by dn is renamed/moved. - The new RDN is specified by newrdn and the - new parent/superior entry is specified - by newparent. If the parameter - deleteoldrdn is &true; the old RDN value(s) - is removed, else the old RDN value(s) is retained as - non-distinguished values of the entry. &return.success; + + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + dn + + + The distinguished name of an LDAP entity. + + + + + newrdn + + + The new RDN. + + + + + newparent + + + The new parent/superior entry. + + + + + deleteoldrdn + + + If &true; the old RDN value(s) is removed, else the old RDN value(s) + is retained as non-distinguished values of the entry. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.notes; - This function currently only works with LDAPv3. You may have - to use ldap_set_option prior to binding to - use LDAPv3. This function is only available when using OpenLDAP 2.x.x OR - Netscape Directory SDK x.x, and was added in PHP 4.0.5. + + This function currently only works with LDAPv3. You may have to use + ldap_set_option prior to binding to use LDAPv3. This + function is only available when using OpenLDAP 2.x.x OR Netscape + Directory SDK x.x. + + ldap_sasl_bind Bind to LDAP directory using SASL - - Description + + + &reftitle.description; boolldap_sasl_bind resourcelink @@ -17,9 +18,18 @@ stringsasl_authz_id stringprops - &warn.undocumented.func; + + + + &reftitle.returnvalues; + + &return.success; + + + + &reftitle.notes; Requirement @@ -29,8 +39,8 @@ otherwise this function will be undefined. - + - + ldap_search Search LDAP tree - - Description + + + &reftitle.description; resourceldap_search resourcelink_identifier @@ -19,101 +19,203 @@ inttimelimit intderef + + Performs the search for a specified filter on the directory with the scope + of LDAP_SCOPE_SUBTREE. This is equivalent to searching + the entire directory. + + + From 4.0.5 on it's also possible to do parallel searches. To do this + you use an array of link identifiers, rather than a single identifier, + as the first argument. If you don't want the same base DN and the + same filter for all the searches, you can also use an array of base DNs + and/or an array of filters. Those arrays must be of the same size as + the link identifier array since the first entries of the arrays are + used for one search, the second entries are used for another, and so + on. When doing parallel searches an array of search result + identifiers is returned, except in case of error, then the entry + corresponding to the search will be &false;. This is very much like + the value normally returned, except that a result identifier is always + returned when a search was made. There are some rare cases where the + normal search returns &false; while the parallel search returns an + identifier. + + + + + &reftitle.parameters; + + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + base_dn + + + The base DN for the directory. + + + + + filter + + + The search filter can be simple or advanced, using boolean operators in + the format described in the LDAP documentation (see the Netscape Directory SDK for full + information on filters). + + + + + attributes + + + An array of the required attributes, e.g. array("mail", "sn", "cn"). + Note that the "dn" is always returned irrespective of which attributes + types are requested. + + + Using this parameter is much more efficient than the default action + (which is to return all attributes and their associated values). + The use of this parameter should therefore be considered good + practice. + + + + + attrsonly + + + Should be set to 1 if only attribute types are wanted. If set to 0 + both attributes types and attribute values are fetched which is the + default behaviour. + + + + + sizelimit + + + Enables you to limit the count of entries fetched. Setting this to 0 + means no limit. + + + + This parameter can NOT override server-side preset sizelimit. You can + set it lower though. + + + Some directory server hosts will be configured to return no more than + a preset number of entries. If this occurs, the server will indicate + that it has only returned a partial results set. This also occurs if + you use this parameter to limit the count of fetched entries. + + + + + + timelimit + + + Sets the number of seconds how long is spend on the search. Setting + this to 0 means no limit. + + + + This parameter can NOT override server-side preset sizelimit. You can + set it lower though. + + + + + + deref + + + Specifies how aliases should be handled during the search. It can be + one of the following: + + + + LDAP_DEREF_NEVER - (default) aliases are never + dereferenced. + + + + + LDAP_DEREF_SEARCHING - aliases should be + dereferenced during the search but not when locating the base object + of the search. + + + + + LDAP_DEREF_FINDING - aliases should be + dereferenced when locating the base object but not during the search. + + + + + LDAP_DEREF_ALWAYS - aliases should be dereferenced + always. + + + + + + + + + + + + &reftitle.returnvalues; Returns a search result identifier or &false; on error. + + + + &reftitle.changelog; - ldap_search performs the search for a - specified filter on the directory with the scope of - LDAP_SCOPE_SUBTREE. This is equivalent to searching the entire - directory. base_dn specifies the base DN - for the directory. - - - There is an optional fourth parameter, that can be added to - restrict the attributes and values returned by the server to just - those required. This is much more efficient than the default - action (which is to return all attributes and their associated - values). The use of the fourth parameter should therefore be - considered good practice. - - - The fourth parameter is a standard PHP string array of the - required attributes, e.g. array("mail", "sn", "cn") Note that the - "dn" is always returned irrespective of which attributes types - are requested. - - - Note too that some directory server hosts will be configured to - return no more than a preset number of entries. If this occurs, - the server will indicate that it has only returned a partial - results set. This occurs also if the sixth parameter - sizelimit has been used to limit the count - of fetched entries. - - - The fifth parameter attrsonly should be - set to 1 if only attribute types are wanted. - If set to 0 both attributes types and attribute values are fetched - which is the default behaviour. - - - With the sixth parameter sizelimit it is - possible to limit the count of entries fetched. - Setting this to 0 means no limit. - NOTE: This parameter can NOT override server-side preset sizelimit. - You can set it lower though. - - - The seventh parameter timelimit sets the number - of seconds how long is spend on the search. - Setting this to 0 means no limit. - NOTE: This parameter can NOT override server-side preset timelimit. - You can set it lower though. - - - The eighth parameter deref specifies how aliases - should be handled during the search. It can be one of the following: - - - - LDAP_DEREF_NEVER - (default) aliases are never dereferenced. - - - - - LDAP_DEREF_SEARCHING - aliases should be dereferenced during the search - but not when locating the base object of the search. - - - - - LDAP_DEREF_FINDING - aliases should be dereferenced when - locating the base object but not during the search. - - - - - LDAP_DEREF_ALWAYS - aliases should be dereferenced always. - - - - - - - These optional parameters were added in 4.0.2: - attrsonly, - sizelimit, - timelimit, - deref. - - - - The search filter can be simple or advanced, using boolean - operators in the format described in the LDAP documentation (see - the Netscape Directory SDK - for full information on filters). + + + + + &Version; + &Description; + + + + + 4.0.5 + + Parallel searches support was added. + + + + 4.0.2 + + The attrsonly, sizelimit, + timelimit and deref were + added. + + + + + + + + + &reftitle.examples; The example below retrieves the organizational unit, surname, given name and email address for all people in "My Company" where @@ -143,23 +245,8 @@ echo $info["count"]." entries returned\n"; - - From 4.0.5 on it's also possible to do parallel searches. To do this - you use an array of link identifiers, rather than a single identifier, - as the first argument. If you don't want the same base DN and the - same filter for all the searches, you can also use an array of base DNs - and/or an array of filters. Those arrays must be of the same size as - the link identifier array since the first entries of the arrays are - used for one search, the second entries are used for another, and so - on. When doing parallel searches an array of search result - identifiers is returned, except in case of error, then the entry - corresponding to the search will be &false;. This is very much like - the value normally returned, except that a result identifier is always - returned when a search was made. There are some rare cases where the - normal search returns &false; while the parallel search returns an - identifier. - + - + ldap_set_option Set the value of the given option - - Description + + + &reftitle.description; boolldap_set_option resourcelink_identifier @@ -15,45 +15,127 @@ mixednewval - Sets the value of the specified option to be - newval. &return.success; - on error. + Sets the value of the specified option to be newval. + + + + &reftitle.parameters; - The parameter option can be one of: - LDAP_OPT_DEREF, LDAP_OPT_SIZELIMIT, LDAP_OPT_TIMELIMIT, - LDAP_OPT_PROTOCOL_VERSION, LDAP_OPT_ERROR_NUMBER, LDAP_OPT_REFERRALS, - LDAP_OPT_RESTART, LDAP_OPT_HOST_NAME, LDAP_OPT_ERROR_STRING, - LDAP_OPT_MATCHED_DN, LDAP_OPT_SERVER_CONTROLS, LDAP_OPT_CLIENT_CONTROLS. - Here's a brief description, see draft-ietf-ldapext-ldap-c-api-xx.txt - for details. + + + link_identifier + + + An LDAP link identifier, returned by ldap_connect. + + + + + option + + + The parameter option can be one of: + + + + + Option + Type + + + + + LDAP_OPT_DEREF + integer + + + LDAP_OPT_SIZELIMIT + integer + + + LDAP_OPT_TIMELIMIT + integer + + + LDAP_OPT_PROTOCOL_VERSION + integer + + + LDAP_OPT_ERROR_NUMBER + integer + + + LDAP_OPT_REFERRALS + bool + + + LDAP_OPT_RESTART + bool + + + LDAP_OPT_HOST_NAME + string + + + LDAP_OPT_ERROR_STRING + string + + + LDAP_OPT_MATCHED_DN + string + + + LDAP_OPT_SERVER_CONTROLS + array + + + LDAP_OPT_CLIENT_CONTROLS + array + + + + + + + LDAP_OPT_SERVER_CONTROLS and + LDAP_OPT_CLIENT_CONTROLS require a list of + controls, this means that the value must be an array of controls. A + control consists of an oid identifying the control, + an optional value, and an optional flag for + criticality. In PHP a control is given by an + array containing an element with the key oid + and string value, and two optional elements. The optional + elements are key value with string value + and key iscritical with boolean value. + iscritical defaults to &false; + if not supplied. See draft-ietf-ldapext-ldap-c-api-xx.txt + for details. See also the second example below. + + + + + newval + + + The new value for the specified option. + + + + + + + + &reftitle.returnvalues; - The options LDAP_OPT_DEREF, LDAP_OPT_SIZELIMIT, LDAP_OPT_TIMELIMIT, - LDAP_OPT_PROTOCOL_VERSION and LDAP_OPT_ERROR_NUMBER have integer value, - LDAP_OPT_REFERRALS and LDAP_OPT_RESTART have boolean value, and the - options LDAP_OPT_HOST_NAME, LDAP_OPT_ERROR_STRING and LDAP_OPT_MATCHED_DN - have string value. The first example illustrates their use. The options - LDAP_OPT_SERVER_CONTROLS and LDAP_OPT_CLIENT_CONTROLS require a list of - controls, this means that the value must be an array of controls. A - control consists of an oid identifying the control, - an optional value, and an optional flag for - criticality. In PHP a control is given by an - array containing an element with the key oid - and string value, and two optional elements. The optional - elements are key value with string value - and key iscritical with boolean value. - iscritical defaults to &false; - if not supplied. See also the second example below. + &return.success; - - - This function is only available when using - OpenLDAP 2.x.x OR Netscape Directory SDK x.x, and was - added in PHP 4.0.4. - - + + + + &reftitle.examples; Set protocol version @@ -81,17 +163,35 @@ $ctrl1 = array("oid" => "1.2.752.58.10.1", "iscritical" => true); // iscritical defaults to FALSE $ctrl2 = array("oid" => "1.2.752.58.1.10", "value" => "magic"); // try to set both controls -if (!ldap_set_option($ds, LDAP_OPT_SERVER_CONTROLS, array($ctrl1, $ctrl2))) +if (!ldap_set_option($ds, LDAP_OPT_SERVER_CONTROLS, array($ctrl1, $ctrl2))) { echo "Failed to set server controls"; +} ?> ]]> + + + + &reftitle.notes; + + + This function is only available when using OpenLDAP 2.x.x OR Netscape + Directory SDK x.x. + + + + + + &reftitle.seealso; - See also ldap_get_option. + + ldap_get_option + + - + ldap_set_rebind_proc Set a callback function to do re-binds on referral chasing - - Description + + + &reftitle.description; boolldap_set_rebind_proc resourcelink callbackcallback - - &warn.undocumented.func; - + &warn.undocumented.func; + - + ldap_sort Sort LDAP result entries - - Description + + + &reftitle.description; boolldap_sort resourcelink resourceresult stringsortfilter - - &warn.undocumented.func; - + &warn.undocumented.func; + - + ldap_start_tls Start TLS - - Description + + + &reftitle.description; boolldap_start_tls resourcelink - - &warn.undocumented.func; - + &warn.undocumented.func; + - + ldap_t61_to_8859 Translate t61 characters to 8859 characters - - Description + + + &reftitle.description; stringldap_t61_to_8859 stringvalue - - &warn.undocumented.func; - + &warn.undocumented.func; + - + ldap_unbind Unbind from LDAP directory - - Description + + + &reftitle.description; boolldap_unbind resourcelink_identifier - &return.success; - - - ldap_unbind function unbinds from the LDAP - directory. + Unbinds from the LDAP directory. + + + &reftitle.returnvalues; + + &return.success; + + +