Little things (#595)

This commit is contained in:
Xavier Guimard 2016-12-02 05:47:38 +00:00
parent d097b4ec0a
commit c8fe115650
5 changed files with 11 additions and 8 deletions

View File

@ -31,6 +31,8 @@ sub setAuthSessionInfo {
# Store password (deleted in checkRemoteId() if local policy does not accept # Store password (deleted in checkRemoteId() if local policy does not accept
# stored passwords) # stored passwords)
$req->{sessionInfo}->{'_password'} = $req->datas->{'password'}; $req->{sessionInfo}->{'_password'} = $req->datas->{'password'};
$req->{sessionInfo}->{authenticationLevel} =
$req->datas->{rSessionInfo}->{authenticationLevel};
PE_OK; PE_OK;
} }

View File

@ -121,17 +121,17 @@ sub setAuthSessionInfo {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
# authenticationLevel # authenticationLevel
$self->{sessionInfo}->{authenticationLevel} = $self->authnLevel; $req->{sessionInfo}->{authenticationLevel} = $self->authnLevel;
# Store submitted password if set in configuration # Store submitted password if set in configuration
# WARNING: it can be a security hole # WARNING: it can be a security hole
if ( $self->conf->{storePassword} ) { if ( $self->conf->{storePassword} ) {
$self->{sessionInfo}->{'_password'} = $req->datas->{'newpassword'} $req->{sessionInfo}->{'_password'} = $req->datas->{'newpassword'}
|| $req->datas->{'password'}; || $req->datas->{'password'};
} }
# Store user timezone # Store user timezone
$self->{sessionInfo}->{'_timezone'} = $self->{'timezone'}; $req->{sessionInfo}->{'_timezone'} = $self->{'timezone'};
PE_OK; PE_OK;
} }

View File

@ -178,8 +178,6 @@ sub reloadConf {
return 0 return 0
unless ( $self->{"_$type"} = $self->loadPlugin($module) ); unless ( $self->{"_$type"} = $self->loadPlugin($module) );
} }
$self->_authentication->authnLevel(
$self->conf->{ $self->conf->{authentication} . "AuthnLevel" // 0 } );
# Initialize trusted domain regexp # Initialize trusted domain regexp
if ( $self->conf->{trustedDomains} if ( $self->conf->{trustedDomains}

View File

@ -245,7 +245,9 @@ sub authenticate {
sub setAuthSessionInfo { sub setAuthSessionInfo {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
my $ret = $self->_authentication->setAuthSessionInfo($req); my $ret = $self->_authentication->setAuthSessionInfo($req);
if ( $ret == PE_OK and not( $req->sessionInfo->{authenticationLevel} ) ) { if ( $ret == PE_OK
and not( defined $req->sessionInfo->{authenticationLevel} ) )
{
$self->lmLog( 'Authentication level is not set by auth module', $self->lmLog( 'Authentication level is not set by auth module',
'error' ); 'error' );
} }

View File

@ -159,6 +159,7 @@ sub do {
and ( and (
$err != PE_REDIRECT $err != PE_REDIRECT
or ( $err == PE_REDIRECT or ( $err == PE_REDIRECT
and $req->datas->{redirectFormMethod}
and $req->datas->{redirectFormMethod} eq 'post' ) and $req->datas->{redirectFormMethod} eq 'post' )
) )
) )
@ -517,8 +518,8 @@ sub setHiddenFormValue {
# Store value # Store value
if ($val) { if ($val) {
$key = $prefix . $key; $key = $prefix . $key;
$val = encode_base64($val,'') if $base64; $val = encode_base64( $val, '' ) if $base64;
$req->{portalHiddenFormValues}->{$key} = $val; $req->{portalHiddenFormValues}->{$key} = $val;
$self->lmLog( "Store $val in hidden key $key", 'debug' ); $self->lmLog( "Store $val in hidden key $key", 'debug' );
} }