[dev] [patch] Turba LDAP driver fix - edit ldap entry without dn attribute

Ben Davis ben.davis at pca-wichita.com
Fri Apr 2 09:15:13 PST 2004


> This doesn't make sense to me - $this->_params['dn'] should be an 
> array. How
> would it ever be a key in $attributes?
>
My Bad.. It should have read if(in_array('dn',array_keys($attributes)).. 
But that's actually not right either. I didn't realize that the 
$attributes keys are intended to be the values of $params['dn'].

I initially misunderstood how this worked. I guess I didn't understand 
initially why we needed $params['dn'] to be an array because I don't 
usually see dn's for users in the format of 
"cn=username,uid=username,ou=Users,dc=example,dc=com".. it's usually 
just "uid=username,ou=Users,dc=example,dc=com" But I guess it is always 
possible, so what needs to happen is this:

Because it is possible that the user did not configure the values of 
$params['dn'] as turba attributes (for instance, if the user's 
$params['dn']=array('cn','uid'); and they don't have $attributes['cn'] 
or $attributes['uid']),  We need to make sure those entries exists in 
$attributes.  I'm not sure about the best way to do this, though. I 
guess we could loop through $attributes and see if any of its keys match 
the values in $this->_params['dn'], otherwise we could just require that 
those values be entered in attributes.php.

What do you think?



More information about the dev mailing list