X-Git-Url: https://git.octo.it/?p=licom.git;a=blobdiff_plain;f=mutt-licom.pl;h=e7fbcbdd71062e3828e855d48baee4f7111fa5dc;hp=08c25022834e0e244f2948d33b863e9765e754d3;hb=2f7d9ec3631d96fd673c2f6cee3dda7acfaa86ee;hpb=088609f68349c6888d73aaa60708d7bab4a8e7d0 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"; } }