aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--lib/MGA/Git.pm5
2 files changed, 4 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 960bc00..9664e75 100644
--- a/NEWS
+++ b/NEWS
@@ -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;
}