Commit 5afeddcb authored by Christophe Maudoux's avatar Christophe Maudoux

Merge branch 'master' of gitlab.ow2.org:lemonldap-ng/lemonldap-ng

parents 2178c8a2 e269d757
...@@ -140,17 +140,44 @@ sub delKey { ...@@ -140,17 +140,44 @@ sub delKey {
foreach my $el (@list) { foreach my $el (@list) {
my @path = split $sep, $el->[0]; my @path = split $sep, $el->[0];
if ( $#path == 0 ) { if ( $#path == 0 ) {
delete $new->{ $path[0] }->{ $el->[1] }; if ( exists $new->{ $path[0] }
&& exists $new->{ $path[0] }->{ $el->[1] } )
{
delete $new->{ $path[0] }->{ $el->[1] }
if exists $new->{ $path[0] }->{ $el->[1] };
}
} }
elsif ( $#path == 1 ) { elsif ( $#path == 1 ) {
delete $new->{ $path[0] }->{ $path[1] }->{ $el->[1] }; if ( exists $new->{ $path[0] }
&& exists $new->{ $path[0] }->{ $path[1] }
&& exists $new->{ $path[0] }->{ $path[1] }->{ $el->[1] } )
{
delete $new->{ $path[0] }->{ $path[1] }->{ $el->[1] };
}
} }
elsif ( $#path == 2 ) { elsif ( $#path == 2 ) {
delete $new->{ $path[0] }->{ $path[1] }->{ $path[2] }->{ $el->[1] }; if ( exists $new->{ $path[0] }
&& exists $new->{ $path[0] }->{ $path[1] }
&& exists $new->{ $path[0] }->{ $path[1] }->{ $path[2] }
&& exists $new->{ $path[0] }->{ $path[1] }->{ $path[2] }
->{ $el->[1] } )
{
delete $new->{ $path[0] }->{ $path[1] }->{ $path[2] }
->{ $el->[1] };
}
} }
elsif ( $#path == 3 ) { elsif ( $#path == 3 ) {
delete $new->{ $path[0] }->{ $path[1] }->{ $path[2] }->{ $path[3] } if ( exists $new->{ $path[0] }
->{ $el->[1] }; && exists $new->{ $path[0] }->{ $path[1] }
&& exists $new->{ $path[0] }->{ $path[1] }->{ $path[2] }
&& exists $new->{ $path[0] }->{ $path[1] }->{ $path[2] }
->{ $path[3] }
&& exists $new->{ $path[0] }->{ $path[1] }->{ $path[2] }
->{ $path[3] }->{ $el->[1] } )
{
delete $new->{ $path[0] }->{ $path[1] }->{ $path[2] }
->{ $path[3] }->{ $el->[1] };
}
} }
else { else {
die $el->[0] . " has too many levels. Aborting"; die $el->[0] . " has too many levels. Aborting";
......
...@@ -216,8 +216,7 @@ sub do { ...@@ -216,8 +216,7 @@ sub do {
return [ return [
401, 401,
[ [
'WWW-Authenticate' => "SSO " . $self->conf->{portal}, 'WWW-Authenticate' => "SSO " . $self->conf->{portal}
'Access-Control-Allow-Origin' => '*'
], ],
[qq'{"result":0,"error":$err}'] [qq'{"result":0,"error":$err}']
]; ];
......
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