} else {
$self->{DB_config} = $::lx_office_conf{'authentication/database'};
- $self->{LDAP_config} = $::lx_office_conf{'authentication/ldap'};
}
if ($self->{module} eq 'DB') {
$self->{authenticator} = SL::Auth::DB->new($self);
} elsif ($self->{module} eq 'LDAP') {
- $self->{authenticator} = SL::Auth::LDAP->new($self);
+ $self->{authenticator} = SL::Auth::LDAP->new($::lx_office_conf{'authentication/ldap'});
}
if (!$self->{authenticator}) {
use English '-no_match_vars';
-use Scalar::Util qw(weaken);
use SL::Auth::Constants qw(:all);
use strict;
die 'The module "Net::LDAP" is not installed.';
}
- my $type = shift;
- my $self = {};
-
- $self->{auth} = shift;
- weaken $self->{auth};
+ my $type = shift;
+ my $self = {};
+ $self->{config} = shift;
bless $self, $type;
sub _connect {
my $self = shift;
- my $cfg = $self->{auth}->{LDAP_config};
+ my $cfg = $self->{config};
return $self->{ldap} if $self->{ldap};
my ($cfg, $filter);
- $cfg = $self->{auth}->{LDAP_config};
+ $cfg = $self->{config};
$filter = "$cfg->{filter}";
$filter =~ s|^\s+||;
return $self->{dn_cache}->{$login} if $self->{dn_cache}->{$login};
- my $cfg = $self->{auth}->{LDAP_config};
+ my $cfg = $self->{config};
my $filter = $self->_get_filter($login);
my $locale = $main::locale;
my $self = shift;
- my $cfg = $self->{auth}->{LDAP_config};
+ my $cfg = $self->{config};
if (!$cfg) {
$form->error($locale->text('config/kivitendo.conf: Key "authentication/ldap" is missing.'));