lemonldap-ng/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDB/Slave.pm

63 lines
957 B
Perl
Raw Normal View History

2016-05-25 21:30:43 +02:00
## @file
# Slave userDB mechanism
## @class
# Slave userDB mechanism class
package Lemonldap::NG::Portal::UserDB::Slave;
use strict;
use Mouse;
2020-11-16 21:49:41 +01:00
use Lemonldap::NG::Portal::Main::Constants qw(
PE_OK
PE_FORBIDDENIP
);
2016-05-25 21:30:43 +02:00
2021-04-01 23:07:58 +02:00
our $VERSION = '2.0.12';
2020-11-16 21:49:41 +01:00
extends qw(
Lemonldap::NG::Common::Module
Lemonldap::NG::Portal::Lib::Slave
);
2016-05-25 21:30:43 +02:00
2016-06-09 20:40:20 +02:00
# INITIALIZATION
2021-04-01 23:07:58 +02:00
sub init {
return 1;
}
2016-05-25 21:30:43 +02:00
2016-06-09 20:40:20 +02:00
# RUNNING METHODS
2016-05-25 21:30:43 +02:00
sub getUser {
2021-04-01 23:07:58 +02:00
return PE_OK;
2016-05-25 21:30:43 +02:00
}
2020-12-22 15:17:23 +01:00
sub findUser {
2021-04-01 23:07:58 +02:00
return PE_OK;
2020-12-22 15:17:23 +01:00
}
2016-05-25 21:30:43 +02:00
# Search exportedVars values in HTTP headers.
sub setSessionInfo {
my ( $self, $req ) = @_;
return PE_FORBIDDENIP
unless ( $self->checkIP($req) );
my %vars = (
%{ $self->conf->{exportedVars} },
%{ $self->conf->{slaveExportedVars} }
);
while ( my ( $k, $v ) = each %vars ) {
$v = 'HTTP_' . uc($v);
$v =~ s/\-/_/g;
$req->{sessionInfo}->{$k} = $req->{$v};
}
return PE_OK;
}
sub setGroups {
2021-04-01 23:07:58 +02:00
return PE_OK;
2016-05-25 21:30:43 +02:00
}
1;