mirror of
https://github.com/php/doc-de.git
synced 2026-03-23 23:02:13 +01:00
342 lines
11 KiB
XML
342 lines
11 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 85d9a34e16732043af52954a069a020b8c30ec50 Maintainer: nobody Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<!-- Rev-Revision: bc90525a5a5ebcf8412ef34b8355d2de12166fff Reviewer: samesch -->
|
|
<refentry xml:id="function.ldap-set-option" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>ldap_set_option</refname>
|
|
<refpurpose>Setzt den Wert der gegebenen Option</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>ldap_set_option</methodname>
|
|
<methodparam><type class="union"><type>LDAP\Connection</type><type>null</type></type><parameter>ldap</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>option</parameter></methodparam>
|
|
<methodparam><type class="union"><type>array</type><type>string</type><type>int</type><type>bool</type></type><parameter>value</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Setzt den Wert der angegebenen Option auf <parameter>value</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>ldap</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Entweder eine von <function>ldap_connect</function> zurückgegebene
|
|
<classname>LDAP\Connection</classname>-Instanz, um die Option für diese
|
|
Verbindung zu setzen, oder &null;, um die Option global zu setzen.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>option</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Der Parameter <parameter>option</parameter> kann einer der folgenden
|
|
Werte sein:
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>Option</entry>
|
|
<entry>Typ</entry>
|
|
<entry>Verfügbar seit</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_DEREF</constant></entry>
|
|
<entry><type>int</type></entry>
|
|
<entry/>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_SIZELIMIT</constant></entry>
|
|
<entry><type>int</type></entry>
|
|
<entry/>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_TIMELIMIT</constant></entry>
|
|
<entry><type>int</type></entry>
|
|
<entry/>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_NETWORK_TIMEOUT</constant></entry>
|
|
<entry><type>int</type></entry>
|
|
<entry/>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_PROTOCOL_VERSION</constant></entry>
|
|
<entry><type>int</type></entry>
|
|
<entry/>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_ERROR_NUMBER</constant></entry>
|
|
<entry><type>int</type></entry>
|
|
<entry/>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_REFERRALS</constant></entry>
|
|
<entry><type>bool</type></entry>
|
|
<entry/>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_RESTART</constant></entry>
|
|
<entry><type>bool</type></entry>
|
|
<entry/>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_HOST_NAME</constant></entry>
|
|
<entry><type>string</type></entry>
|
|
<entry/>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_ERROR_STRING</constant></entry>
|
|
<entry><type>string</type></entry>
|
|
<entry/>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_DIAGNOSTIC_MESSAGE</constant></entry>
|
|
<entry><type>string</type></entry>
|
|
<entry/>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_MATCHED_DN</constant></entry>
|
|
<entry><type>string</type></entry>
|
|
<entry/>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_SERVER_CONTROLS</constant></entry>
|
|
<entry><type>array</type></entry>
|
|
<entry/>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_CLIENT_CONTROLS</constant></entry>
|
|
<entry><type>array</type></entry>
|
|
<entry/>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_X_KEEPALIVE_IDLE</constant></entry>
|
|
<entry><type>int</type></entry>
|
|
<entry>PHP 7.1.0</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_X_KEEPALIVE_PROBES</constant></entry>
|
|
<entry><type>int</type></entry>
|
|
<entry>PHP 7.1.0</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_X_KEEPALIVE_INTERVAL</constant></entry>
|
|
<entry><type>int</type></entry>
|
|
<entry>PHP 7.1.0</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_X_TLS_CACERTDIR</constant></entry>
|
|
<entry><type>string</type></entry>
|
|
<entry>PHP 7.1.0</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_X_TLS_CACERTFILE</constant></entry>
|
|
<entry><type>string</type></entry>
|
|
<entry>PHP 7.1.0</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_X_TLS_CERTFILE</constant></entry>
|
|
<entry><type>string</type></entry>
|
|
<entry>PHP 7.1.0</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_X_TLS_CIPHER_SUITE</constant></entry>
|
|
<entry><type>string</type></entry>
|
|
<entry>PHP 7.1.0</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_X_TLS_CRLCHECK</constant></entry>
|
|
<entry><type>int</type></entry>
|
|
<entry>PHP 7.1.0</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_X_TLS_CRLFILE</constant></entry>
|
|
<entry><type>string</type></entry>
|
|
<entry>PHP 7.1.0</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_X_TLS_DHFILE</constant></entry>
|
|
<entry><type>string</type></entry>
|
|
<entry>PHP 7.1.0</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_X_TLS_KEYFILE</constant></entry>
|
|
<entry><type>string</type></entry>
|
|
<entry>PHP 7.1.0</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_X_TLS_PROTOCOL_MIN</constant></entry>
|
|
<entry><type>int</type></entry>
|
|
<entry>PHP 7.1.0</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_X_TLS_RANDOM_FILE</constant></entry>
|
|
<entry><type>string</type></entry>
|
|
<entry>PHP 7.1.0</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LDAP_OPT_X_TLS_REQUIRE_CERT</constant></entry>
|
|
<entry><type>int</type></entry>
|
|
<entry>PHP 7.0.5</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
<para>
|
|
Die Optionen <constant>LDAP_OPT_SERVER_CONTROLS</constant> und
|
|
<constant>LDAP_OPT_CLIENT_CONTROLS</constant> benötigen eine Liste von
|
|
Steuerelementen, &dh; der Wert muss ein Array aus Steuerelementen
|
|
sein. Ein Steuerelement besteht aus einer <emphasis>OID</emphasis>, die
|
|
das Steuerelement identifiziert, einem optionalen
|
|
<emphasis>Wert</emphasis>, und einem optionalen Kennzeichen für die
|
|
<emphasis>Kritikalität</emphasis>. Bei PHP wird ein Steuerelement durch
|
|
ein Array angegeben. Dieses Array enthält ein Element mit dem Schlüssel
|
|
<emphasis>oid</emphasis> und einer Zeichenkette als Wert und zwei
|
|
optionale Elemente. Die optionalen Elemente sind die Schlüssel
|
|
<emphasis>value</emphasis> mit einer Zeichenkette als Wert und
|
|
<emphasis>iscritical</emphasis> mit einem booleschen Wert. Der
|
|
vorgegebene Wert von <emphasis>iscritical</emphasis> ist
|
|
<emphasis>&false;</emphasis>, falls nicht angegeben. Siehe
|
|
<link xlink:href="&url.ldap.openldap-c-api;">draft-ietf-ldapext-ldap-c-api-xx.txt</link>
|
|
für Details. Ebenso ist das zweite Beispiel weiter unten zu
|
|
konsultieren.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Alle TLS-Optionen müssen global gesetzt werden, bevor
|
|
<function>ldap_connect</function> bei einer LDAPS-Verbindung oder bevor
|
|
<function>ldap_start_tls</function> bei einer Klartextverbindung
|
|
aufgerufen wird.
|
|
</para>
|
|
</note>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>value</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Der neue Wert für die angegebene <parameter>option</parameter>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
&ldap.changelog.ldap-object;
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Setzen der Protokollversion</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// $ds ist eine gültige LDAP\Connection-Instanz für einen Verzeichnis-Server
|
|
if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3))
|
|
echo "Verwenden von LDAPv3";
|
|
} else {
|
|
echo "Kann das Protokoll nicht auf Version 3 setzen";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
<example>
|
|
<title>Setzen der Server-Steuerelemente</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// $ds ist eine gültige LDAP\Connection-Instanz für einen Verzeichnis-Server
|
|
// Steuerelement ohne Wert
|
|
$ctrl1 = array("oid" => "1.2.752.58.10.1", "iscritical" => true);
|
|
// iscritical hat den vorgegebenen Wert FALSE
|
|
$ctrl2 = array("oid" => "1.2.752.58.1.10", "value" => "magic");
|
|
// Versuch, beide Steuerelemente zu setzen
|
|
if (!ldap_set_option($ds, LDAP_OPT_SERVER_CONTROLS, array($ctrl1, $ctrl2))) {
|
|
echo "Kann die Server-Steuerelemente nicht setzen";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<note>
|
|
<para>
|
|
Diese Funktion steht nur zur Verfügung, wenn OpenLDAP 2.x.x ODER Netscape
|
|
Directory SDK x.x verwendet wird.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>ldap_get_option</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
|
|
-->
|