Peter,
I ran my tests and it still does what it should ;-)
Formally the LE & GE should use string comparison for CIS, but until
schema support has been build in (maybe as optional), the numeric
comparison trick will be ok.
I'm thinking about using Net::LDAP::Schema to determine the attribute
type for matching, but I haven't found the time to start at this.
Thanks for the improvements and feel free to include it in the perl-ldap
tree.
Kind regards,
Hans
Peter Marschall schreef:
Hi Hans,
On Sunday, 18. December 2005 21:53, [EMAIL PROTECTED] wrote:
attached is Net::LDAP::FilterMatch, a module to match Net::LDAP::Entry
objects against a Net::LDAP::Filter filter.
It can be used to filter out entries from an LDIF, but also as a simple
solution for searching while using Net::LDAP::Server.
I made a few changes to the file you sent.
Fixes compared to your version:
- conjunctions (&...) and disjunctions (|...) may comprise any number of
elements.
- characters with special meaning in Perl regexes are quoted in equality
and substring filters
i.e. "(cn=Peter?)" matches "Peter?" but not "Pete" or "Peter".
- Net::LDAP::FilterMatch is now an extension of Net::LDAP::Filter
Thus loading Net::LDAP::FilterMatch after Net::LDAP::Filter
allows you to write $filter->match($entry)
- If possible greateOrEqual and lessOrEqual filters do numerical comparison.
See the attached file.
If you do not mind I'd like to include it into the perl-ldap SVN so that it
will be in the next release.
Please test if it still matches your idea how this module should behave.
Regards
Peter