Commit c8fe1156 authored by Yadd's avatar Yadd
Browse files

Little things (#595)

parent d097b4ec
......@@ -31,6 +31,8 @@ sub setAuthSessionInfo {
# Store password (deleted in checkRemoteId() if local policy does not accept
# stored passwords)
$req->{sessionInfo}->{'_password'} = $req->datas->{'password'};
$req->{sessionInfo}->{authenticationLevel} =
$req->datas->{rSessionInfo}->{authenticationLevel};
PE_OK;
}
......
......@@ -121,17 +121,17 @@ sub setAuthSessionInfo {
my ( $self, $req ) = @_;
# authenticationLevel
$self->{sessionInfo}->{authenticationLevel} = $self->authnLevel;
$req->{sessionInfo}->{authenticationLevel} = $self->authnLevel;
# Store submitted password if set in configuration
# WARNING: it can be a security hole
if ( $self->conf->{storePassword} ) {
$self->{sessionInfo}->{'_password'} = $req->datas->{'newpassword'}
$req->{sessionInfo}->{'_password'} = $req->datas->{'newpassword'}
|| $req->datas->{'password'};
}
# Store user timezone
$self->{sessionInfo}->{'_timezone'} = $self->{'timezone'};
$req->{sessionInfo}->{'_timezone'} = $self->{'timezone'};
PE_OK;
}
......
......@@ -178,8 +178,6 @@ sub reloadConf {
return 0
unless ( $self->{"_$type"} = $self->loadPlugin($module) );
}
$self->_authentication->authnLevel(
$self->conf->{ $self->conf->{authentication} . "AuthnLevel" // 0 } );
# Initialize trusted domain regexp
if ( $self->conf->{trustedDomains}
......
......@@ -245,7 +245,9 @@ sub authenticate {
sub setAuthSessionInfo {
my ( $self, $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',
'error' );
}
......
......@@ -159,6 +159,7 @@ sub do {
and (
$err != PE_REDIRECT
or ( $err == PE_REDIRECT
and $req->datas->{redirectFormMethod}
and $req->datas->{redirectFormMethod} eq 'post' )
)
)
......@@ -517,8 +518,8 @@ sub setHiddenFormValue {
# Store value
if ($val) {
$key = $prefix . $key;
$val = encode_base64($val,'') if $base64;
$key = $prefix . $key;
$val = encode_base64( $val, '' ) if $base64;
$req->{portalHiddenFormValues}->{$key} = $val;
$self->lmLog( "Store $val in hidden key $key", 'debug' );
}
......
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