7 use LiCoM::Config (qw(get_config));
10 our $Config = get_config ();
12 die unless (defined ($Config->{'uri'}) and defined ($Config->{'bind_dn'})
13 and defined ($Config->{'password'}));
15 $Config->{'base_dn'} = $Config->{'bind_dn'} unless (defined ($Config->{'base_dn'}));
21 $temp =~ s/[^\.\*\w\s]//g;
26 push (@Patterns, [[lastname => $temp], [firstname => $temp], [mail => $temp]]);
29 die ('No (valid) patterns found.') unless (@Patterns);
31 LiCoM::Person->connect
33 uri => $Config->{'uri'},
34 base_dn => $Config->{'base_dn'},
35 bind_dn => $Config->{'bind_dn'},
36 password => $Config->{'password'}
39 our @Matches = LiCoM::Person->search (@Patterns, [[mail => '*']]);
41 print STDOUT scalar (@Matches), ' ', (scalar (@Matches) == 1 ? 'entry' : 'entries'), " found.\n";
46 my $cn = $person->name ();
47 my @mail = $person->get ('mail');
51 print "$_\t$cn\tFound by LiCoM\n";
55 LiCoM::Person->disconnect ();