From 2a905b2758e2ce4e1763d99e5ed6e445cb46234e Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 17 Sep 2010 23:12:18 +0200 Subject: Fix pass arrayref (multiple arrays are treated as one) from getuserinfo(). --- localuserinfo | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'localuserinfo') diff --git a/localuserinfo b/localuserinfo index 72a7efc..7c74589 100755 --- a/localuserinfo +++ b/localuserinfo @@ -118,7 +118,7 @@ while (my $username = shift @names) { my $string; - my ($fullname, $office, $workphone, $homephone, $other, $groupname, $members, $groups, @officehints, @addresshints, @grouphints) = &getuserinfo($username); + my ($fullname, $office, $workphone, $homephone, $other, $groupname, $members, $groups, $officehints, $addresshints, $grouphints) = &getuserinfo($username); my $mailaddress = "$username\@$maildomain"; $string = $template; @@ -128,13 +128,13 @@ while (my $username = shift @names) { $string =~ s/\%workphone\%/$workphone/g; $string =~ s/\%homephone\%/$homephone/g; $string =~ s/\%other\%/$other/g; - $string =~ s/\%officehints\%/@officehints/g; - $string =~ s/\%addresshints\%/@addresshints/g; + $string =~ s/\%officehints\%/@$officehints/g; + $string =~ s/\%addresshints\%/@$addresshints/g; $string =~ s/\%mailaddress\%/$mailaddress/g; $string =~ s/\%groupname\%/$groupname/g; $string =~ s/\%members\%/$members/g; $string =~ s/\%groups\%/$groups/g; - $string =~ s/\%grouphints\%/@grouphints/g; + $string =~ s/\%grouphints\%/@$grouphints/g; print "$string\n"; } @@ -158,7 +158,7 @@ sub getuserinfo($) { my $groups = join ' ', defined($groups{$username}) ? @{$groups{$username}} : ''; my @grouphints = grep {s/^([\.[:alnum:]_-]+)$/\@$1/} split /\s+/, $groups; - return ($fullname, $office, $workphone, $homephone, $other, $groupname, $members, $groups, @officehints, @addresshints, @grouphints); + return ($fullname, $office, $workphone, $homephone, $other, $groupname, $members, $groups, \@officehints, \@addresshints, \@grouphints); } sub get_maildomain { -- cgit v1.2.3