LDAP uses a "PREFIX" notation for its filters.
For example:
OR condition
(|(attr1=val1)(attr2=val2)(attr1=val2))
AND condition
(&(attr1=val1)(attr2=val2)(attr1=val2))
In your case, the filter criteria will be this:
filter = "(|(uid=name1)(uid=name2)(uid=name3))"
The above filter means:
Find any user who has uid=name1
OR uid=name2
OR uid=name3
.
This should list you users whose user IDs are name1, name2 or name3.
More Exmples:
Equality: (attribute=abc)
, e.g. (&(objectclass=user)(displayName=JohnDoe))
Negation: (!(attribute=abc))
, e.g. (!objectClass=group)
Presence: (attribute=*)
, e.g. (mailNickName=*)
Absence: (!(attribute=*))
, e.g. (!proxyAddresses=*)
Greater than: (attribute>=abc)
, e.g. (storageQuota>=100000)
Less than: (attribute<=abc)
, e.g. (storageQuota<=100000)
Proximity: (attribute~=abc)
, e.g. (displayName~=JohnDoe)
*(~= may not be compatible with all directory servers !!)
Wildcards: e.g. (sn=J*) or (mail=*@example.com) or (givenName=*John*)
Hope this helps!