cvs: phpdoc /en/functions ldap.xml

From: Date: Thu, 18 Jan 2001 23:26:49 +0000
Subject: cvs: phpdoc /en/functions ldap.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969333731@lists.php.net to get a copy of this message
venaas Thu Jan 18 15:26:49 2001 EDT Modified files: /phpdoc/en/functions ldap.xml Log: Added details on controls to ldap_set_option() doc Index: phpdoc/en/functions/ldap.xml diff -u phpdoc/en/functions/ldap.xml:1.22 phpdoc/en/functions/ldap.xml:1.23 --- phpdoc/en/functions/ldap.xml:1.22 Sun Oct 29 12:10:08 2000 +++ phpdoc/en/functions/ldap.xml Thu Jan 18 15:26:48 2001 @@ -1538,11 +1538,30 @@ 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 - <ulink url="&url.ldap.openldap-c-api;">draft-ietf-ldapext-ldap-c-api-xx.txt</ulink></para> - <para>This function is only available when using OpenLDAP 2.x.x OR Netscape Directory SDK x.x, and was + LDAP_OPT_MATCHED_DN, LDAP_OPT_SERVER_CONTROLS, LDAP_OPT_CLIENT_CONTROLS. + Here's a brief description, see + <ulink url="&url.ldap.openldap-c-api;">draft-ietf-ldapext-ldap-c-api-xx.txt</ulink> for details.</para> + <para> + 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 <emphasis>oid</emphasis> identifying the control, + an optional <emphasis>value</emphasis>, and an optional flag for + <emphasis>criticality</emphasis>. In PHP a control is given by an + array containing an element with the key <emphasis>oid</emphasis> + and string value, and two optional elements. The optional + elements are key <emphasis>value</emphasis> with string value + and key <emphasis>iscritical</emphasis> with boolean value. + <emphasis>iscritical</emphasis> defaults to <emphasis>FALSE</emphasis> + if not supplied. See also the second example below.</para> + <para> + 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</para> - <para> <example> <title>Set protocol version</title> @@ -1554,8 +1573,20 @@ echo "Failed to set protocol version to 3"; </programlisting> </example> + <example> + <title>Set server controls</title> +<programlisting role="php"> +// $ds is a valid link identifier for a directory server +// control with no value +$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))) + echo "Failed to set server controls"; +</programlisting> + </example> </para> - <para> See also <function>ldap_get_option</function>.</para> </refsect1>

« previous php.doc (#969333731) next »