zendframework / zend-ldap

Ldap component from Zend Framework
BSD 3-Clause "New" or "Revised" License
29 stars 29 forks source link

feature request for ldap_mod_add() functionality #5

Closed Touchwoody closed 7 years ago

Touchwoody commented 9 years ago

Hey there,

could you introduce a function (I'd sugg. append()?) that uses ldap_mod_add() ?

Right now the only way to push values to the LDAP server is via update(), and for this to work I have to push the old value plus the new values. For a multi-value field such an array can get very large.

This is particularly troublesome, if you update e.g. the "member" attribute in a GroupOfNames object, which is used by openldap's memberof overlay. if I update the server with probably thousands of values, this might lead to a server timeout, cause the memberof overlay does "stuff" (updates? index? sanity checks?). We could avoid this difficulties, if we'd only append (like ldap_mod_add() does) a new value, instead of pushing the whole array back. Unfortunately Zend\Ldap doesn't offer this mechanism.

heiglandreas commented 9 years ago

This is linked to a SO-question which might contain more details: https://stackoverflow.com/questions/31288742/appending-values-to-a-multi-value-ldap-attribute-with-zend-ldap/31289134#31289134

heiglandreas commented 9 years ago

@Touchwoody you can (as a workaround) do this:

$ldap = new \Zend\Ldap\Ldap(...);
$res = $ldap->getResource(); 

ldap_mod_add($res, ...);

(See also Issue #4)

mwillbanks commented 9 years ago

Closing due to inactivity and a workaround / answer exists.

heiglandreas commented 9 years ago

Reopening as it's a valid feature-request

martinjinda commented 8 years ago

+1 for this feature

heiglandreas commented 7 years ago

This has been fixed with release 2.8.0