Commit be1b5086 authored by Xavier Guimard's avatar Xavier Guimard

Avoid some warnings (#595)

parent 4e398404
......@@ -60,7 +60,9 @@ sub extractFormInfo {
my $url_param = 'url=' . uri_escape( $req->datas->{_url} );
$local_url .= ( $local_url =~ /\?/ ? '&' : '?' ) . $url_param;
}
if ( my $tmp = $req->param( $self->conf->{authChoiceParam} ) ) {
if ( $self->conf->{authChoiceParam}
and my $tmp = $req->param( $self->conf->{authChoiceParam} ) )
{
my $url_param = $self->conf->{authChoiceParam} . '=' . uri_escape($tmp);
$local_url .= ( $local_url =~ /\?/ ? '&' : '?' ) . $url_param;
}
......@@ -84,7 +86,9 @@ sub extractFormInfo {
$self->lmLog( "CAS: Proxy mode activated", 'debug' );
my $proxy_url = $self->p->fullUrl($req) . '?casProxy=1';
if ( my $tmp = $req->param( $self->conf->{authChoiceParam} ) ) {
if ( $self->conf->{authChoiceParam}
and my $tmp = $req->param( $self->conf->{authChoiceParam} ) )
{
$proxy_url .= '&' . $self->conf->{authChoiceParam} . "=$tmp";
}
......
......@@ -150,9 +150,10 @@ sub extractFormInfo {
. build_urlencoded(
( $req->datas->{_url} ? ( url => $req->datas->{_url} ) : () ),
(
$req->param( $self->conf->{authChoiceParam} )
$self->conf->{authChoiceParam}
and $req->param( $self->conf->{authChoiceParam} )
? ( $self->conf->{authChoiceParam} =>
$req->param( $self->{authChoiceParam} ) )
$req->param( $self->conf->{authChoiceParam} ) )
: ()
)
),
......@@ -162,16 +163,22 @@ sub extractFormInfo {
# If UserDB uses OpenID, add "OpenID Simple Registration Extension"
# compatible fields
if ( $self->p->getModule($req,'user') eq 'OpenID' ) {
if ( $self->p->getModule( $req, 'user' ) eq 'OpenID' ) {
my ( @r, @o );
my %vars = ( %{ $self->conf->{exportedVars} }, %{ $self->conf->{openIdExportedVars} } );
my %vars = (
%{ $self->conf->{exportedVars} },
%{ $self->conf->{openIdExportedVars} }
);
while ( my ( $v, $k ) = each %vars ) {
if ( $k =~ Lemonldap::NG::Common::Regexp::OPENIDSREGATTR() ) {
if ( $v =~ s/^!// ) { push @r, $k }
else { push @o, $k }
}
else {
$self->lmLog( qq'Unknown "OpenID Simple Registration Extension" field name: $k', 'warn');
$self->lmLog(
qq'Unknown "OpenID Simple Registration Extension" field name: $k',
'warn'
);
}
}
my @tmp;
......@@ -190,7 +197,8 @@ sub authenticate {
sub setAuthSessionInfo {
my ( $self, $req ) = @_;
$req->{sessionInfo}->{authenticationLevel} = $self->conf->{openIdAuthnLevel};
$req->{sessionInfo}->{authenticationLevel} =
$self->conf->{openIdAuthnLevel};
PE_OK;
}
......
......@@ -214,7 +214,9 @@ sub getCallbackUri {
: '?' . $callback_get_param . '=1';
# Use authChoiceParam in redirect URL
if ( $req->param( $self->conf->{authChoiceParam} ) ) {
if ( $self->conf->{authChoiceParam}
and $req->param( $self->conf->{authChoiceParam} ) )
{
$callback_uri .= '&'
. build_urlencoded( $self->{authChoiceParam} =>
$req->param( $self->conf->{authChoiceParam} ) );
......
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