Use user* methods instead of lmLog for user actions (can be put in syslog)

This commit is contained in:
Xavier Guimard 2013-10-13 12:15:01 +00:00
parent 01ae2b697d
commit ffda037c52
6 changed files with 13 additions and 14 deletions

View File

@ -139,9 +139,8 @@ sub checkGoogleSession {
# Case 1: value was asked but not returned, set an empty value
# in persistent session (so that it's defined)
if ( $self->{_AXNS} ) {
$self->lmLog(
"$v required attribute is missing in Google response, storing ''",
'info'
$self->_sub( 'userInfo',
"$v required attribute is missing in Google response, storing ''"
);
$h->{$v} = $gs->{$v} = '';
}
@ -149,9 +148,8 @@ sub checkGoogleSession {
# Case 2: value is not stored, probably configuration has
# changed and this value was never asked
else {
$self->lmLog(
"$v required attribute is missing in persistent session, let's ask it",
'info'
$self->_sub( 'userInfo',
"$v required attribute is missing in persistent session, let's ask it"
);
return 0;
}

View File

@ -77,7 +77,7 @@ sub extractFormInfo {
# If confirmation is needed
if ( my $setup_url = $csr->user_setup_url ) {
$self->lmLog( 'OpenID confirmation needed', 'info' );
$self->_sub( 'userInfo', 'OpenID confirmation needed' );
print $self->redirect($setup_url);
$self->quit();
}
@ -113,7 +113,8 @@ sub extractFormInfo {
if ( $tmp =~
$self->{_reopenIdIDPList} xor $self->{_openIdIDPListIsWhite} )
{
$self->lmLog( "$url is forbidden for openID exchange", 'warn' );
$self->_sub( 'userNotice',
"$url is forbidden for openID exchange" );
$self->{_msg} =
"OpenID error: $tmp is forbidden for OpenID echange";
return PE_BADPARTNER;

View File

@ -55,8 +55,8 @@ sub authenticate {
my $res = $self->{radius}->check_pwd( $self->{user}, $self->{password} );
unless ( $res == 1 ) {
$self->lmLog( "Unable to authenticate " . $self->{user} . " !",
'notice' );
$self->_sub( 'userNotice',
"Unable to authenticate " . $self->{user} . " !" );
return PE_BADCREDENTIALS;
}
return PE_OK;

View File

@ -62,7 +62,7 @@ sub getUser {
}
unless ( $self->{entry} = $sth->fetchrow_hashref() ) {
$self->lmLog( "User $user not found", 'notice' );
$self->_sub( 'userNotice', "User $user not found" );
return PE_BADCREDENTIALS;
}
@ -83,7 +83,7 @@ sub getUser {
my $results;
unless ( $results = $sth->fetchrow_hashref() ) {
$self->lmLog( "User $user not found", 'notice' );
$self->_sub( 'userNotice', "User $user not found" );
return PE_BADCREDENTIALS;
}

View File

@ -26,7 +26,7 @@ sub getCasSession {
# Session not available
if ($id) {
$self->lmLog( "CAS session $id isn't yet available", 'info' );
$self->_sub( 'userInfo', "CAS session $id isn't yet available" );
}
else {
$self->lmLog( "Unable to create new CAS session: $@", 'error' );

View File

@ -100,7 +100,7 @@ sub check_password {
return 1;
}
else {
$self->lmLog( "Bad password for $user", 'error' );
$self->_sub( 'userError', "Bad password for $user" );
return 0;
}