[turba] RDN uniqueness using LDAP with Turba

Lux horde at iotti.biz
Wed May 27 12:49:58 UTC 2009


Hi all

This seems to be a faq, but I did not find a general answer which does not
involve patching Turba in some non-general way.

I have an address book in a text file, with records like this:
Name: john
Surname: smith
Company: acme

Name: andy
Surname: smith
Company: techc

Name: ben
Surname: syrus
Company: acme

I imported them in ldap with a script that generates the following ldif, to
avoid colliding dn (I left out not impotant details):
Dn: cn=john.smith.acme,dc=org
Cn: john.smith.acme
Givenname: john
Sn: smith
O: acme

Dn: cn=andy.smith.techc,dc=org
Cn: andy.smith.techc
Givenname: andy
Sn: smith
O: techc

Dn: cn=ben.syrus.acme,dc=org
Cn: ben.syrus.acme
Givenname: ben
Sn: syrus
O: acme

Then I did the following mappings in Turba sources.php:
'map' => array(
  'name' => array('fields' => array('firstname', 'lastname', 'company'),
'format' => '%s %s %s'),
  'firstname' => 'givenname',
  'lastname' => 'sn',
  'company' => 'o',


I can import my ldif and use my new ldap db. The problem comes when I want
to add a new cntact in Turba.
If I use
'dn' => array('givename')
I get errors because of colliding dn in different records (more than one
people can have the same username).

If I use 
'dn' => array('givename','sn')
I get an error about non-existent object: to store
Dn: givenname=john,sn=smith,dc=org
I must already have something like
Dn: sn=smith,dc=org
But I don't want to have to build it.

I could use
'dn' => array('uid')
But this doesn't please me much: I like to be able to browse my ldap tree
with something understandable in the dn.

The ideal solution, for me, would be to have Turba to generate the DNs like
this:
Dn: cn=name.surname.company,dc=ord

Is there a way to make it do so?
If the answer is no, would it be useful to write some patch to make it
possible?

Thanks 
Luigi



More information about the turba mailing list