Commit 8f2ad52c authored by Clément OUDOT's avatar Clément OUDOT

make tidy on all files

git-svn-id: svn://svn.forge.objectweb.org/svnroot/lemonldap/branches/lemonldap-ng_version_1_4-bugfixes@3635 1dbb9719-a921-0410-b57f-c3a383c2c641
parent 5da2a1f6
......@@ -154,7 +154,8 @@ sub get_key_from_all_sessions {
return $backend->get_key_from_all_sessions(@_);
}
if ( $backend =~
/^Apache::Session::(MySQL|MySQL::NoLock|Postgres|Oracle|Sybase|Informix)$/ )
/^Apache::Session::(MySQL|MySQL::NoLock|Postgres|Oracle|Sybase|Informix)$/
)
{
return $class->_dbiGKFAS( $1, @_ );
}
......
......@@ -65,7 +65,7 @@ sub release_all_locks {
my $self = shift;
my $session = shift;
$self->module->release_all_locks($session);
$self->module->release_all_locks($session);
}
1;
......
......@@ -116,7 +116,7 @@ sub share_from {
$type = $1 if ( $var = $arg ) =~ s/^(\W)//;
for ( 1 .. 2 ) { # assign twice to avoid any 'used once' warnings
*{$var} =
( !$type ) ? \&{ $pkg . "::$var" }
( !$type ) ? \&{ $pkg . "::$var" }
: ( $type eq '&' ) ? \&{ $pkg . "::$var" }
: ( $type eq '$' ) ? \${ $pkg . "::$var" }
: ( $type eq '@' ) ? \@{ $pkg . "::$var" }
......
......@@ -97,8 +97,8 @@ SKIP: {
$ENV{HTTP_ACCEPT_LANGUAGE} = 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3';
ok( ( $cgi2 = Lemonldap::NG::Common::CGI->new() ), 'New CGI' );
ok( $lang = $cgi2->extract_lang(), 'extract_lang' );
ok( $lang->[0] eq 'fr', 'extract_lang' );
ok( $lang->[1] eq 'en', 'extract_lang' );
ok( $lang->[0] eq 'fr', 'extract_lang' );
ok( $lang->[1] eq 'en', 'extract_lang' );
ok( scalar(@$lang) == 2, 'extract_lang' );
# Extract lang Android (See #LEMONLDAP-530)
......@@ -106,8 +106,8 @@ SKIP: {
$ENV{HTTP_ACCEPT_LANGUAGE} = 'fr-FR, en-US';
ok( ( $cgi3 = Lemonldap::NG::Common::CGI->new() ), 'New CGI' );
ok( $lang = $cgi3->extract_lang(), 'extract_lang Android' );
ok( $lang->[0] eq 'fr', 'extract_lang Android' );
ok( $lang->[1] eq 'en', 'extract_lang Android' );
ok( $lang->[0] eq 'fr', 'extract_lang Android' );
ok( $lang->[1] eq 'en', 'extract_lang Android' );
ok( scalar(@$lang) == 2, 'extract_lang Android' );
# SOAP
......
......@@ -29,8 +29,8 @@ ok( 'test..ex.com' !~ HOSTNAME() );
ok( '10.1.1.1' =~ HOST() );
ok( '10.1.1.1' !~ HOSTNAME() );
ok( 'test.ex.com' !~ HTTP_URI() );
ok( 'https://test.ex.com' =~ HTTP_URI() );
ok( 'https://test.ex.com/' =~ HTTP_URI() );
ok( 'https://test.ex.com' =~ HTTP_URI() );
ok( 'https://test.ex.com/' =~ HTTP_URI() );
ok( 'https://test.ex.com/a' =~ HTTP_URI() );
ok( 'https://test.ex.com/?<script>' !~ HTTP_URI() );
......
......@@ -78,7 +78,9 @@ sub new {
elsif ( $self->{protection} !~ /^authenticate$/i ) {
$self->abort(
'Bad configuration',
"The rule <code>" . $self->{protection} . "</code> is not known"
"The rule <code>"
. $self->{protection}
. "</code> is not known"
);
}
}
......
......@@ -325,7 +325,7 @@ sub goToPortal {
sub fetchId {
my $t = Lemonldap::NG::Handler::Main::Headers->lmHeaderIn( $apacheRequest,
'Cookie' );
my $vhost = $apacheRequest->hostname;
my $vhost = $apacheRequest->hostname;
my $lookForHttpCookie = $tsv->{securedCookie} =~ /^(2|3)$/
&& !(
defined( $tsv->{https}->{$vhost} )
......@@ -450,7 +450,7 @@ sub run ($$) {
my $str = $1;
Lemonldap::NG::Handler::Main::Logger->lmLog( 'CDA request', 'debug' );
$apacheRequest->args($args);
my $redirectUrl = $class->_buildUrl( $apacheRequest->uri );
my $redirectUrl = $class->_buildUrl( $apacheRequest->uri );
my $redirectHttps = ( $redirectUrl =~ m/^https/ );
Lemonldap::NG::Handler::Main::Headers->lmSetErrHeaderOut(
$apacheRequest,
......
......@@ -102,7 +102,7 @@ sub share_from {
$type = $1 if ( $var = $arg ) =~ s/^(\W)//;
for ( 1 .. 2 ) { # assign twice to avoid any 'used once' warnings
*{$var} =
( !$type ) ? \&{ $pkg . "::$var" }
( !$type ) ? \&{ $pkg . "::$var" }
: ( $type eq '&' ) ? \&{ $pkg . "::$var" }
: ( $type eq '$' ) ? \${ $pkg . "::$var" }
: ( $type eq '@' ) ? \@{ $pkg . "::$var" }
......
......@@ -265,9 +265,9 @@ sub listDone {
# @param id Session identifier
# @return HTML data
sub delete {
my ( $self, $id ) = splice @_;
my ( $uid, $ref ) = ( $id =~ /([^_]+?)_(.+)/ );
my ( $n, $res );
my ( $self, $id ) = splice @_;
my ( $uid, $ref ) = ( $id =~ /([^_]+?)_(.+)/ );
my ( $n, $res );
# Try to read notification
$n = $self->{notifObject}->_get( $uid, $ref );
......@@ -345,9 +345,9 @@ sub purge {
# Build notification dump.
# @return string XML tree
sub notification {
my ( $self, $id ) = splice @_;
my ( $uid, $ref ) = ( $id =~ /([^_]+?)_(.+)/ );
my ( $n, $res );
my ( $self, $id ) = splice @_;
my ( $uid, $ref ) = ( $id =~ /([^_]+?)_(.+)/ );
my ( $n, $res );
# Try to read notification
$n = $self->{notifObject}->_get( $uid, $ref );
......
......@@ -2285,7 +2285,8 @@ sub globalTests {
my $v = $conf->{$k};
$v =~ s/^$//;
next if ( $v =~ /^_/ );
push @tmp, $k
push @tmp,
$k
unless (
defined(
$conf->{exportedVars}->{$v}
......@@ -2461,7 +2462,7 @@ sub globalTests {
foreach ( keys %{ $conf->{authChoiceModules} } ) {
my ( $auth, $userDB, $passwordDB ) =
split( '|', $conf->{authChoiceModules}->{$_} );
$authChoice = 1 if $auth =~ /$type/i;
$authChoice = 1 if $auth =~ /$type/i;
$userDBChoice = 1 if $userDB =~ /$type/i;
}
}
......@@ -2471,7 +2472,7 @@ sub globalTests {
$k =~ /^$type/i
and not( $conf->{"issuerDB${type}Activation"} )
and not( $conf->{authentication} =~ /$type/i )
and not( $conf->{userDB} =~ /$type/i )
and not( $conf->{userDB} =~ /$type/i )
and not( defined $authChoice
or defined $userDBChoice )
)
......
......@@ -1066,8 +1066,8 @@ sub setAuthSessionInfo {
# Extract fields from exportedAttr value
my ( $mandatory, $name, $format, $friendly_name ) =
split( /;/,
$self->{samlIDPMetaDataExportedAttributes}->{$idpConfKey}
->{$_} );
$self->{samlIDPMetaDataExportedAttributes}->{$idpConfKey}->{$_}
);
# Try to get value
my $value =
......
......@@ -1583,8 +1583,8 @@ sub issuerForAuthUser {
my @attributes;
foreach (
keys
%{ $self->{samlSPMetaDataExportedAttributes}->{$spConfKey} } )
keys %{ $self->{samlSPMetaDataExportedAttributes}->{$spConfKey}
} )
{
# Extract fields from exportedAttr value
......
......@@ -44,7 +44,7 @@ sub setSessionInfo {
my %vars = ( %{ $self->{exportedVars} }, %{ $self->{openIdExportedVars} } );
while ( my ( $k, $v ) = each %vars ) {
my $attr = $k;
my $attr = $k;
my $required = ( $attr =~ s/^!// );
if ( $v =~ Lemonldap::NG::Common::Regexp::OPENIDSREGATTR() ) {
$self->{sessionInfo}->{$attr} = $self->param("openid.sreg.$v");
......
......@@ -29,7 +29,7 @@ sub new {
for ( my $i = 0 ; $i < 2 ; $i++ ) {
$stack[$i] =~ s/^Multi\s*//;
foreach my $l ( split /;/, $stack[$i] ) {
$l =~ s/^\s+//; # Remove first space
$l =~ s/^\s+//; # Remove first space
$l =~ /^([\w#]+)(?:\s+(.*))?$/
or $portal->abort( 'Bad configuration', "Unable to read $l" );
my ( $mod, $cond ) = ( $1, $2 );
......
......@@ -1287,7 +1287,7 @@ sub getAttributeValue {
next if ( $name ne $attr_name );
# Verify format and friendly name if given
next if ( $format and $format ne $attr_format );
next if ( $format and $format ne $attr_format );
next if ( $friendly_name and $friendly_name ne $attr_fname );
# Attribute is found, return its content
......
......@@ -39,7 +39,7 @@ my $envData = "127.0.0.1";
$ENV{REMOTE_ADDR} = $envData;
# Real Safe jail
ok( $p->{useSafeJail} == 1, 'Safe jail on' );
ok( $p->{useSafeJail} == 1, 'Safe jail on' );
ok( $p->safe->reval('$uid') eq $sessionData, 'Safe jail on - session data' );
ok( $p->safe->reval('$ENV{REMOTE_ADDR}') eq $envData,
'Safe jail on - env data' );
......@@ -53,7 +53,7 @@ $Lemonldap::NG::Portal::Simple::safe = undef;
$p->{useSafeJail} = 0;
# Fake Safe jail
ok( $p->{useSafeJail} == 0, 'Safe jail off' );
ok( $p->{useSafeJail} == 0, 'Safe jail off' );
ok( $p->safe->reval('$uid') eq $sessionData, 'Safe jail off - session data' );
ok( $p->safe->reval('$ENV{REMOTE_ADDR}') eq $envData,
'Safe jail off - env data' );
......
......@@ -41,8 +41,8 @@ $p3->{error} = 10;
$p3->{lang} = [ 'fr', 'es', 'en' ];
ok( $p1->error() eq $p2->error(10), 'HTTP_ACCEPT_LANGUAGE mechanism 1' );
ok( $p1->error() ne $p2->error(), 'HTTP_ACCEPT_LANGUAGE mechanism 2' );
ok( $p1->error() ne $p3->error(), 'HTTP_ACCEPT_LANGUAGE mechanism 3' );
ok( $p1->error() ne $p2->error(), 'HTTP_ACCEPT_LANGUAGE mechanism 2' );
ok( $p1->error() ne $p3->error(), 'HTTP_ACCEPT_LANGUAGE mechanism 3' );
ok( @en = @{&Lemonldap::NG::Portal::_i18n::msg_en},
'English messages translation' );
......
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