Revision 211f4e60
Von Moritz Bunkus vor mehr als 4 Jahren hinzugefügt
SL/Auth.pm | ||
---|---|---|
140 | 140 |
|
141 | 141 |
} else { |
142 | 142 |
$self->{DB_config} = $::lx_office_conf{'authentication/database'}; |
143 |
$self->{LDAP_config} = $::lx_office_conf{'authentication/ldap'}; |
|
144 | 143 |
} |
145 | 144 |
|
146 | 145 |
if ($self->{module} eq 'DB') { |
147 | 146 |
$self->{authenticator} = SL::Auth::DB->new($self); |
148 | 147 |
|
149 | 148 |
} elsif ($self->{module} eq 'LDAP') { |
150 |
$self->{authenticator} = SL::Auth::LDAP->new($self);
|
|
149 |
$self->{authenticator} = SL::Auth::LDAP->new($::lx_office_conf{'authentication/ldap'});
|
|
151 | 150 |
} |
152 | 151 |
|
153 | 152 |
if (!$self->{authenticator}) { |
SL/Auth/LDAP.pm | ||
---|---|---|
2 | 2 |
|
3 | 3 |
use English '-no_match_vars'; |
4 | 4 |
|
5 |
use Scalar::Util qw(weaken); |
|
6 | 5 |
use SL::Auth::Constants qw(:all); |
7 | 6 |
|
8 | 7 |
use strict; |
... | ... | |
12 | 11 |
die 'The module "Net::LDAP" is not installed.'; |
13 | 12 |
} |
14 | 13 |
|
15 |
my $type = shift; |
|
16 |
my $self = {}; |
|
17 |
|
|
18 |
$self->{auth} = shift; |
|
19 |
weaken $self->{auth}; |
|
14 |
my $type = shift; |
|
15 |
my $self = {}; |
|
16 |
$self->{config} = shift; |
|
20 | 17 |
|
21 | 18 |
bless $self, $type; |
22 | 19 |
|
... | ... | |
31 | 28 |
|
32 | 29 |
sub _connect { |
33 | 30 |
my $self = shift; |
34 |
my $cfg = $self->{auth}->{LDAP_config};
|
|
31 |
my $cfg = $self->{config}; |
|
35 | 32 |
|
36 | 33 |
return $self->{ldap} if $self->{ldap}; |
37 | 34 |
|
... | ... | |
65 | 62 |
|
66 | 63 |
my ($cfg, $filter); |
67 | 64 |
|
68 |
$cfg = $self->{auth}->{LDAP_config};
|
|
65 |
$cfg = $self->{config}; |
|
69 | 66 |
|
70 | 67 |
$filter = "$cfg->{filter}"; |
71 | 68 |
$filter =~ s|^\s+||; |
... | ... | |
104 | 101 |
|
105 | 102 |
return $self->{dn_cache}->{$login} if $self->{dn_cache}->{$login}; |
106 | 103 |
|
107 |
my $cfg = $self->{auth}->{LDAP_config};
|
|
104 |
my $cfg = $self->{config}; |
|
108 | 105 |
|
109 | 106 |
my $filter = $self->_get_filter($login); |
110 | 107 |
|
... | ... | |
160 | 157 |
my $locale = $main::locale; |
161 | 158 |
|
162 | 159 |
my $self = shift; |
163 |
my $cfg = $self->{auth}->{LDAP_config};
|
|
160 |
my $cfg = $self->{config}; |
|
164 | 161 |
|
165 | 162 |
if (!$cfg) { |
166 | 163 |
$form->error($locale->text('config/kivitendo.conf: Key "authentication/ldap" is missing.')); |
Auch abrufbar als: Unified diff
LDAP-Auth: Konfiguration über Konstruktur übergeben
Ist eine Vorarbeit dafür, das LDAP-Modul mit unterschiedlichen
Konfigurationen benutzen zu können.