From f11c34e9cdf795f9e0acfbf6b3e945d17312f2db Mon Sep 17 00:00:00 2001 From: Christophe Maudoux Date: Tue, 25 Jun 2019 23:04:27 +0200 Subject: [PATCH] Cleaning code (#1783 & #1658) --- .../lib/Lemonldap/NG/Manager/Build/Attributes.pm | 11 +++++------ .../lib/Lemonldap/NG/Portal/Plugins/CheckUser.pm | 2 +- .../Lemonldap/NG/Portal/Plugins/ContextSwitching.pm | 5 ----- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm index fc31e8b1b..3b33ddbca 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm @@ -467,12 +467,14 @@ sub attributes { type => 'boolOrExpr', default => 0, documentation => 'Impersonation activation rule', + flags => 'p', }, impersonationIdRule => { type => 'text', test => sub { return perlExpr(@_) }, default => 1, documentation => 'Impersonation identities rule', + flags => 'p', }, impersonationHiddenAttributes => { type => 'text', @@ -490,24 +492,21 @@ sub attributes { type => 'boolOrExpr', default => 0, documentation => 'Context switching activation rule', + flags => 'p', }, contextSwitchingIdRule => { type => 'text', test => sub { return perlExpr(@_) }, default => 1, documentation => 'Context switching identities rule', + flags => 'p', }, contextSwitchingStopWithLogout => { type => 'bool', default => 1, documentation => 'Stop context switching by logout', + flags => 'p', }, - # contextSwitchingHiddenAttributes => { - # type => 'text', - # default => '', - # documentation => 'Attributes to skip', - # flags => 'p', - # }, skipRenewConfirmation => { type => 'bool', default => 0, diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CheckUser.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CheckUser.pm index bfc2e7c21..62fb48010 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CheckUser.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CheckUser.pm @@ -55,7 +55,7 @@ sub init { } $self->idRule($rule); $self->sorted( $self->conf->{impersonationRule} - || $self->conf->{contextSwitchingIdRule} ); + || $self->conf->{contextSwitchingRule} ); return 1; } diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/ContextSwitching.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/ContextSwitching.pm index efa650942..64e20550c 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/ContextSwitching.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/ContextSwitching.pm @@ -25,11 +25,6 @@ has ott => ( has rule => ( is => 'rw', default => sub { 1 } ); has idRule => ( is => 'rw', default => sub { 1 } ); -sub hAttr { - $_[0]->{conf}->{contextSwitchingHiddenAttributes} . ' ' - . $_[0]->{conf}->{hiddenAttributes}; -} - sub init { my ($self) = @_; my $hd = $self->p->HANDLER;