aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mars-attacks.org>2013-06-27 20:15:21 +0200
committerNicolas Vigier <boklm@mars-attacks.org>2013-06-27 20:15:21 +0200
commit22796cd4f34bd10ecaa8f80e8cd9b098186aa38b (patch)
treed40e268ff3279e30d4642cea992fa66050f4b336 /lib
parent2eb63cfae624fbb80a81acc15a0429fca19beaa1 (diff)
downloadmgagit-22796cd4f34bd10ecaa8f80e8cd9b098186aa38b.tar
mgagit-22796cd4f34bd10ecaa8f80e8cd9b098186aa38b.tar.gz
mgagit-22796cd4f34bd10ecaa8f80e8cd9b098186aa38b.tar.bz2
mgagit-22796cd4f34bd10ecaa8f80e8cd9b098186aa38b.tar.xz
mgagit-22796cd4f34bd10ecaa8f80e8cd9b098186aa38b.zip
Ignore group members not matching user re
Diffstat (limited to 'lib')
-rw-r--r--lib/MGA/Git.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/MGA/Git.pm b/lib/MGA/Git.pm
index 396e319..a9c0722 100644
--- a/lib/MGA/Git.pm
+++ b/lib/MGA/Git.pm
@@ -68,8 +68,7 @@ sub get_ldap {
sub re {
my ($re, $txt) = @_;
my $rr = qr/$config->{$re}/;
- $txt =~ s/$rr/$1/;
- return $txt;
+ return $txt =~ m/$rr/ ? $1 : undef;
}
sub load_groups {
@@ -82,7 +81,7 @@ sub load_groups {
);
my $res = $m->as_struct;
@{$r->{groups}}{map { re('group_re', $_) } keys %$res} =
- map { [ map { re('uid_username_re', $_) } @{$_->{member}} ] }
+ map { [ map { re('uid_username_re', $_) || () } @{$_->{member}} ] }
values %$res;
}