diff options
author | Nicolas Vigier <boklm@mars-attacks.org> | 2013-06-27 20:15:21 +0200 |
---|---|---|
committer | Nicolas Vigier <boklm@mars-attacks.org> | 2013-06-27 20:15:21 +0200 |
commit | 22796cd4f34bd10ecaa8f80e8cd9b098186aa38b (patch) | |
tree | d40e268ff3279e30d4642cea992fa66050f4b336 | |
parent | 2eb63cfae624fbb80a81acc15a0429fca19beaa1 (diff) | |
download | mgagit-22796cd4f34bd10ecaa8f80e8cd9b098186aa38b.tar mgagit-22796cd4f34bd10ecaa8f80e8cd9b098186aa38b.tar.gz mgagit-22796cd4f34bd10ecaa8f80e8cd9b098186aa38b.tar.bz2 mgagit-22796cd4f34bd10ecaa8f80e8cd9b098186aa38b.tar.xz mgagit-22796cd4f34bd10ecaa8f80e8cd9b098186aa38b.zip |
Ignore group members not matching user re
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | lib/MGA/Git.pm | 5 |
2 files changed, 4 insertions, 3 deletions
@@ -1,3 +1,5 @@ +- ignore group members not matching user re + Version 0.2 - add repodef_repo.gl template 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; } |