Commit fb74d03a authored by Clément OUDOT's avatar Clément OUDOT

Use whatToTrace for logging messages (#1991)

parent d343cc42
Pipeline #6864 passed with stage
in 14 minutes and 11 seconds
......@@ -8,7 +8,7 @@
# of lemonldap-ng.ini) and underlying handler configuration
package Lemonldap::NG::Portal::Main::Init;
our $VERSION = '2.0.6';
our $VERSION = '2.0.7';
package Lemonldap::NG::Portal::Main;
......@@ -140,24 +140,24 @@ sub init {
# psgi.js
->addUnauthRoute( 'psgi.js' => 'sendJs', ['GET'] )
->addAuthRoute( 'psgi.js' => 'sendJs', ['GET'] )
->addAuthRoute( 'psgi.js' => 'sendJs', ['GET'] )
# portal.css
->addUnauthRoute( 'portal.css' => 'sendCss', ['GET'] )
->addAuthRoute( 'portal.css' => 'sendCss', ['GET'] )
->addAuthRoute( 'portal.css' => 'sendCss', ['GET'] )
# lmerror
->addUnauthRoute( lmerror => { ':code' => 'lmError' }, ['GET'] )
->addAuthRoute( lmerror => { ':code' => 'lmError' }, ['GET'] )
->addAuthRoute( lmerror => { ':code' => 'lmError' }, ['GET'] )
# Core REST API
->addUnauthRoute( ping => 'pleaseAuth', ['GET'] )
->addUnauthRoute( ping => 'pleaseAuth', ['GET'] )
->addAuthRoute( ping => 'authenticated', ['GET'] )
# Refresh session
->addAuthRoute( refresh => 'refresh', ['GET'] )
->addAuthRoute( '*' => 'corsPreflight', ['OPTIONS'] )
->addAuthRoute( '*' => 'corsPreflight', ['OPTIONS'] )
->addUnauthRoute( '*' => 'corsPreflight', ['OPTIONS'] )
# Logout
......@@ -367,7 +367,8 @@ sub reloadConf {
delete $_[0]->pdata->{$k};
}
}
$self->userLogger->notice( $_[0]->user . ' connected' ) if $_[0]->user;
my $user_log = $_[0]->{sessionInfo}->{ $self->conf->{whatToTrace} };
$self->userLogger->notice( $user_log . ' connected' ) if $user_log;
if (@$tmp) {
$self->logger->debug(
'Add ' . join( ',', @$tmp ) . ' in keepPdata' );
......
package Lemonldap::NG::Portal::Main::Process;
our $VERSION = '2.0.6';
our $VERSION = '2.0.7';
package Lemonldap::NG::Portal::Main;
......@@ -320,7 +320,7 @@ sub authenticate {
$req->steps( [
'setSessionInfo', 'setMacros',
'setPersistentSessionInfo', 'storeHistory',
@{ $self->afterData }, sub { PE_BADCREDENTIALS }
@{ $self->afterData }, sub { PE_BADCREDENTIALS }
]
);
......@@ -520,8 +520,9 @@ sub buildCookie {
);
}
}
my $user_log = $req->{sessionInfo}->{ $self->conf->{whatToTrace} };
$self->userLogger->notice(
"User $req->{user} successfully authenticated at level $req->{sessionInfo}->{authenticationLevel}"
"User $user_log successfully authenticated at level $req->{sessionInfo}->{authenticationLevel}"
);
PE_OK;
}
......
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