From: octo Date: Sun, 24 Apr 2005 21:27:43 +0000 (+0000) Subject: mutt-licom.pl is working now. X-Git-Tag: Release-0.1~5 X-Git-Url: https://git.octo.it/?p=licom.git;a=commitdiff_plain;h=04c295d0621018f6ee4769054001be61aadac7ff mutt-licom.pl is working now. --- 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";