Portal: set _auth, _userDN, _passwordDB and _issuerDB in session, to know which module was used to open the session of the user
This commit is contained in:
parent
b0749b8877
commit
760f62e534
@ -857,22 +857,98 @@ sub existingSession {
|
|||||||
# * set $self->{user}
|
# * set $self->{user}
|
||||||
# * authenticate user if possible (or do it in authenticate())
|
# * authenticate user if possible (or do it in authenticate())
|
||||||
|
|
||||||
# userDBInit(): must be implemented in UserDB* module
|
## @apmethod int issuerDBInit()
|
||||||
|
# Set _issuerDB
|
||||||
|
# call issuerDBInit in issuerDB* module
|
||||||
|
# @return Lemonldap::NG::Portal constant
|
||||||
|
sub issuerDBInit {
|
||||||
|
my $self = shift;
|
||||||
|
my $issuerDB;
|
||||||
|
|
||||||
|
# Get the current authentication module
|
||||||
|
if ( $self->{_multi} ) {
|
||||||
|
|
||||||
|
# TODO - get the current module
|
||||||
|
$issuerDB = "Multi";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$issuerDB = $self->{issuerDB};
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{sessionInfo}->{_issuerDB} = $issuerDB;
|
||||||
|
|
||||||
|
return $self->SUPER::issuerDBInit();
|
||||||
|
}
|
||||||
|
|
||||||
# getUser(): must be implemented in UserDB* module
|
# getUser(): must be implemented in UserDB* module
|
||||||
|
|
||||||
# setAuthSessionInfo(): must be implemented in Auth* module:
|
## @apmethod int setAuthSessionInfo()
|
||||||
# * store exported datas in $self->{sessionInfo}
|
# Set _auth
|
||||||
|
# call setAuthSessionInfo in Auth* module
|
||||||
|
#@return Lemonldap::NG::Portal constant
|
||||||
|
sub setAuthSessionInfo {
|
||||||
|
my $self = shift;
|
||||||
|
my $auth;
|
||||||
|
|
||||||
# passwordDBInit(): must be implemented in PasswordDB* module
|
# Get the current authentication module
|
||||||
|
if ( $self->{_multi} ) {
|
||||||
|
|
||||||
|
# TODO - get the current module
|
||||||
|
$auth = "Multi";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$auth = $self->{authentication};
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{sessionInfo}->{_auth} = $auth;
|
||||||
|
|
||||||
|
return $self->SUPER::setAuthSessionInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
## @apmethod int passwordDBInit()
|
||||||
|
# Set _passwordDB
|
||||||
|
# call passwordDBInit in passwordDB* module
|
||||||
|
# @return Lemonldap::NG::Portal constant
|
||||||
|
sub passwordDBInit {
|
||||||
|
my $self = shift;
|
||||||
|
my $passwordDB;
|
||||||
|
|
||||||
|
# Get the current authentication module
|
||||||
|
if ( $self->{_multi} ) {
|
||||||
|
|
||||||
|
# TODO - get the current module
|
||||||
|
$passwordDB = "Multi";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$passwordDB = $self->{passwordDB};
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{sessionInfo}->{_passwordDB} = $passwordDB;
|
||||||
|
|
||||||
|
return $self->SUPER::passwordDBInit();
|
||||||
|
}
|
||||||
|
|
||||||
# modifyPassword(): must be implemented in PasswordDB* module
|
# modifyPassword(): must be implemented in PasswordDB* module
|
||||||
|
|
||||||
##@apmethod int setSessionInfo()
|
##@apmethod int setSessionInfo()
|
||||||
# Call setSessionInfo() in User* module and set ipAddr and startTime
|
# Set ipAddr, xForwardedForAddr, startTime, updateTime, _utime and _userDB
|
||||||
|
# Call setSessionInfo() in UserDB* module
|
||||||
#@return Lemonldap::NG::Portal constant
|
#@return Lemonldap::NG::Portal constant
|
||||||
sub setSessionInfo {
|
sub setSessionInfo {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
my $userDB;
|
||||||
|
|
||||||
|
# Get the current userDB module
|
||||||
|
if ( $self->{_multi} ) {
|
||||||
|
|
||||||
|
# TODO - get the current module
|
||||||
|
$userDB = "Multi";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$userDB = $self->{userDB};
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{sessionInfo}->{_userDB} = $userDB;
|
||||||
|
|
||||||
# Store IP address
|
# Store IP address
|
||||||
$self->{sessionInfo}->{ipAddr} = $ENV{REMOTE_ADDR};
|
$self->{sessionInfo}->{ipAddr} = $ENV{REMOTE_ADDR};
|
||||||
|
Loading…
Reference in New Issue
Block a user