On Tue, Jun 17, 2008 at 5:48 AM, Toppka <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> I've interesting in this topic too. I've started to dive into LDAP
> wrapper for cake php for a few days. Have you find how to map LDAP
> data source to cake php app model in cake php 1.2?
>
Hi,
You simply need to configure the LDAP connection in your
app/config/database.php. For example:
var $ldap = array(
'database' => '',
'datasource' => 'ldap',
'host' => '127.0.0.1',
'port' => 389,
'basedn' => 'dc=example,dc=com',
'login' => 'cn=admin,dc=example,dc=com',
'password' => 'your-bind-password',
'version' => 3
);
In your app/model/whatever.php, you make it look something similar to:
var $useDbConfig = 'ldap';
var $useTable = ''; // can be used to strict searching to, say,
ou=Something
var $primaryKey = 'uid'; // unique attribute in your LDAP records
var $additionalFilter = 'objectclass='inetOrgPerson'; // additional
strict searching to, for example, only return records that contain this
objectclass
You then need to setup the LDAP datasource itself. Please see the following
link:
http://memdump.wordpress.com/2008/04/26/ldap-data-source-now-with-full-crud/
The class is far from perfect, but IWFM. If you find any bugs, it'd be great
if you can report them and/or supply patches to improve it.
Good luck!
- Gonzalo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---