tags:

views:

322

answers:

3

I'm working profesionally on a php web application which contains contacts, among other data. I was wondering how hard it would be to make this data available to external programs using the LDAP protocol.

Are there specific tools out there for this? I couldn't really find anything, but I can't imagine I'm the first to think about this.


Edit 1: What I'm looking for is a way to have an application (like a mail client) to be able to use a standard ldap lookup to find contacts from my data.

There are no limitations on using third party software or a separate ldap server on my side, but I want the clients to simply be able to use the built-in ldap connectivity of their application of choice.

What I could see is an ldap server which uses my database or service in my application for serving data as if my application itself is an ldap server. I'd prefer a solution like this, because I don't feel it's right to bloat the application with ldap functionality if I can use an external server for this.

A: 

Are you wanting to implement an LDAP server in PHP, or just exchange data?

You might think about implementing something like LDIF if you just want to exchange data.

Phill Sacre
+3  A: 

The LDAP server protocol is big, and I don't think there is a PHP server in existence. I would suggest running an LDAP server and pushing records to it.

I like OpenLDAP, but there are plenty of servers out there, depending on your platform. Even ActiveDirectory is an LDAP server.

Typically, LDAP objects have internal tracking attributes. For example, OpenLDAP has modifyTimestamp which looks something like 20080306214429Z. These don't get returned by the server unless you specifically ask for them in your query.

It would be easy enough to write a crontab to compare modified times in LDAP and your database. If the LDAP modifyTimestamp was older than in your database, update the record.

Gary Richardson
+1  A: 

Rather than trying to get an LDAP server to use your database, I'd recommend storing your data in the LDAP server. You can create custom fields for anything that doesn't fit in the standard LDAP fields.

Scott Reynen