From 04c295d0621018f6ee4769054001be61aadac7ff Mon Sep 17 00:00:00 2001 From: octo Date: Sun, 24 Apr 2005 21:27:43 +0000 Subject: [PATCH] mutt-licom.pl is working now. --- lib/LiCoM/Person.pm | 5 ++++- mutt-licom.pl | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/LiCoM/Person.pm b/lib/LiCoM/Person.pm index d51ad28..cbc2eab 100644 --- a/lib/LiCoM/Person.pm +++ b/lib/LiCoM/Person.pm @@ -304,7 +304,7 @@ sub search $filter = '(objectclass=inetOrgPerson)'; } - print STDERR "Debug: using filter: $filter"; + #print STDERR "Debug: using filter: $filter"; $mesg = $Ldap->search ( @@ -442,6 +442,9 @@ sub AUTOLOAD my $obj = shift; my @values = @_; my $field = $Person::AUTOLOAD; + + return (undef) unless ($field); + $field =~ s/.*:://; return (set ($obj, $field, @values ? [@values] : undef)) diff --git a/mutt-licom.pl b/mutt-licom.pl index 894bd1e..07e669c 100755 --- a/mutt-licom.pl +++ b/mutt-licom.pl @@ -28,6 +28,14 @@ for (@ARGV) die ('No (valid) patterns found.') unless (@Patterns); +LiCoM::Person->connect +( + uri => $Config->{'uri'}, + base_dn => $Config->{'base_dn'}, + bind_dn => $Config->{'bind_dn'}, + password => $Config->{'password'} +) or die; + our @Matches = LiCoM::Person->search (@Patterns, [[mail => '*']]); print STDOUT scalar (@Matches), ' ', (scalar (@Matches) == 1 ? 'entry' : 'entries'), " found.\n"; -- 2.11.0