Revision 738fb45b
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/DB.pm | ||
---|---|---|
49 | 49 |
my %connect_settings; |
50 | 50 |
my $initial_sql; |
51 | 51 |
|
52 |
if (!%::myconfig) { |
|
53 |
$type = 'KIVITENDO_EMPTY'; |
|
54 |
%connect_settings = ( driver => 'Pg' ); |
|
55 |
|
|
56 |
} elsif ($type eq 'KIVITENDO_AUTH') { |
|
57 |
%connect_settings = ( driver => $::myconfig{dbdriver} || 'Pg', |
|
52 |
if ($type eq 'KIVITENDO_AUTH') { |
|
53 |
%connect_settings = ( driver => 'Pg', |
|
58 | 54 |
database => $::auth->{DB_config}->{db}, |
59 | 55 |
host => $::auth->{DB_config}->{host} || 'localhost', |
60 | 56 |
port => $::auth->{DB_config}->{port} || 5432, |
... | ... | |
62 | 58 |
password => $::auth->{DB_config}->{password}, |
63 | 59 |
connect_options => { pg_enable_utf8 => $::locale && $::locale->is_utf8, |
64 | 60 |
}); |
61 |
} elsif (!%::myconfig) { |
|
62 |
$type = 'KIVITENDO_EMPTY'; |
|
63 |
%connect_settings = ( driver => 'Pg' ); |
|
64 |
|
|
65 | 65 |
} else { |
66 | 66 |
my $european_dates = 0; |
67 | 67 |
if ($::myconfig{dateformat}) { |
Auch abrufbar als: Unified diff
Rose::DB: DB-Verbindung: Zuerst auf Type "AUTH" prüfen, dann leer nehmen, falls keine %::myconfig
Andernfalls kann man aus admin.pl, wo %::myconfig oft genug leer ist,
keine Rose::DB-Objekte Auth* nutzen.