6 use FindBin (qw($Bin));
9 use LiCoM::Config (qw(get_config));
12 our $Config = get_config ();
14 die unless (defined ($Config->{'uri'}) and defined ($Config->{'bind_dn'})
15 and defined ($Config->{'password'}));
17 $Config->{'base_dn'} = $Config->{'bind_dn'} unless (defined ($Config->{'base_dn'}));
23 $temp =~ s/[^\.\*\w\s]//g;
28 push (@Patterns, [[lastname => $temp], [firstname => $temp], [mail => $temp]]);
31 die ('No (valid) patterns found.') unless (@Patterns);
33 LiCoM::Person->connect
35 uri => $Config->{'uri'},
36 base_dn => $Config->{'base_dn'},
37 bind_dn => $Config->{'bind_dn'},
38 password => $Config->{'password'}
41 our @Matches = LiCoM::Person->search (@Patterns, [[mail => '*']]);
43 print STDOUT scalar (@Matches), ' ', (scalar (@Matches) == 1 ? 'entry' : 'entries'), " found.\n";
48 my $cn = $person->name ();
49 my @mail = $person->get ('mail');
53 print "$_\t$cn\tFound by LiCoM\n";
57 LiCoM::Person->disconnect ();