From: Joseph K. <jk...@do...> - 2002-05-07 19:53:43
|
I have a strange request. An abbreviated entry looks like this ________________________ cn: Joe Smith mail: js...@do... memberOfGroup: cn=3DAll Staff,ou=3DGroups,o=3DVermont Department of = Corrections,c=3DUS memberOfGroup: cn=3DMIS,ou=3DGroups,o=3DVermont Department of = Corrections,c=3DUS memberOfGroup: cn=3DSecurity,ou=3DGroups,o=3DVermont Department of = Corrections,c=3DUS memberOfGroup: cn=3DRoot,ou=3DGroups,o=3DVermont Department of = Corrections,c=3DUS _________________________ What I want to do is remove a single memberOfGroup attribute(eg = cn=3DRoot). I don't think what I am looking for is = $entry->delete('memberOfGroup') as this will erase all of my attributes = called memberOfGroup. Is there a method I am missing to aid me in removing a very precise = attribute. Or do I need to script it by hand liek this?: @memberships =3D $entry->get_value('memberOfGroup'); $entry->delete('memberOfGroup'); foreach (@memberships) { $entry->add(memberOfGroup=3D>"$_") if ($_ ne = "cn=3DRoot,ou=3DGroups,o=3DVermont Department of Corrections,c=3DUS"); } Is this the most efficient way? |