summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2010-09-17 23:12:18 +0200
committerJonas Smedegaard <dr@jones.dk>2010-09-17 23:12:18 +0200
commit2a905b2758e2ce4e1763d99e5ed6e445cb46234e (patch)
tree5c02b3ab7da361c2addcb0258b01eb417c8e4f08
parent7f09da3405dce6841f1693ce50bfce16e3eccb2d (diff)
Fix pass arrayref (multiple arrays are treated as one) from getuserinfo().
-rwxr-xr-xlocaluserinfo10
1 files changed, 5 insertions, 5 deletions
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 {