Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 94d3a3e9

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID 94d3a3e92e1d18cb1b9f9b2f85838e3854905966
  • Vorgänger db797d8f
  • Nachfolger 8317b7aa

Auth: Support für Verbindung zur Unit-Test-Datenbank

Unterschiede anzeigen:

SL/Auth.pm
34 34
sub new {
35 35
  $main::lxdebug->enter_sub();
36 36

  
37
  my $type = shift;
38
  my $self = {};
37
  my ($type, %params) = @_;
38
  my $self            = bless {}, $type;
39 39

  
40
  bless $self, $type;
41

  
42
  $self->_read_auth_config();
40
  $self->_read_auth_config(%params);
43 41
  $self->reset;
44 42

  
45 43
  $main::lxdebug->leave_sub();
......
50 48
sub reset {
51 49
  my ($self, %params) = @_;
52 50

  
51
  delete $self->{dbh};
53 52
  $self->{SESSION}            = { };
54 53
  $self->{FULL_RIGHTS}        = { };
55 54
  $self->{RIGHTS}             = { };
......
100 99
sub _read_auth_config {
101 100
  $main::lxdebug->enter_sub();
102 101

  
103
  my $self = shift;
102
  my ($self, %params) = @_;
104 103

  
105 104
  map { $self->{$_} = $::lx_office_conf{authentication}->{$_} } keys %{ $::lx_office_conf{authentication} };
106 105

  
107 106
  # Prevent password leakage to log files when dumping Auth instances.
108 107
  $self->{admin_password} = sub { $::lx_office_conf{authentication}->{admin_password} };
109 108

  
110
  $self->{DB_config}   = $::lx_office_conf{'authentication/database'};
111
  $self->{LDAP_config} = $::lx_office_conf{'authentication/ldap'};
109
  if ($params{unit_tests_database}) {
110
    $self->{DB_config}   = $::lx_office_conf{'testing/database'};
111
    $self->{module}      = 'DB';
112

  
113
  } else {
114
    $self->{DB_config}   = $::lx_office_conf{'authentication/database'};
115
    $self->{LDAP_config} = $::lx_office_conf{'authentication/ldap'};
116
  }
112 117

  
113 118
  if ($self->{module} eq 'DB') {
114 119
    $self->{authenticator} = SL::Auth::DB->new($self);

Auch abrufbar als: Unified diff