Hi Lars,
>I=27m not quite clear on your problem. Using =27add=27 should just add
another
>value to the list, regardless of what is there already, and without
touching
>previous data.
Thanks for your help. It works now - I don=27t know what went wrong in
the first place.
As I don=27t know beforehand whatever combination of add, delete, and/or
replace I=27ll have, I was trying to do the following:
my =40Adds =3D ();
my =40Deletes =3D ();
=5B...=5D
if (=40Adds) =7B
=24result->entry(0)->add(=27ACL=27 =3D> =5C=40Adds);
=7D
if (=40Deletes) =7B
=24result->entry(0)->delete(=27ACL=27 =3D> =5C=40Deletes);
=7D
if ((=40Adds) =7C=7C (=40Deletes)) =7B
=24result->entry(0)->update(=24ldap);
=7D
As I said, I don=27t know what went wrong - for some reason my reference
to =5C=40Received: from Skjaerlund-MTA by porter.spinn.dk
Adds (and =5C=40Deletes) didn=27t work - I got errors like =27no =
such
attribute=27 etc.
But it works now.
>If you on the other hand mean =27replace=27, here=27s an earlier
>discussions from this list:
>
>--cut--
>> The semantics of LDAP modify=27s =27replace=27 replaces all values of =
an
>> attribute with a new set of values.
>>
>> If you want to remove just one value, use the modify =27delete=27 value
>> option.
>> You can use the =27delete=27 and =27add=27 options in the same modify
operation
>> to
>> get an atomic update of a single value.
>--cut--
>
>An example:
>
>--cut--
>=24ldap->modify( =24dn,
> changes =3D> =5B
> delete =3D> =5B telephoneNumber =3D> =5B=27911=27=5D=5D, =23 delete =
phone number
911
> add =3D> =5B telephoneNumber =3D> =5B=27112=27=5D=5D, =23 add =
phone number 112
> =5D
> );
>--cut--
Again, thanks a lot: That was my next headache ;-). I had started
looking for a replace function, but the above works as well.
Regards,
Lars
Lars Skj=E6rlund, Network Consultant, Spinn International ApS
Bukkeballevej 30, 2960 Rungsted Kyst, Denmark
Tel.: +45 70 25 88 10, Fax: +45 70 25 88 44
Mail: lars=40spinn.dk Web: http://www.spinn.dk
--
|