Use new session API in Handler/CGI (#671)
This commit is contained in:
parent
dd11694c76
commit
bb2c6f0003
|
@ -8,6 +8,7 @@ package Lemonldap::NG::Handler::CGI;
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
use Lemonldap::NG::Common::CGI;
|
use Lemonldap::NG::Common::CGI;
|
||||||
|
use Lemonldap::NG::Common::Session;
|
||||||
use CGI::Cookie;
|
use CGI::Cookie;
|
||||||
use MIME::Base64;
|
use MIME::Base64;
|
||||||
|
|
||||||
|
@ -103,22 +104,26 @@ sub authenticate {
|
||||||
return $self->goToPortal();
|
return $self->goToPortal();
|
||||||
}
|
}
|
||||||
unless ( $datas and $id eq $datas->{_session_id} ) {
|
unless ( $datas and $id eq $datas->{_session_id} ) {
|
||||||
unless ($tsv->{refLocalStorage}
|
|
||||||
and $datas = $tsv->{refLocalStorage}->get($id) )
|
my $apacheSession = Lemonldap::NG::Common::Session->new(
|
||||||
{
|
{
|
||||||
my %h;
|
storageModule => $tsv->{globalStorage},
|
||||||
eval {
|
storageModuleOptions => $tsv->{globalStorageOptions},
|
||||||
tie %h, $tsv->{globalStorage}, $id,
|
cacheModule => $tsv->{localSessionStorage},
|
||||||
$tsv->{globalStorageOptions};
|
cacheModuleOptions => $tsv->{localSessionStorageOptions},
|
||||||
};
|
id => $id,
|
||||||
if ($@) {
|
kind => "SSO",
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
unless ( $apacheSession->data ) {
|
||||||
|
Lemonldap::NG::Handler::Main::Logger->lmLog(
|
||||||
|
"Session $id can't be retrieved", 'info' );
|
||||||
return $self->goToPortal();
|
return $self->goToPortal();
|
||||||
}
|
}
|
||||||
$datas->{$_} = $h{$_} foreach ( keys %h );
|
|
||||||
if ( $tsv->{refLocalStorage} ) {
|
$datas->{$_} = $apacheSession->data->{$_}
|
||||||
$tsv->{refLocalStorage}->set( $id, $datas, "10 minutes" );
|
foreach ( keys %{ $apacheSession->data } );
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Accounting : set user in apache logs
|
# Accounting : set user in apache logs
|
||||||
|
|
Loading…
Reference in New Issue
Block a user