aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mars-attacks.org>2013-07-15 18:57:06 +0200
committerNicolas Vigier <boklm@mars-attacks.org>2013-07-15 18:59:17 +0200
commit0f6b9170d126f5c3be7bd6ee9bd8646cd2aa7d94 (patch)
treecd7c965980130bf772856636c3ff059f4874e1b7 /lib
parent852b1688fbf5129d0e365586b6d87a59fe31ba29 (diff)
downloadmgagit-0f6b9170d126f5c3be7bd6ee9bd8646cd2aa7d94.tar
mgagit-0f6b9170d126f5c3be7bd6ee9bd8646cd2aa7d94.tar.gz
mgagit-0f6b9170d126f5c3be7bd6ee9bd8646cd2aa7d94.tar.bz2
mgagit-0f6b9170d126f5c3be7bd6ee9bd8646cd2aa7d94.tar.xz
mgagit-0f6b9170d126f5c3be7bd6ee9bd8646cd2aa7d94.zip
Filter what user infos we keep from ldap
Diffstat (limited to 'lib')
-rw-r--r--lib/MGA/Git.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/MGA/Git.pm b/lib/MGA/Git.pm
index e518189..6b8ac11 100644
--- a/lib/MGA/Git.pm
+++ b/lib/MGA/Git.pm
@@ -111,7 +111,12 @@ sub load_users {
filter => $config->{userfilter},
);
my @users = grep { $_->{sshpublickey} } values %{$m->as_struct};
- @{$r->{users}}{map { $_->{uid}[0] } @users} = @users;
+ my %keepinfos = map { $_ => 1 } @{$config->{ldap_users_infos}};
+ foreach my $user (@users) {
+ my $uid = $user->{uid}[0];
+ my %u = map { $keepinfos{$_} ? ($_ => $user->{$_}) : () } keys %$user;
+ $r->{users}{$uid} = \%u;
+ }
}
sub get_tmpl {