Commit 58039527 authored by Yadd's avatar Yadd
Browse files

* delete log() method from the portal :

  * user actions are logged by userNotice() and userError()
  * other access are logged by HTTP server
* create authenticate() method in Simple.pm used to launch userNotice() for
  all authentication method
parent b6cdee5d
......@@ -38,8 +38,6 @@ sub extractFormInfo {
# Does nothing.
# @return Lemonldap::NG::Portal constant
sub authenticate {
$self->_sub('userNotice', "Good authentication for "
. $self->{sessionInfo}->{ $self->{whatToTrace} } );
PE_OK;
}
......
......@@ -49,8 +49,6 @@ sub extractFormInfo {
# Does nothing.
# @return Lemonldap::NG::Portal constant
sub authenticate {
$self->_sub('userNotice', "Good authentication for "
. $self->{sessionInfo}->{ $self->{whatToTrace} } );
PE_OK;
}
......
......@@ -242,15 +242,14 @@ sub process {
elsif ( $urldir eq $self->PC_LA_URLFT ) {
$self->{error} = $self->_subProcess(
qw( libertyFederationTermination log autoRedirect ));
qw( libertyFederationTermination autoRedirect ));
# federationTerminationReturn
}
elsif ( $urldir eq $self->PC_LA_URLFTR ) {
$self->{error} = $self->_subProcess(
qw( libertyFederationTerminationReturn log
autoRedirect )
qw( libertyFederationTerminationReturn autoRedirect )
);
# singleLogout : called when IDP request Logout.
......@@ -270,19 +269,19 @@ sub process {
elsif ( $urldir eq $self->PC_LA_URLSLR ) {
$self->{error} =
$self->_subProcess(qw( libertySingleLogoutReturn log ));
$self->_subProcess(qw( libertySingleLogoutReturn ));
# soapCall
}
elsif ( $urldir eq $self->PC_LA_URLSC ) {
$self->{error} = $self->_subProcess(qw( libertySoapCall log ));
$self->{error} = $self->_subProcess(qw( libertySoapCall ));
# soapEndpoint
}
elsif ( $urldir eq $self->PC_LA_URLSE ) {
$self->{error} = $self->_subProcess(qw( libertySoapEndpoint log ));
$self->{error} = $self->_subProcess(qw( libertySoapEndpoint ));
# Direct access or simple access -> main
# WARNING : we permit authentication on service.
......@@ -293,9 +292,8 @@ sub process {
{
$self->{error} = $self->_subProcess(
qw( libertyRetrieveExistingSession
libertyExtractFormInfo libertySignOn log
autoRedirect )
qw( libertyRetrieveExistingSession libertyExtractFormInfo
libertySignOn autoRedirect )
);
# Not in liberty authentication process.
......@@ -313,8 +311,8 @@ sub process {
# TODO Warning, PE_OK==0 and process returns 0 if an error occurs!
# my $err = $self->SUPER::process(@_);
#return $err unless( $err != PE_OK );
# TODO: Why ? log and autoRedirect are executed with SUPER::process
#$err = $self->_subProcess(qw( log autoRedirect ))
# TODO: Why ? autoRedirect is executed with SUPER::process
#$err = $self->_subProcess(qw( autoRedirect ))
# if ( $self->{urldc} );
#return $err;
# So I think we have just to write this
......
......@@ -99,8 +99,6 @@ sub authenticate {
}
}
$self->{sessionInfo}->{authenticationLevel} = 2;
$self->_sub('userNotice', "Good authentication for "
. $self->{sessionInfo}->{ $self->{whatToTrace} } );
PE_OK;
}
......
......@@ -61,8 +61,6 @@ sub authenticate {
if ( $self->{sessionInfo}->{authenticationLevel}
and $self->{sessionInfo}->{authenticationLevel} > 4 )
{
$self->_sub('userNotice', "Good authentication for "
. $self->{sessionInfo}->{ $self->{whatToTrace} } );
return PE_OK;
}
return $self->SUPER::authenticate(@_);
......
......@@ -473,7 +473,7 @@ sub getCookies {
else {
$self->{error} = $self->_subProcess(
qw(authInit userDBInit getUser setAuthSessionInfo setSessionInfo
setMacros setGroups authenticate store buildCookie log)
setMacros setGroups authenticate store buildCookie)
);
}
my @tmp = ();
......@@ -514,8 +514,8 @@ sub process {
$self->{error} = $self->_subProcess(
qw(controlUrlOrigin checkNotifBack controlExistingSession authInit
extractFormInfo userDBInit getUser setAuthSessionInfo setSessionInfo
setMacros setGroups authenticate store buildCookie log
checkNotification autoRedirect)
setMacros setGroups authenticate store buildCookie checkNotification
autoRedirect)
);
$self->updateStatus;
return ( ( $self->{error} > 0 ) ? 0 : 1 );
......@@ -566,7 +566,7 @@ sub checkNotifBack {
}
else {
$self->{error} =
$self->_subProcess(qw(log checkNotification autoRedirect));
$self->_subProcess(qw(checkNotification autoRedirect));
return $self->{error} || PE_DONE;
}
}
......@@ -619,7 +619,7 @@ sub controlExistingSession {
);
$self->{error} = PE_REDIRECT;
$self->_sub('userNotice', $self->{sessionInfo}->{$self->{whatToTrace}}." has been disconnected");
$self->_subProcess(qw(log autoRedirect));
$self->_subProcess(qw(autoRedirect));
return PE_FIRSTACCESS;
}
untie(%$h);
......@@ -636,7 +636,7 @@ sub controlExistingSession {
}
if ( $r == PE_DONE ) {
$self->{error} =
$self->_subProcess(qw(log checkNotification autoRedirect));
$self->_subProcess(qw(checkNotification autoRedirect));
return $self->{error} || PE_DONE;
}
else {
......@@ -717,6 +717,14 @@ sub setGroups {
# 12. authenticate() : must be implemented in Auth* module:
# * authenticate the user if not done before
sub authenticate {
my $self = shift;
my $tmp;
return $tmp if($tmp = $self->SUPER::authenticate());
$self->_sub('userNotice', "Good authentication for "
. $self->{sessionInfo}->{ $self->{whatToTrace} } );
PE_OK;
}
##@method int store()
# 13) Store user's datas in sessions database.
......@@ -755,18 +763,8 @@ sub buildCookie {
PE_OK;
}
##@method int log()
# 15) Log portal access.
# By default, nothing is logged. Users access are logged by Apache.
# Note that authentications and logout are logged by userLog() and userError()
# logs user errors.
#@return Lemonldap::NG::Portal constant
sub log {
PE_OK;
}
##@method int checkNotification()
# 16) Check if messages has to be notified.
# 15) Check if messages has to be notified.
# Call Lemonldap::NG::Portal::Notification::getNotification().
#@return Lemonldap::NG::Portal constant
sub checkNotification {
......@@ -781,7 +779,7 @@ sub checkNotification {
}
##@method int autoRedirect()
# 17) If the user was redirected to the portal, we will now redirect him
# 16) If the user was redirected to the portal, we will now redirect him
# to the requested URL.
#@return Lemonldap::NG::Portal constant
sub autoRedirect {
......
......@@ -56,7 +56,7 @@ sub search {
return PE_LDAPERROR;
}
unless ( $self->{entry} = $mesg->entry(0) ) {
$self->_sub('userError',"self->{user} was not found in LDAP directory");
$self->_sub('userError',"$self->{user} was not found in LDAP directory");
return PE_BADCREDENTIALS;
}
$self->{dn} = $self->{entry}->dn();
......
Supports Markdown
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