Commit 3faa9329 authored by Clément OUDOT's avatar Clément OUDOT
Browse files

New userDB module: UserDBEnv, allows to collect environment variable as...

New userDB module: UserDBEnv, allows to collect environment variable as session elements, very usefull with AuthSSL
parent e6425fc7
...@@ -102,6 +102,7 @@ lib/Lemonldap/NG/Portal/PasswordDBLDAP.pm ...@@ -102,6 +102,7 @@ lib/Lemonldap/NG/Portal/PasswordDBLDAP.pm
lib/Lemonldap/NG/Portal/SAMLIssuer.pm lib/Lemonldap/NG/Portal/SAMLIssuer.pm
lib/Lemonldap/NG/Portal/SharedConf.pm lib/Lemonldap/NG/Portal/SharedConf.pm
lib/Lemonldap/NG/Portal/Simple.pm lib/Lemonldap/NG/Portal/Simple.pm
lib/Lemonldap/NG/Portal/UserDBEnv.pm
lib/Lemonldap/NG/Portal/UserDBLDAP.pm lib/Lemonldap/NG/Portal/UserDBLDAP.pm
lib/Lemonldap/NG/Portal/UserDBMulti.pm lib/Lemonldap/NG/Portal/UserDBMulti.pm
lib/Lemonldap/NG/Portal/UserDBNull.pm lib/Lemonldap/NG/Portal/UserDBNull.pm
......
## @file
# Env userDB mechanism
## @class
# Env userDB mechanism class
package Lemonldap::NG::Portal::UserDBEnv;
use strict;
use Lemonldap::NG::Portal::Simple;
our $VERSION = '0.1';
## @apmethod int userDBInit()
# Do nothing
# @return Lemonldap::NG::Portal constant
sub userDBInit {
PE_OK;
}
## @apmethod int getUser()
# Do nothing
# @return Lemonldap::NG::Portal constant
sub getUser {
PE_OK;
}
## @apmethod int setSessionInfo()
# Fetch all environment variables declared in exportedVars
# @return Lemonldap::NG::Portal constant
sub setSessionInfo {
my $self = shift;
# Check access to %ENV
unless ( defined %ENV ) {
$self->lmLog("No environment variables available", 'error');
return PE_ERROR;
}
# Parse exportedVars
if ( ref( $self->{exportedVars} ) eq 'HASH' ) {
foreach ( keys %{ $self->{exportedVars} } ) {
if ( exists $ENV{ $self->{exportedVars}->{$_} } ) {
$self->{sessionInfo}->{$_} = $ENV{ $self->{exportedVars}->{$_} };
}
}
}
PE_OK;
}
## @apmethod int setGroups()
# Do nothing
# @return Lemonldap::NG::Portal constant
sub setGroups {
PE_OK;
}
1;
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