Commit b7e96790 authored by Clément OUDOT's avatar Clément OUDOT

Fix construction of searched attributes for groups (#1332)

parent b3ff6e26
......@@ -13,19 +13,14 @@ has ldapGroupAttributeNameSearch => (
is => 'rw',
lazy => 1,
builder => sub {
return $_[0]->{conf}->{ldapGroupAttributeNameSearch}
? [
split( /\s+/, $_[0]->{conf}->{ldapGroupAttributeNameSearch} ),
# Push group attribute value for recursive search
(
$_[0]->{conf}->{ldapGroupRecursive}
and $_[0]->{conf}->{ldapGroupAttributeNameGroup} ne "dn"
? $_[0]->{conf}->{ldapGroupAttributeNameGroup}
: ()
)
]
: [];
my $attributes = [];
@$attributes =
split( /\s+/, $_[0]->{conf}->{ldapGroupAttributeNameSearch} )
if $_[0]->{conf}->{ldapGroupAttributeNameSearch};
push( @$attributes, $_[0]->{conf}->{ldapGroupAttributeNameGroup} )
if ( $_[0]->{conf}->{ldapGroupRecursive}
and $_[0]->{conf}->{ldapGroupAttributeNameGroup} ne "dn" );
return $attributes;
}
);
......@@ -122,8 +117,8 @@ sub setGroups {
my $firstValue = $ldapGroups->{$groupName}->{$_}->[0];
push @$groupValues, $firstValue;
}
$groups .=
$self->conf->{multiValuesSeparator} . join( '|', @$groupValues );
$groups .= $self->conf->{multiValuesSeparator} if $groups;
$groups .= join( '|', @$groupValues );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment