Download the PHP package volicon/ldap without Composer
On this page you can find all versions of the php package volicon/ldap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package ldap
LDAP package for Laravel 4.x
This composer package is an attempt to provide a way to search through an Ldap Directory like you would query a database with Eloquent.
Installing
Declare a dependency on this package in your composer.json file:
Next, run composer update to pull in the code.
Add the service provider to config/app :
Add the facade to the alias array (also in config/app):
You then need to publish and customize the config file to indicate the location of your ldap server and also set your dn, attributes etc.
You're now ready to use this package !
Usage
First remember to set ALL your config parameters. All sections have been well documented in the comments. Any attribute that you want to retrieve MUST be specified in the 'attributes' array.
- Return an attribute from one member of your organisation :
All those possibilities should return the same string (our user's displayname) :
- Return multiple attributes for a single member of organisation :
This should return :
If you change the key in your config to some attribute like 'login' for exemple, you get :
NOTE : You don't need to add the 'key' attribute's value in the 'attributes' array in the config. The package does that for you.
- Return multiple attributes from multiple members of the organisation :
This should return :
You can also return all the attributes you've set in the 'attributes' config property :
- Query the Ldap Directory based on a wildcard :
You get a result looking something like this :
You get the idea !!
- Authenticate against the Ldap Directory :
Will simply return TRUE or FALSE.
NOTE : Don't forget to set the dn attribute in config for user authentication.
TODOs :
There is still a lot of work ahead to make this package complete. Here's a list of what you could expect in the future :
- Create / update attributes from the Ldap. For now, the package can only read the Ldap.
- Query multiple Organisation Units (Ldap branches, or OU. ex. : People, Groups, Mail, ...). This should work pretty soon...
- Use Active Directory and Open Ldap. For now, only Open Ldap directories work.