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 => ( ...@@ -13,19 +13,14 @@ has ldapGroupAttributeNameSearch => (
is => 'rw', is => 'rw',
lazy => 1, lazy => 1,
builder => sub { builder => sub {
return $_[0]->{conf}->{ldapGroupAttributeNameSearch} my $attributes = [];
? [ @$attributes =
split( /\s+/, $_[0]->{conf}->{ldapGroupAttributeNameSearch} ), split( /\s+/, $_[0]->{conf}->{ldapGroupAttributeNameSearch} )
if $_[0]->{conf}->{ldapGroupAttributeNameSearch};
# Push group attribute value for recursive search push( @$attributes, $_[0]->{conf}->{ldapGroupAttributeNameGroup} )
( if ( $_[0]->{conf}->{ldapGroupRecursive}
$_[0]->{conf}->{ldapGroupRecursive} and $_[0]->{conf}->{ldapGroupAttributeNameGroup} ne "dn" );
and $_[0]->{conf}->{ldapGroupAttributeNameGroup} ne "dn" return $attributes;
? $_[0]->{conf}->{ldapGroupAttributeNameGroup}
: ()
)
]
: [];
} }
); );
...@@ -122,13 +117,13 @@ sub setGroups { ...@@ -122,13 +117,13 @@ sub setGroups {
my $firstValue = $ldapGroups->{$groupName}->{$_}->[0]; my $firstValue = $ldapGroups->{$groupName}->{$_}->[0];
push @$groupValues, $firstValue; push @$groupValues, $firstValue;
} }
$groups .= $groups .= $self->conf->{multiValuesSeparator} if $groups;
$self->conf->{multiValuesSeparator} . join( '|', @$groupValues ); $groups .= join( '|', @$groupValues );
} }
} }
$req->{sessionInfo}->{groups} = $groups; $req->{sessionInfo}->{groups} = $groups;
$req->{sessionInfo}->{hGroups} = $hGroups; $req->{sessionInfo}->{hGroups} = $hGroups;
PE_OK; PE_OK;
} }
......
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