Rose-Datenbankverbindung: Wenn 'dbhost' leer ist, Fallback auf 'localhost' nutzen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 16 Feb 2011 14:16:21 +0000 (15:16 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 16 Feb 2011 14:16:21 +0000 (15:16 +0100)
So ist es auch im Rest des Programms implementiert.

SL/DB.pm

index f90a9c6..67888ef 100644 (file)
--- a/SL/DB.pm
+++ b/SL/DB.pm
@@ -65,7 +65,7 @@ sub _register_db {
   } elsif ($type eq 'LXOFFICE_AUTH') {
     %connect_settings = ( driver          => $::myconfig{dbdriver} || 'Pg',
                           database        => $::auth->{DB_config}->{db},
-                          host            => $::auth->{DB_config}->{host},
+                          host            => $::auth->{DB_config}->{host} || 'localhost',
                           port            => $::auth->{DB_config}->{port} || 5432,
                           username        => $::auth->{DB_config}->{user},
                           password        => $::auth->{DB_config}->{password},
@@ -79,7 +79,7 @@ sub _register_db {
 
     %connect_settings = ( driver          => $::myconfig{dbdriver} || 'Pg',
                           database        => $::myconfig{dbname},
-                          host            => $::myconfig{dbhost},
+                          host            => $::myconfig{dbhost} || 'localhost',
                           port            => $::myconfig{dbport} || 5432,
                           username        => $::myconfig{dbuser},
                           password        => $::myconfig{dbpasswd},