From 3844ba4192df99f8def9287974bc8d442ee5f4a6 Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Wed, 12 May 2010 04:04:10 +0000 Subject: [PATCH] "make tidy" --- build/lemonldap-ng/Makefile | 2 +- .../example/MyHandlerZimbra.pm | 3 +- .../example/MyUpdateCookieHandler.pm | 1 + .../lib/Lemonldap/NG/Handler/UpdateCookie.pm | 6 +- .../lib/Lemonldap/NG/Manager/_Struct.pm | 3 +- .../lib/Lemonldap/NG/Manager/_i18n.pm | 36 +-- .../lemonldap-ng-portal/example/index_skin.pl | 12 +- .../lib/Lemonldap/NG/Portal/AuthSAML.pm | 2 +- .../lib/Lemonldap/NG/Portal/IssuerDBSAML.pm | 2 +- .../lib/Lemonldap/NG/Portal/UserDBLDAP.pm | 10 +- .../lib/Lemonldap/NG/Portal/_SAML.pm | 3 +- .../lib/Lemonldap/NG/Portal/_SOAP.pm | 11 +- .../t/25-Lemonldap-NG-Portal-Multi.t | 263 +++++++++--------- .../t/26-Lemonldap-NG-Portal-AuthProxy.t | 10 +- .../t/30-Lemonldap-NG-Portal-UserDBNull.t | 17 +- 15 files changed, 193 insertions(+), 188 deletions(-) diff --git a/build/lemonldap-ng/Makefile b/build/lemonldap-ng/Makefile index ca4d78a63..42354bb59 100644 --- a/build/lemonldap-ng/Makefile +++ b/build/lemonldap-ng/Makefile @@ -622,6 +622,6 @@ default-diff: @$(DIFF) lemonldap-ng-manager/example/sessions.pl $(LMPREFIX)/htdocs/manager/sessions.pl ||true tidy: clean - find lemon*/ -type f \( -name '*.pm' -or -name '*.pl' -or -name '*.t' \) -exec perltidy -b {} \; + find lemon*/ -type f \( -name '*.pm' -or -name '*.pl' -or -name '*.t' \) -print -exec perltidy -b {} \; find lemon*/ -name '*.bak' -delete diff --git a/modules/lemonldap-ng-handler/example/MyHandlerZimbra.pm b/modules/lemonldap-ng-handler/example/MyHandlerZimbra.pm index 5e768ecc1..3f878bb13 100644 --- a/modules/lemonldap-ng-handler/example/MyHandlerZimbra.pm +++ b/modules/lemonldap-ng-handler/example/MyHandlerZimbra.pm @@ -8,7 +8,8 @@ use Lemonldap::NG::Handler::ZimbraPreAuth; __PACKAGE__->init( { - # See Lemonldap::NG::Handler + + # See Lemonldap::NG::Handler } ); diff --git a/modules/lemonldap-ng-handler/example/MyUpdateCookieHandler.pm b/modules/lemonldap-ng-handler/example/MyUpdateCookieHandler.pm index df96fc042..f0042c856 100644 --- a/modules/lemonldap-ng-handler/example/MyUpdateCookieHandler.pm +++ b/modules/lemonldap-ng-handler/example/MyUpdateCookieHandler.pm @@ -6,6 +6,7 @@ use Lemonldap::NG::Handler::UpdateCookie; __PACKAGE__->init( { + # See Lemonldap::NG::Handler } ); diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/UpdateCookie.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/UpdateCookie.pm index fd2dab6ff..1640f1377 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/UpdateCookie.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/UpdateCookie.pm @@ -33,12 +33,14 @@ sub run { $datas->{_session_id} = 0; $clear = 1; } - elsif ( $refLocalStorage and my $ldatas = $refLocalStorage->get($id) ) { + elsif ( $refLocalStorage + and my $ldatas = $refLocalStorage->get($id) ) + { if ( $ldatas->{_utime} lt $utime ) { $clear = 1; } } - if ( $clear ) { + if ($clear) { $class->lmLog( "$class: remove $id from local cache", 'debug' ); $refLocalStorage->remove($id); } diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_Struct.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_Struct.pm index 17357395e..a4aebc0b2 100644 --- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_Struct.pm +++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_Struct.pm @@ -425,7 +425,8 @@ sub struct { grantSessionRule => 'textarea:/grantSessionRule', storePassword => 'bool:/storePassword', timeout => 'text:/timeout:timeout:text', - timeoutActivity => 'text:/timeoutActivity:timeoutActivity:timeoutActivityParams', + timeoutActivity => + 'text:/timeoutActivity:timeoutActivity:timeoutActivityParams', sessionStorage => { _nodes => [qw(globalStorage globalStorageOptions)], diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm index 0ecb826dd..652f06bcd 100644 --- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm +++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm @@ -434,27 +434,27 @@ sub fr { SSLVar => 'Champ extrait du certificat', storePassword => "Stocke le mot-de-passe de l'utilisateur dans les données de session", - syntaxError => 'Erreur de syntaxe', - syslog => 'Facilité syslog', - timeout => 'Durée de vie maximale des sessions', + syntaxError => 'Erreur de syntaxe', + syslog => 'Facilité syslog', + timeout => 'Durée de vie maximale des sessions', timeoutActivity => 'Délai d\'expiration des sessions', - trustedDomains => 'Domaines appouvés', - twitterAppName => 'Nom de l\'application', - twitterKey => 'Clé de l\'API', - twitterParams => 'Paramètres Twitter', - twitterSecret => 'Secret de l\'API', - unknownError => 'Erreur inconnue', - uploadDenied => 'Téléchargement refusé', - user => 'utilisateur', - users => 'utilisateurs', - userDB => "Module d'utilisateurs", - userControl => "Contrôle du nom d'utilisateur", - userPivot => 'Champ identifiant dans la table des utilisateurs', + trustedDomains => 'Domaines appouvés', + twitterAppName => 'Nom de l\'application', + twitterKey => 'Clé de l\'API', + twitterParams => 'Paramètres Twitter', + twitterSecret => 'Secret de l\'API', + unknownError => 'Erreur inconnue', + uploadDenied => 'Téléchargement refusé', + user => 'utilisateur', + users => 'utilisateurs', + userDB => "Module d'utilisateurs", + userControl => "Contrôle du nom d'utilisateur", + userPivot => 'Champ identifiant dans la table des utilisateurs', useXForwardedForIP => "Utiliser l'adresse IP de l'en-tête X-Forwarded-For", - variables => "Variables", - virtualHosts => 'Hôtes virtuels', - whatToTrace => "Variable d'environnement REMOTE_USER", + variables => "Variables", + virtualHosts => 'Hôtes virtuels', + whatToTrace => "Variable d'environnement REMOTE_USER", zimbraAccountKey => 'Clé de session pour le compte', zimbraBy => 'Type de compte', zimbraHandler => 'Zimbra', diff --git a/modules/lemonldap-ng-portal/example/index_skin.pl b/modules/lemonldap-ng-portal/example/index_skin.pl index cce349b3c..a8f6b539e 100755 --- a/modules/lemonldap-ng-portal/example/index_skin.pl +++ b/modules/lemonldap-ng-portal/example/index_skin.pl @@ -49,11 +49,13 @@ if ( $portal->process() ) { # 1.1 Image mode if ( $portal->{error} == PE_IMG_OK || $portal->{error} == PE_IMG_NOK ) { - $skinfile = $skin_dir . '/common/ok.png'; - if ( $portal->{error} == PE_IMG_NOK ) { - $skinfile = $skin_dir . '/common/warning.png'; - } - $portal->printImage($skinfile, 'image/png'); + $skinfile = "$skin_dir/common/" + . ( + $portal->{error} == PE_IMG_OK + ? 'ok.png' + : 'warning.png' + ); + $portal->printImage( $skinfile, 'image/png' ); exit; } diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSAML.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSAML.pm index 5d3451cb2..67c02445a 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSAML.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSAML.pm @@ -436,7 +436,7 @@ sub extractFormInfo { $self->lmLog( "Logout request NameID content: $user", 'debug' ); # Get corresponding session - # TODO use SAML sessionIndex + # TODO use SAML sessionIndex my $local_sessions = $self->{samlStorage} ->searchOn( $self->{samlStorageOptions}, "_user", $user, ); diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm index 516150a81..a44372b28 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm @@ -207,7 +207,7 @@ sub issuerForUnAuthUser { } # Send logout response - # TODO sendLogoutResponseAfterLogoutRequest does not exists + # TODO sendLogoutResponseAfterLogoutRequest does not exists return PE_ERROR unless ( $self->sendLogoutResponseAfterLogoutRequest( diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDBLDAP.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDBLDAP.pm index ab503a94c..4116cf25f 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDBLDAP.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDBLDAP.pm @@ -100,12 +100,12 @@ sub setSessionInfo { } elsif ( ref( $self->{exportedVars} ) eq 'HASH' ) { foreach ( keys %{ $self->{exportedVars} } ) { - $self->{sessionInfo}->{$_} = - $self->{ldap} - ->getLdapValue( $self->{entry}, $self->{exportedVars}->{$_} ) - || ""; - } + $self->{sessionInfo}->{$_} = + $self->{ldap} + ->getLdapValue( $self->{entry}, $self->{exportedVars}->{$_} ) + || ""; } + } else { $self->abort('Only hash reference are supported now in exportedVars'); } diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_SAML.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_SAML.pm index 0160816d3..3d6bafb06 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_SAML.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_SAML.pm @@ -2241,7 +2241,8 @@ sub sendLogoutRequestToServiceProviders { # Header of the block which will be displayed to the user, if needed. $info .= - &Lemonldap::NG::Portal::_i18n::msg( Lemonldap::NG::Portal::Simple::PM_SAML_SPLOGOUT, + &Lemonldap::NG::Portal::_i18n::msg + ( Lemonldap::NG::Portal::Simple::PM_SAML_SPLOGOUT, $ENV{HTTP_ACCEPT_LANGUAGE} ) . '