mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-19 10:28:54 +00:00

for file in `find -name '*.xml'`; do sed -i -e 's/<initializer>null<\/initializer>/<initializer>\&null;<\/initializer>/i' $file; done git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@298918 c90b9560-bf6c-de11-be94-00142212c4b1
160 lines
3.6 KiB
XML
160 lines
3.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<refentry xml:id="function.ldap-bind" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>ldap_bind</refname>
|
|
<refpurpose>Bind to LDAP directory</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>ldap_bind</methodname>
|
|
<methodparam><type>resource</type><parameter>link_identifier</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>bind_rdn</parameter><initializer>&null;</initializer></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>bind_password</parameter><initializer>&null;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Binds to the LDAP directory with specified RDN and password.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>link_identifier</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
An LDAP link identifier, returned by <function>ldap_connect</function>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>bind_rdn</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>bind_password</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
<para>
|
|
If <parameter>bind_rdn</parameter> and <parameter>bind_password</parameter>
|
|
are not specified, an anonymous bind is attempted.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Using LDAP Bind</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
// using ldap bind
|
|
$ldaprdn = 'uname'; // ldap rdn or dn
|
|
$ldappass = 'password'; // associated password
|
|
|
|
// connect to ldap server
|
|
$ldapconn = ldap_connect("ldap.example.com")
|
|
or die("Could not connect to LDAP server.");
|
|
|
|
if ($ldapconn) {
|
|
|
|
// binding to ldap server
|
|
$ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);
|
|
|
|
// verify binding
|
|
if ($ldapbind) {
|
|
echo "LDAP bind successful...";
|
|
} else {
|
|
echo "LDAP bind failed...";
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
<example>
|
|
<title>Using LDAP Bind Anonymously</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
//using ldap bind anonymously
|
|
|
|
// connect to ldap server
|
|
$ldapconn = ldap_connect("ldap.example.com")
|
|
or die("Could not connect to LDAP server.");
|
|
|
|
if ($ldapconn) {
|
|
|
|
// binding anonymously
|
|
$ldapbind = ldap_bind($ldapconn);
|
|
|
|
if ($ldapbind) {
|
|
echo "LDAP bind anonymous successful...";
|
|
} else {
|
|
echo "LDAP bind anonymous failed...";
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>ldap_unbind</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
|
|
-->
|