From 738fb45b29f22097f26c244598d6713ecd929a5e Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 5 Jun 2013 10:56:12 +0200 Subject: [PATCH] =?utf8?q?Rose::DB:=20DB-Verbindung:=20Zuerst=20auf=20Type?= =?utf8?q?=20"AUTH"=20pr=C3=BCfen,=20dann=20leer=20nehmen,=20falls=20keine?= =?utf8?q?=20%::myconfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Andernfalls kann man aus admin.pl, wo %::myconfig oft genug leer ist, keine Rose::DB-Objekte Auth* nutzen. --- SL/DB.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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}) { -- 2.20.1