2009-12-04 18:01:30 +01:00
|
|
|
## @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 ) {
|
2009-12-11 22:17:06 +01:00
|
|
|
$self->lmLog( "No environment variables available", 'error' );
|
2009-12-04 18:01:30 +01:00
|
|
|
return PE_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Parse exportedVars
|
|
|
|
if ( ref( $self->{exportedVars} ) eq 'HASH' ) {
|
|
|
|
foreach ( keys %{ $self->{exportedVars} } ) {
|
|
|
|
if ( exists $ENV{ $self->{exportedVars}->{$_} } ) {
|
2009-12-11 22:17:06 +01:00
|
|
|
$self->{sessionInfo}->{$_} =
|
|
|
|
$ENV{ $self->{exportedVars}->{$_} };
|
2009-12-04 18:01:30 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PE_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
## @apmethod int setGroups()
|
|
|
|
# Do nothing
|
|
|
|
# @return Lemonldap::NG::Portal constant
|
|
|
|
sub setGroups {
|
|
|
|
PE_OK;
|
|
|
|
}
|
|
|
|
1;
|
|
|
|
|