php-doc-en/reference/ldap/functions/ldap-exop.xml
Christoph Michael Becker bd8f8383a3 Fix build
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@346169 c90b9560-bf6c-de11-be94-00142212c4b1
2018-12-04 17:12:42 +00:00

194 lines
5.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.ldap-exop" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ldap_exop</refname>
<refpurpose>Performs an extended operation</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>ldap_exop</methodname>
<methodparam><type>resource</type><parameter>link</parameter></methodparam>
<methodparam><type>string</type><parameter>reqoid</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>reqdata</parameter><initializer>&null;</initializer></methodparam>
<methodparam choice="opt"><type>array</type><parameter>serverctrls</parameter><initializer>&null;</initializer></methodparam>
<methodparam choice="opt"><type>string</type><parameter role="reference">retdata</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter role="reference">retoid</parameter></methodparam>
</methodsynopsis>
<para>
Performs an extended operation on the specified <parameter>link</parameter> with
<parameter>reqoid</parameter> the OID of the operation and
<parameter>reqdata</parameter> the data.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>link</parameter></term>
<listitem>
<para>
An LDAP link identifier, returned by <function>ldap_connect</function>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>reqoid</parameter></term>
<listitem>
<para>
The extended operation request OID. You may use one of <constant>LDAP_EXOP_START_TLS</constant>, <constant>LDAP_EXOP_MODIFY_PASSWD</constant>, <constant>LDAP_EXOP_REFRESH</constant>, <constant>LDAP_EXOP_WHO_AM_I</constant>, <constant>LDAP_EXOP_TURN</constant>, or a string with the OID of the operation you want to send.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>reqdata</parameter></term>
<listitem>
<para>
The extended operation request data. May be NULL for some operations like <constant>LDAP_EXOP_WHO_AM_I</constant>, may also need to be BER encoded.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>serverctrls</parameter></term>
<listitem>
<para>
Array of <link linkend="ldap.controls">LDAP Controls</link> to send with the request.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>retdata</parameter></term>
<listitem>
<para>
Will be filled with the extended operation response data if provided.
If not provided you may use ldap_parse_exop on the result object
later to get this data.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>retoid</parameter></term>
<listitem>
<para>
Will be filled with the response OID if provided, usually equal to the request OID.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
When used with <parameter>retdata</parameter>, returns &true; on success or &false; on error.
When used without <parameter>retdata</parameter>, returns a result identifier or &false; on error.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>7.3</entry>
<entry>
Support for <parameter>serverctrls</parameter> added
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Whoami extended operation</title>
<programlisting role="php">
<![CDATA[
<?php
$ds = ldap_connect("localhost"); // assuming the LDAP server is on this host
if ($ds) {
// bind with appropriate dn to give update access
$bind = ldap_bind($ds, "cn=root, o=My Company, c=US", "secret");
if (!$bind) {
echo "Unable to bind to LDAP server";
exit;
}
// Call WHOAMI EXOP
$r = ldap_exop($ds, LDAP_EXOP_WHO_AM_I);
// Parse the result object
ldap_parse_exop($ds, $r, $retdata);
// Output: string(31) "dn:cn=root, o=My Company, c=US"
var_dump($retdata);
// Same thing using $retdata parameter
$success = ldap_exop($ds, LDAP_EXOP_WHO_AM_I, NULL, NULL, $retdata, $retoid);
if ($success) {
var_dump($retdata);
}
ldap_close($ds);
} else {
echo "Unable to connect to LDAP server";
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>ldap_parse_result</function></member>
<member><function>ldap_parse_exop</function></member>
<member><function>ldap_exop_whoami</function></member>
<member><function>ldap_exop_refresh</function></member>
<member><function>ldap_exop_passwd</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->