X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/1072cd08c6f5b1905a34dcb3eeab3ddec98d6905..dfa7a3a99a0b1ba731d1d4f81768308c10ace0d3:/SL/Auth.pm diff --git a/SL/Auth.pm b/SL/Auth.pm index f2d15a8c7..3b7a6287f 100644 --- a/SL/Auth.pm +++ b/SL/Auth.pm @@ -78,27 +78,11 @@ sub mini_error { sub _read_auth_config { $main::lxdebug->enter_sub(); - my $self = shift; - - my $code; - my $in = IO::File->new('config/authentication.pl', 'r'); - - if (!$in) { - my $locale = Locale->new('en'); - $self->mini_error($locale->text('The config file "config/authentication.pl" was not found.')); - } - - while (<$in>) { - $code .= $_; - } - $in->close(); - - eval $code; + my $self = shift; - if ($@) { - my $locale = Locale->new('en'); - $self->mini_error($locale->text('The config file "config/authentication.pl" contained invalid Perl code:'), $@); - } + map { $self->{$_} = $::lx_office_conf{authentication}->{$_} } keys %{ $::lx_office_conf{authentication} }; + $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); @@ -109,19 +93,19 @@ sub _read_auth_config { if (!$self->{authenticator}) { my $locale = Locale->new('en'); - $self->mini_error($locale->text('No or an unknown authenticantion module specified in "config/authentication.pl".')); + $self->mini_error($locale->text('No or an unknown authenticantion module specified in "config/lx_office.conf".')); } my $cfg = $self->{DB_config}; if (!$cfg) { my $locale = Locale->new('en'); - $self->mini_error($locale->text('config/authentication.pl: Key "DB_config" is missing.')); + $self->mini_error($locale->text('config/lx_office.conf: Key "DB_config" is missing.')); } if (!$cfg->{host} || !$cfg->{db} || !$cfg->{user}) { my $locale = Locale->new('en'); - $self->mini_error($locale->text('config/authentication.pl: Missing parameters in "DB_config". Required parameters are "host", "db" and "user".')); + $self->mini_error($locale->text('config/lx_office.conf: Missing parameters in "authentication/database". Required parameters are "host", "db" and "user".')); } $self->{authenticator}->verify_config();