X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=mutt-licom.pl;h=e7fbcbdd71062e3828e855d48baee4f7111fa5dc;hb=HEAD;hp=08c25022834e0e244f2948d33b863e9765e754d3;hpb=efe4485ed983d6573813abf54fe6ddd9e855434b;p=licom.git diff --git a/mutt-licom.pl b/mutt-licom.pl index 08c2502..e7fbcbd 100755 --- a/mutt-licom.pl +++ b/mutt-licom.pl @@ -24,6 +24,12 @@ else $Config = get_config (); } +if ($ENV{'DEBUG'}) +{ + require Data::Dumper; + print STDERR Data::Dumper->Dump ([$Config], ['Config']); +} + unless (defined ($Config->{'uri'}) and defined ($Config->{'bind_dn'}) and defined ($Config->{'password'})) { @@ -61,15 +67,19 @@ our @Matches = LiCoM::Person->search (@Patterns, [[mail => '*']]); print STDOUT scalar (@Matches), ' ', (scalar (@Matches) == 1 ? 'entry' : 'entries'), " found.\n"; -for (@Matches) +for (sort { $a->name () cmp $b->name () } (@Matches)) { my $person = $_; my $cn = $person->name (); my @mail = $person->get ('mail'); + my @groups = $person->get ('group'); + my $info = join (', ', sort (@groups)); + + $info = "($info)" if ($info); - for (@mail) + for (sort (@mail)) { - print "$_\t$cn\tFound by LiCoM\n"; + print "$_\t$cn\t$info\n"; } }