Commit 0f7b3ca7 authored by Yadd's avatar Yadd
Browse files

make tidy

parent b2620c26
......@@ -744,8 +744,7 @@ sub metadata {
}
else {
$self->logger->info(
"REST request to get configuration metadata ($res->{cfgNum})"
);
"REST request to get configuration metadata ($res->{cfgNum})" );
}
return $self->sendJSONresponse( $req, $res );
}
......
......@@ -33,7 +33,7 @@ sub new {
$self->env->{PATH_INFO} ||= '/';
$self->{uri} = uri_unescape( $self->env->{REQUEST_URI} );
$self->{uri} =~ s|^//+|/|g;
$self->{data} = {};
$self->{data} = {};
$self->{error} = 0;
$self->{respHeaders} = [];
return bless( $self, $_[0] );
......
......@@ -405,8 +405,7 @@ sub postUrlInit {
$class->buildSub($sub) )
{
$class->tsv->{maintenance}->{$vhost} = 1;
$class->logger->error(
"$class: Unable to build post data: "
$class->logger->error( "$class: Unable to build post data: "
. $class->tsv->{jail}->error );
}
......
......@@ -1457,7 +1457,7 @@ sub attributes {
grep { $_ =~ /Undefined subroutine/ ? () : $_ }
split( /\n/, $@ ) );
return $err ? ( 1, "__badExpression__: $err" ) : (1);
}
}
},
documentation => 'Virtualhost headers',
flags => 'h',
......
......@@ -376,7 +376,8 @@ sub diff {
my @cfgNum =
( scalar( $req->param('conf1') ), scalar( $req->param('conf2') ) );
my @conf;
$self->logger->debug(" Loading confs");
$self->logger->debug(" Loading confs");
# Load the 2 configurations
for ( my $i = 0 ; $i < 2 ; $i++ ) {
if ( %{ $self->currentConf }
......
......@@ -145,8 +145,7 @@ sub getStack {
my ( $self, $req, @steps ) = @_;
return $req->data->{combinationStack}
if ( $req->data->{combinationStack} );
my $stack = $req->data->{combinationStack} =
$self->stackSub->( $req->env );
my $stack = $req->data->{combinationStack} = $self->stackSub->( $req->env );
unless ($stack) {
$self->logger->error('No authentication scheme for this user');
}
......
......@@ -35,8 +35,8 @@ sub extractFormInfo {
my ( $self, $req ) = @_;
if ( $req->data->{_krbUser} ) {
$self->logger->debug( 'Kerberos ticket already validated for '
. $req->data->{_krbUser} );
$self->logger->debug(
'Kerberos ticket already validated for ' . $req->data->{_krbUser} );
return PE_OK;
}
......
......@@ -151,7 +151,11 @@ sub extractFormInfo {
my $check_url = $claimed_identity->check_url(
return_to => $self->conf->{portal}
. '?openid=1&'
. ( $req->data->{_url} ? build_urlencoded( url => $req->data->{_url} ) : '' ),
. (
$req->data->{_url}
? build_urlencoded( url => $req->data->{_url} )
: ''
),
trust_root => $self->conf->{portal},
delayed_return => 1,
);
......
......@@ -753,7 +753,7 @@ sub extractFormInfo {
my $res = $self->p->deleteSession($req);
return (
$res eq PE_LOGOUT_OK ? PE_SENDRESPONSE : $res );
}
}
]
);
......
......@@ -166,9 +166,11 @@ sub ssoMatch {
my ( $self, $req ) = @_;
my $url = $self->normalize_url( $req->uri, $self->conf->{issuerDBSAMLPath},
$self->ssoGetUrl );
return ( $url =~ $self->ssoUrlRe or $req->data->{_proxiedRequest}
? 1
: 0);
return (
$url =~ $self->ssoUrlRe or $req->data->{_proxiedRequest}
? 1
: 0
);
}
# Main method (launched only for authenticated users, see Main/Issuer)
......
......@@ -24,13 +24,13 @@ has availableModules => ( is => 'rw', default => sub { {} } );
# to each enabled underlying auth modules
sub betweenAuthAndData { '_betweenAuthAndData' }
sub afterData { '_afterData' }
sub forAuthUser { '_forAuthUser' }
sub beforeLogout { '_beforeLogout' }
sub forAuthUser { '_forAuthUser' }
sub beforeLogout { '_beforeLogout' }
sub _betweenAuthAndData { _wrapEntryPoint( @_, 'betweenAuthAndData' ); }
sub _afterData { _wrapEntryPoint( @_, 'afterData' ); }
sub _forAuthUser { _wrapEntryPoint( @_, 'forAuthUser', 1 ); }
sub _beforeLogout { _wrapEntryPoint( @_, 'beforeLogout', 1 ); }
sub _forAuthUser { _wrapEntryPoint( @_, 'forAuthUser', 1 ); }
sub _beforeLogout { _wrapEntryPoint( @_, 'beforeLogout', 1 ); }
sub _wrapEntryPoint {
my ( $self, $req, $name, $connected ) = @_;
......
......@@ -105,7 +105,7 @@ sub display {
&& $req->data->{login},
ASK_LOGINS => $req->param('checkLogins') || 0,
CONFIRMKEY => $self->stamp(),
LIST => $req->data->{list} || [],
LIST => $req->data->{list} || [],
REMEMBER => $req->data->{confirmRemember},
(
$req->data->{customScript}
......@@ -115,7 +115,6 @@ sub display {
);
}
# 1.3 There is a message to display
elsif ( my $info = $req->info ) {
$self->logger->debug('Display: info detected');
......
......@@ -161,8 +161,7 @@ sub deleteSession {
# TODO
# Collect logout services and build hidden iFrames
if ( $req->data->{logoutServices} and %{ $req->data->{logoutServices} } )
{
if ( $req->data->{logoutServices} and %{ $req->data->{logoutServices} } ) {
$self->logger->debug("Create iFrames to forward logout to services");
......
......@@ -88,8 +88,8 @@ sub login {
return $self->do(
$req,
[
'controlUrl', @{ $self->beforeAuth },
$self->authProcess, @{ $self->betweenAuthAndData },
'controlUrl', @{ $self->beforeAuth },
$self->authProcess, @{ $self->betweenAuthAndData },
$self->sessionData, @{ $self->afterData },
]
);
......@@ -100,8 +100,8 @@ sub postLogin {
return $self->do(
$req,
[
'restoreArgs', 'controlUrl',
@{ $self->beforeAuth }, $self->authProcess,
'restoreArgs', 'controlUrl',
@{ $self->beforeAuth }, $self->authProcess,
@{ $self->betweenAuthAndData }, $self->sessionData,
@{ $self->afterData },
]
......@@ -114,7 +114,7 @@ sub authenticatedRequest {
$req,
[
'importHandlerData', 'controlUrl',
'checkLogout', @{ $self->forAuthUser }
'checkLogout', @{ $self->forAuthUser }
]
);
}
......@@ -125,7 +125,7 @@ sub postAuthenticatedRequest {
$req,
[
'importHandlerData', 'restoreArgs',
'controlUrl', 'checkLogout',
'controlUrl', 'checkLogout',
@{ $self->forAuthUser }
]
);
......
......@@ -13,7 +13,7 @@ extends 'Lemonldap::NG::Common::Module';
# INTERFACE
use constant afterData => 'changeUrldc';
use constant afterData => 'changeUrldc';
use constant forAuthUser => 'changeUrldc';
sub init { 1 }
......
......@@ -488,8 +488,7 @@ sub display {
DISPLAY_PASSWORD_FORM => 0,
);
if ( $req->data->{mailToken}
and !$self->p->checkXSSAttack( 'mail_token', $req->data->{mailToken} )
)
and !$self->p->checkXSSAttack( 'mail_token', $req->data->{mailToken} ) )
{
$tplPrm{MAIL_TOKEN} = $req->data->{mailToken};
}
......
......@@ -398,8 +398,9 @@ sub display {
STARTMAILDATE => $req->data->{startMailDate},
STARTMAILTIME => $req->data->{startMailTime},
MAILALREADYSENT => $req->data->{mail_already_sent},
MAIL => $self->p->checkXSSAttack( 'mail',
$req->data->{registerInfo}->{mail} ) ? ""
MAIL => $self->p->checkXSSAttack(
'mail', $req->data->{registerInfo}->{mail}
) ? ""
: $req->data->{registerInfo}->{mail},
FIRSTNAME => $self->p->checkXSSAttack( 'firstname',
$req->data->{registerInfo}->{firstname} ) ? ""
......
......@@ -38,8 +38,8 @@ sub createUser {
);
if ( $mesg->is_error ) {
$self->userLogger->error( "Can not create entry for "
. $req->data->{registerInfo}->{login} );
$self->userLogger->error(
"Can not create entry for " . $req->data->{registerInfo}->{login} );
$self->logger->error( "LDAP error " . $mesg->error );
$self->ldap->unbind();
......
......@@ -67,8 +67,8 @@ sub createUser {
);
if ( $mesg->is_error ) {
$self->userLogger->error( "Can not create entry for "
. $req->data->{registerInfo}->{login} );
$self->userLogger->error(
"Can not create entry for " . $req->data->{registerInfo}->{login} );
$self->logger->error( "LDAP error " . $mesg->error );
$self->ldap->unbind();
......
......@@ -57,7 +57,7 @@ SKIP: {
or explain( $res->[1],
'Set-Cookie => lemonldapidp=0; domain=.sp.com; path=/; expires=-1d' );
( $host, $url, $query ) = expectForm( $res, undef, undef, 'confirm', );
my $spPdata = 'lemonldappdata=' . expectCookie($res, 'lemonldappdata');
my $spPdata = 'lemonldappdata=' . expectCookie( $res, 'lemonldappdata' );
# Choose SAML issuer
$query .= '&idp=http%3A%2F%2Fauth.idp.com%2Fsaml%2Fmetadata';
......@@ -70,7 +70,7 @@ SKIP: {
),
'Post SAML choice'
);
$spPdata = 'lemonldappdata=' . expectCookie($res, 'lemonldappdata');
$spPdata = 'lemonldappdata=' . expectCookie( $res, 'lemonldappdata' );
ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' )
or explain(
$res->[1],
......@@ -92,7 +92,7 @@ SKIP: {
'Post SAML request to IdP'
);
expectOK($res);
my $pdata = 'lemonldappdata=' . expectCookie($res, 'lemonldappdata');
my $pdata = 'lemonldappdata=' . expectCookie( $res, 'lemonldappdata' );
# Try to authenticate to IdP
$query = "user=french&password=french&$query";
......
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