Date: 11/28/98
- Next message: eschmid: "[PHP-DEV] CVS update: php3/doc/functions"
- Previous message: eschmid: "[PHP-DEV] CVS update: php3/doc/chapters"
- Next in thread: eschmid: "[PHP-DEV] CVS update: php3/doc/functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Saturday November 28, 1998 @ 16:14
Author: eschmid
Update of /repository/php3/doc/functions
In directory asf:/u2/tmp/cvs-serv2608/functions
Modified Files:
ldap.sgml
Log Message:
An attempt to improve the LDAP section for the online docs.
Index: php3/doc/functions/ldap.sgml
diff -c php3/doc/functions/ldap.sgml:1.22 php3/doc/functions/ldap.sgml:1.23
*** php3/doc/functions/ldap.sgml:1.22 Sat Nov 7 11:59:18 1998
--- php3/doc/functions/ldap.sgml Sat Nov 28 16:14:14 1998
***************
*** 291,300 ****
<paramdef>int <parameter>link_identifier</parameter></paramdef>
</funcsynopsis>
<para>
! Returns true on success, false on error.
! <para>
! ldap_close() closes the link to the LDAP server that's associated with
! the specified <parameter>link</parameter> identifier.
</refsect1>
</refentry>
--- 291,306 ----
<paramdef>int <parameter>link_identifier</parameter></paramdef>
</funcsynopsis>
<para>
! Returns true on success, false on error.
! <para>
! <function>ldap_close</function> closes the link to the LDAP
! server that's associated with the specified
! <parameter>link_identifier</parameter>.
! <para>
! This call is internally identical to
! <function>ldap_unbind</function>. The LDAP API uses the call
! <function>ldap_unbind</function>, so perhaps you should use this
! in preference to <function>ldap_close</function>.
</refsect1>
</refentry>
***************
*** 503,530 ****
<funcsynopsis>
<funcdef>array <function>ldap_get_attributes</function></funcdef>
<paramdef>int <parameter>link_identifier</parameter></paramdef>
! <paramdef>int <parameter>result_entry_identifier</parameter></paramdef>
</funcsynopsis>
<para>
! Returns a comlete entry information in a multi-dimensional array on success
! and false on error.
! <para>
! 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.
! <para>
! <informalexample><literallayout>
! return_value["count"] = number of attributes in the entry
! return_value[0] = first attribute
! return_value[n] = nth attribute
!
! return_value["attribute"]["count"] = number of values for attribute
! return_value["attribute"][0] = first value of the attribute
! return_value["attribute"][i] = ith value of the attribute
</literallayout></informalexample>
see also <function>ldap_first_attribute</function> and
<function>ldap_next_attribute</function>
</refsect1>
</refentry>
--- 509,567 ----
<funcsynopsis>
<funcdef>array <function>ldap_get_attributes</function></funcdef>
<paramdef>int <parameter>link_identifier</parameter></paramdef>
! <paramdef>int
! <parameter>result_entry_identifier</parameter></paramdef>
</funcsynopsis>
<para>
! Returns a comlete entry information in a multi-dimensional array
! on success and false on error.
! <para>
! <function>ldap_get_attributes</function> 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.
! <para>
! 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.
! <para>
! <informalexample><literallayout>
! return_value["count"] = number of attributes in the entry
! return_value[0] = first attribute
! return_value[n] = nth attribute
!
! return_value["attribute"]["count"] = number of values for attribute
! return_value["attribute"][0] = first value of the attribute
! return_value["attribute"][i] = ith value of the attribute
</literallayout></informalexample>
+ <example>
+ <title>Show the list of attributes held for a particular directory
+ entry </title>
+ <programlisting role=php>
+ // $ds is the link identifier for the directory
+
+ // $sr is a valid search result from a prior call to
+ // one of the ldap directory search calls
+
+ $entry = ldap_first_entry($ds, $sr);
+
+ $attrs = ldap_get_attributes($ds, $entry);
+
+ echo $attrs["count"]." attributes held for this entry:<p>";
+
+ for ($i=0; $i<$attrs["count"]; $i++)
+ echo $attrs[$i]."<br>";
+ </programlisting>
+ </example>
+
see also <function>ldap_first_attribute</function> and
<function>ldap_next_attribute</function>
+
</refsect1>
</refentry>
***************
*** 542,551 ****
<paramdef>int <parameter>result_entry_identifier</parameter></paramdef>
</funcsynopsis>
<para>
! Returns the DN of the result entry and false on error.
! <para>
! ldap_get_dn() function is used to find out the DN of an entry in the
! result.
</refsect1>
</refentry>
--- 579,588 ----
<paramdef>int <parameter>result_entry_identifier</parameter></paramdef>
</funcsynopsis>
<para>
! Returns the DN of the result entry and false on error.
! <para>
! <function>ldap_get_dn</function> function is used to find out the
! DN of an entry in the result.
</refsect1>
</refentry>
***************
*** 563,591 ****
<paramdef>int <parameter>result_identifier</parameter></paramdef>
</funcsynopsis>
<para>
! Returns a complete result information in a multi-dimenasional array on
! success and false on error.
<para>
! ldap_get_entries() function is used to simplify reading multiple entries
! from the result 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.
! <para>
! The attribute index is converted to lowercase. (Attributes are case-
! insensitive for directory servers, but not when used as array indices)
! <para>
<informalexample>
<literallayout>
! return_value["count"] = number of entries in the result
! return_value[0] : refers to the details of first entry
! return_value[i]["dn"] = DN of the ith entry in the result
! return_value[i]["count"] = number of attributes in ith entry
! return_value[i][j] = jth attribute in the ith entry in the result
! return_value[i]["attribute"]["count"] = number of values for attribute in ith entry
! return_value[i]["attribute"][j] = jth value of attribute in ith entry
</literallayout>
</informalexample>
--- 600,632 ----
<paramdef>int <parameter>result_identifier</parameter></paramdef>
</funcsynopsis>
<para>
! Returns a complete result information in a multi-dimenasional
! array on success and false on error.
<para>
! <function>ldap_get_entries</function> function is used to
! simplify reading multiple entries from the result 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.
! <para>
! The attribute index is converted to lowercase. (Attributes are
! case- insensitive for directory servers, but not when used as
! array indices)
!
<informalexample>
<literallayout>
! return_value["count"] = number of entries in the result
! return_value[0] : refers to the details of first entry
! return_value[i]["dn"] = DN of the ith entry in the result
! return_value[i]["count"] = number of attributes in ith entry
! return_value[i][j] = jth attribute in the ith entry in the result
! return_value[i]["attribute"]["count"] = number of values for
! attribute in ith entry
! return_value[i]["attribute"][j] = jth value of attribute in ith entry
</literallayout>
</informalexample>
***************
*** 609,629 ****
<paramdef>string <parameter>attribute</parameter></paramdef>
</funcsynopsis>
<para>
! Returns an array of values for the attribute on success and false on error.
<para>
! 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
! <parameter>result_entry_identifier</parameter>. 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.
! <para>
! <informalexample>
<literallayout>
! return_value["count"] = number of values for attribute
! return_value[0] = first value of attribute
! return_value[i] = ith value of attribute
</literallayout>
! </informalexample>
</refsect1>
</refentry>
--- 650,674 ----
<paramdef>string <parameter>attribute</parameter></paramdef>
</funcsynopsis>
<para>
! Returns an array of values for the attribute on success and false
! on error.
<para>
! <function>ldap_get_values</function> function is used to read all
! the values of the attribute in the entry in the result. entry is
! specified by the
! <parameter>result_entry_identifier</parameter>. 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.
!
! <informalexample>
<literallayout>
! return_value["count"] = number of values for attribute
! return_value[0] = first value of attribute
! return_value[i] = ith value of attribute
</literallayout>
! </informalexample>
!
</refsect1>
</refentry>
***************
*** 642,652 ****
<paramdef>string <parameter>filter</parameter></paramdef>
</funcsynopsis>
<para>
! Returns a search result identifier or false on error.
! <para>
! ldap_list() performs the search for a specified filter on the directory
! with the scope LDAP_SCOPE_ONELEVEL.
! </refsect1>
</refentry>
--- 687,723 ----
<paramdef>string <parameter>filter</parameter></paramdef>
</funcsynopsis>
<para>
! Returns a search result identifier or false on error.
! <para>
! <function>ldap_list</function> performs the search for a specified
! filter on the directory with the scope LDAP_SCOPE_ONELEVEL.
! <para>
! 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.)
! <para>
! This call takes an optional fourth parameter which is an array of
! the attributes required. See <function>ldap_search</function>
! notes.
! <example>
! <title>Produce a list of all organizational units of an organization
! </title>
! <programlisting role=php3>
! // $ds is a valid link identifier for a directory server
!
! $basedn = "o=My Company, c=US";
! $justthese = array("ou");
!
! $sr=ldap_list($ds, $basedn, "ou=*", $justthese);
!
! $info = ldap_get_entries($ds, $sr);
!
! for ($i=0; $i<$info["count"]; $i++)
! echo $info[$i]["ou"][0] ;
! </programlisting>
! </example>
! </refsect1>
</refentry>
-- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe <email protected> For help: php-dev-help <email protected>
- Next message: eschmid: "[PHP-DEV] CVS update: php3/doc/functions"
- Previous message: eschmid: "[PHP-DEV] CVS update: php3/doc/chapters"
- Next in thread: eschmid: "[PHP-DEV] CVS update: php3/doc/functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

