I've been unable to create users with optional "ldapdata" attributes. I traced the problem down to the generated LDIF : some attributes had "empty" values and so, the syntax is incorrect. Example :
dn: uid=cc,ou=uu,dc=x,dc=y
objectClass: top
objectClass: inetOrgPerson
objectClass: MyorgUser
uid: cc
mail: valid.mail@address.com
givenName: xx
sn: xx
cn: xx
userPassword: xx
orgMyOrgJID:
labeledURI: my.web.address
l:
I had a look at the LDAP logs and figured out the problem in this LDIF was the optional orgMyOrgJID which had not a correct syntax (i.e. empty).
So I had to patch line 1831 (use "!empty" instead of "isset") in ldapprov.module :
replace
if (isset($ldapdata_options[$attribute]) && $ldapdata_options[$attribute] > 0 && isset($data['ldap_'. $attribute]) ) {
with
if (isset($ldapdata_options[$attribute]) && $ldapdata_options[$attribute] > 0 && !empty($data['ldap_'. $attribute]) ) {
And it works !
Comments
Comment #1
miglius CreditAttribution: miglius commentedCommitted. Thanks!