Skip to content

Commit

Permalink
Merge branch '2.8' into 3.0
Browse files Browse the repository at this point in the history
* 2.8:
  Remove old File Upload article + improve the new one
  Added documentation for the Ldap component

Conflicts:
	reference/configuration/security.rst
  • Loading branch information
xabbuh committed May 29, 2016
2 parents 436a6a1 + b5c09b3 commit ad76b72
Show file tree
Hide file tree
Showing 14 changed files with 898 additions and 619 deletions.
11 changes: 5 additions & 6 deletions book/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1917,19 +1917,18 @@ HTML form so that the user can modify that data. The second goal of a form is to
take the data submitted by the user and to re-apply it to the object.

There's still much more to learn about the powerful world of forms, such as
how to handle
:doc:`file uploads with Doctrine </cookbook/doctrine/file_uploads>` or how
to create a form where a dynamic number of sub-forms can be added (e.g. a
todo list where you can keep adding more fields via JavaScript before submitting).
how to handle :doc:`file uploads </cookbook/controller/upload_file>` or how to
create a form where a dynamic number of sub-forms can be added (e.g. a todo
list where you can keep adding more fields via JavaScript before submitting).
See the cookbook for these topics. Also, be sure to lean on the
:doc:`field type reference documentation </reference/forms/types>`, which
includes examples of how to use each field type and its options.

Learn more from the Cookbook
----------------------------

* :doc:`/cookbook/doctrine/file_uploads`
* :doc:`FileType Reference </reference/forms/types/file>`
* :doc:`/cookbook/controller/upload_file`
* :doc:`File Field Reference </reference/forms/types/file>`
* :doc:`Creating Custom Field Types </cookbook/form/create_custom_field_type>`
* :doc:`/cookbook/form/form_customization`
* :doc:`/cookbook/form/dynamic_form_modification`
Expand Down
1 change: 1 addition & 0 deletions components/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The Components
http_foundation/index
http_kernel/index
intl
ldap
options_resolver
phpunit_bridge
process
Expand Down
72 changes: 72 additions & 0 deletions components/ldap.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.. index::
single: Ldap
single: Components; Ldap

The Ldap Component
==================

The Ldap component provides a means to connect to an LDAP server (OpenLDAP or Active Directory).

Installation
------------

You can install the component in 2 different ways:

* :doc:`Install it via Composer </components/using_components>` (``symfony/ldap`` on `Packagist`_);
* Use the official Git repository (https://github.com/symfony/ldap).

.. include:: /components/require_autoload.rst.inc

Usage
-----

The :class:`Symfony\\Component\\Ldap\\LdapClient` class provides methods
to authenticate and query against an LDAP server.

The :class:`Symfony\\Component\\Ldap\\LdapClient` class can be configured
using the following options:

``host``
IP or hostname of the LDAP server

``port``
Port used to access the LDAP server

``version``
The version of the LDAP protocol to use

``useSsl``
Whether or not to secure the connection using SSL

``useStartTls``
Whether or not to secure the connection using StartTLS

``optReferrals``
Specifies whether to automatically follow referrals
returned by the LDAP server

For example, to connect to a start-TLS secured LDAP server::

use Symfony\Component\Ldap\LdapClient;

$ldap = new LdapClient('my-server', 389, 3, false, true);

The :method:`Symfony\\Component\\Ldap\\LdapClient::bind` method
authenticates a previously configured connection using both the
distinguished name (DN) and the password of a user::

use Symfony\Component\Ldap\LdapClient;
// ...

$ldap->bind($dn, $password);

Once bound (or if you enabled anonymous authentication on your
LDAP server), you may query the LDAP server using the
:method:`Symfony\\Component\\Ldap\\LdapClient::find` method::

use Symfony\Component\Ldap\LdapClient;
// ...

$ldap->find('dc=symfony,dc=com', '(&(objectclass=person)(ou=Maintainers))');

.. _Packagist: https://packagist.org/packages/symfony/ldap
4 changes: 4 additions & 0 deletions components/map.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@

* :doc:`/components/intl`

* **Ldap**

* :doc:`/components/ldap`

* **OptionsResolver**

* :doc:`/components/options_resolver`
Expand Down
Loading

0 comments on commit ad76b72

Please sign in to comment.