Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision dfa7a3a9

Von Moritz Bunkus vor fast 14 Jahren hinzugefügt

  • ID dfa7a3a99a0b1ba731d1d4f81768308c10ace0d3
  • Vorgänger 7b4699d8
  • Nachfolger 78740763

Konfigurationsdatei config/authentication.pl nach config/lx_office.conf(.default) gemerget

Unterschiede anzeigen:

SL/Auth.pm
78 78
sub _read_auth_config {
79 79
  $main::lxdebug->enter_sub();
80 80

  
81
  my $self   = shift;
82

  
83
  my $code;
84
  my $in = IO::File->new('config/authentication.pl', 'r');
85

  
86
  if (!$in) {
87
    my $locale = Locale->new('en');
88
    $self->mini_error($locale->text('The config file "config/authentication.pl" was not found.'));
89
  }
90

  
91
  while (<$in>) {
92
    $code .= $_;
93
  }
94
  $in->close();
95

  
96
  eval $code;
81
  my $self = shift;
97 82

  
98
  if ($@) {
99
    my $locale = Locale->new('en');
100
    $self->mini_error($locale->text('The config file "config/authentication.pl" contained invalid Perl code:'), $@);
101
  }
83
  map { $self->{$_} = $::lx_office_conf{authentication}->{$_} } keys %{ $::lx_office_conf{authentication} };
84
  $self->{DB_config}   = $::lx_office_conf{'authentication/database'};
85
  $self->{LDAP_config} = $::lx_office_conf{'authentication/ldap'};
102 86

  
103 87
  if ($self->{module} eq 'DB') {
104 88
    $self->{authenticator} = SL::Auth::DB->new($self);
......
109 93

  
110 94
  if (!$self->{authenticator}) {
111 95
    my $locale = Locale->new('en');
112
    $self->mini_error($locale->text('No or an unknown authenticantion module specified in "config/authentication.pl".'));
96
    $self->mini_error($locale->text('No or an unknown authenticantion module specified in "config/lx_office.conf".'));
113 97
  }
114 98

  
115 99
  my $cfg = $self->{DB_config};
116 100

  
117 101
  if (!$cfg) {
118 102
    my $locale = Locale->new('en');
119
    $self->mini_error($locale->text('config/authentication.pl: Key "DB_config" is missing.'));
103
    $self->mini_error($locale->text('config/lx_office.conf: Key "DB_config" is missing.'));
120 104
  }
121 105

  
122 106
  if (!$cfg->{host} || !$cfg->{db} || !$cfg->{user}) {
123 107
    my $locale = Locale->new('en');
124
    $self->mini_error($locale->text('config/authentication.pl: Missing parameters in "DB_config". Required parameters are "host", "db" and "user".'));
108
    $self->mini_error($locale->text('config/lx_office.conf: Missing parameters in "authentication/database". Required parameters are "host", "db" and "user".'));
125 109
  }
126 110

  
127 111
  $self->{authenticator}->verify_config();

Auch abrufbar als: Unified diff