mutt-licom.pl is working now.
authorocto <octo>
Sun, 24 Apr 2005 21:27:43 +0000 (21:27 +0000)
committerocto <octo>
Sun, 24 Apr 2005 21:27:43 +0000 (21:27 +0000)
lib/LiCoM/Person.pm
mutt-licom.pl

index d51ad28..cbc2eab 100644 (file)
@@ -304,7 +304,7 @@ sub search
                $filter = '(objectclass=inetOrgPerson)';
        }
 
                $filter = '(objectclass=inetOrgPerson)';
        }
 
-       print STDERR "Debug: using filter: $filter";
+       #print STDERR "Debug: using filter: $filter";
        
        $mesg = $Ldap->search
        (
        
        $mesg = $Ldap->search
        (
@@ -442,6 +442,9 @@ sub AUTOLOAD
        my $obj = shift;
        my @values = @_;
        my $field = $Person::AUTOLOAD;
        my $obj = shift;
        my @values = @_;
        my $field = $Person::AUTOLOAD;
+
+       return (undef) unless ($field);
+       
        $field =~ s/.*:://;
 
        return (set ($obj, $field, @values ? [@values] : undef))
        $field =~ s/.*:://;
 
        return (set ($obj, $field, @values ? [@values] : undef))
index 894bd1e..07e669c 100755 (executable)
@@ -28,6 +28,14 @@ for (@ARGV)
 
 die ('No (valid) patterns found.') unless (@Patterns);
 
 
 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";
 our @Matches = LiCoM::Person->search (@Patterns, [[mail => '*']]);
 
 print STDOUT scalar (@Matches), ' ', (scalar (@Matches) == 1 ? 'entry' : 'entries'), " found.\n";