From: Moritz Bunkus Date: Wed, 5 Jun 2013 08:56:12 +0000 (+0200) Subject: Rose::DB: DB-Verbindung: Zuerst auf Type "AUTH" prüfen, dann leer nehmen, falls keine... X-Git-Tag: release-3.1.0beta1~331^2~65 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=738fb45b29f22097f26c244598d6713ecd929a5e;p=kivitendo-erp.git 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. --- diff --git a/SL/DB.pm b/SL/DB.pm index f20e189a4..01251141e 100644 --- a/SL/DB.pm +++ b/SL/DB.pm @@ -49,12 +49,8 @@ sub _register_db { my %connect_settings; my $initial_sql; - if (!%::myconfig) { - $type = 'KIVITENDO_EMPTY'; - %connect_settings = ( driver => 'Pg' ); - - } elsif ($type eq 'KIVITENDO_AUTH') { - %connect_settings = ( driver => $::myconfig{dbdriver} || 'Pg', + if ($type eq 'KIVITENDO_AUTH') { + %connect_settings = ( driver => 'Pg', database => $::auth->{DB_config}->{db}, host => $::auth->{DB_config}->{host} || 'localhost', port => $::auth->{DB_config}->{port} || 5432, @@ -62,6 +58,10 @@ sub _register_db { password => $::auth->{DB_config}->{password}, connect_options => { pg_enable_utf8 => $::locale && $::locale->is_utf8, }); + } elsif (!%::myconfig) { + $type = 'KIVITENDO_EMPTY'; + %connect_settings = ( driver => 'Pg' ); + } else { my $european_dates = 0; if ($::myconfig{dateformat}) {