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

51 lines
884 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;
use Lemonldap::NG::Portal::Lib::Slave;
use Lemonldap::NG::Portal::Main::Constants qw(PE_FORBIDDENIP PE_OK);
our $VERSION = '2.0.0';
2016-06-02 23:20:36 +02:00
extends 'Lemonldap::NG::Common::Module';
2016-05-25 21:30:43 +02:00
2016-06-09 20:40:20 +02:00
# INITIALIZATION
2016-05-25 21:30:43 +02:00
sub init { 1 }
2016-06-09 20:40:20 +02:00
# RUNNING METHODS
2016-05-25 21:30:43 +02:00
sub getUser {
PE_OK;
}
# 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 {
PE_OK;
}
1;