Hi,

On Wednesday, 13. September 2006 06:03, Andrej Ricnik-Bay wrote:
> I've quickly glanced over the mailing list archive, read the docs on cpan,
> googled around but I still fail to understand how I could narrow down
> a search for attributes that only returns values that make sense in a
> given ou, e.g. ou=people,ou=users,o=org
>
> The reason that I'm looking for this is because I want to present users
> who have authenticated themselves against ldap with a list of attributes
> that they can query from a CGI script, and then export a query result to
> a csv file.  However, our directory knows over 800 attributes, most of
> which have no relevance to a query;  but I'm reluctant to hard-code
> choices in case we modify the schema later on and extend the objects
> in ou=people .

Try to use a strategy like this one
- get all objectclasses in ou=people,ou=users,o=org
  (= one search for the attribute objectclass)
- get the attributes for the objectclasses found
  (= one call to $schema->must() and $schema->may() per objectclass)
- combine & uniq the lists of attributes found from the calls above

Depending on your use case you might consider doing this not interactively but 
on a regular schedule in a spearate job and have the results stored in a 
config file.

Hope it helps
Peter
-- 
Peter Marschall
[EMAIL PROTECTED]

Reply via email to