Update sort condition (#1658)

This commit is contained in:
Christophe Maudoux 2019-06-22 23:46:47 +02:00
parent dd94351f35
commit bdc5007e43
2 changed files with 6 additions and 8 deletions

View File

@ -9,7 +9,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
PE_MALFORMEDUSER
);
our $VERSION = '2.0.5';
our $VERSION = '2.0.6';
extends qw(
Lemonldap::NG::Portal::Main::Plugin
@ -30,6 +30,7 @@ has ott => (
}
);
has idRule => ( is => 'rw', default => sub { 1 } );
has sorted => ( is => 'rw', default => sub { 0 } );
sub hAttr {
$_[0]->{conf}->{checkUserHiddenAttributes} . ' '
@ -53,7 +54,8 @@ sub init {
return 0;
}
$self->idRule($rule);
$self->sorted( $self->conf->{impersonationRule}
|| $self->conf->{contextSwitchingIdRule} );
return 1;
}
@ -432,7 +434,7 @@ sub _splitAttributes {
}
# Sort real and spoofed attributes if required
if ( $self->conf->{impersonationRule} ) {
if ( $self->sorted ) {
$self->logger->debug('Dispatching real and spoofed attributes...');
my ( $realAttrs, $spoofedAttrs ) = ( [], [] );
my $prefix = "$self->{conf}->{impersonationPrefix}";

View File

@ -60,6 +60,7 @@ sub init {
return 0;
}
$self->idRule($rule);
return 1;
}
@ -238,8 +239,6 @@ sub stopImpersonation {
}
}
$req->urldc( $self->conf->{portal} );
#$req->{id} = $realSession->{_session_id};
return $realSession;
}
@ -259,9 +258,6 @@ sub abortImpersonation {
}
$req->urldc( $self->conf->{portal} );
$req->{userData} = { $realSession };
#$req->{id} = $realSession->{_session_id};
return $realSession;
}