From 35522ea2952a82660cf67b81f0c81bc054eb59b8 Mon Sep 17 00:00:00 2001 From: linuxpoet Date: Wed, 14 Mar 2007 03:17:02 +0000 Subject: Modified to use single value pairs for each database parameter. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@893 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Sysconfig.pm | 12 ++++++++---- ledger-smb.conf | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/LedgerSMB/Sysconfig.pm b/LedgerSMB/Sysconfig.pm index d7d708a4..14bdfa2f 100644 --- a/LedgerSMB/Sysconfig.pm +++ b/LedgerSMB/Sysconfig.pm @@ -96,14 +96,18 @@ $sendmail = $config{mail}{sendmail} if $config{mail}{sendmail}; $smtphost = $config{mail}{smtphost} if $config{mail}{smtphost}; $smtptimeout = $config{mail}{smtptimeout} if $config{mail}{smtptimeout}; -$globalDBConnect = $config{globaldb}{DBConnect} if $config{globaldb}{DBConnect}; +# We used to have a global dbconnect but have moved to single entries +$globalDBhost = $config{globaldb}{DBhost} if $config{globaldb}{DBhost}; +$globalDBport = $config{globaldb}{DBport} if $config{globaldb}{DBport}; +$globalDBname = $config{globaldb}{DBname} if $config{globaldb}{DBname}; $globalDBUserName = $config{globaldb}{DBUserName} if $config{globaldb}{DBUserName}; $globalDBPassword = $config{globaldb}{DBPassword} if $config{globaldb}{DBPassword}; #putting this in an if clause for now so not to break other devel users -if ($config{globaldb}{DBConnect}){ - $GLOBALDBH = DBI->connect($globalDBConnect, $globalDBUserName, - $globalDBPassword); +if ($config{globaldb}{DBname}){ + $GLOBALDBH = DBI->connect("dbi:Pg:dbname=$globalDBname host=$globalDBhost + port=$globalDBport user=$globalDBUserName + password=$globalDBPassword"); if (!$GLOBALDBH){ $form = new Form; $form->error("No GlobalDBH Configured or Could not Connect"); diff --git a/ledger-smb.conf b/ledger-smb.conf index 68a75d33..6427cce6 100644 --- a/ledger-smb.conf +++ b/ledger-smb.conf @@ -13,6 +13,8 @@ PATH: /usr/local/pgsql/bin # [globaldb] ##uncomment below and set to correct values -DBConnect: dbi:Pg:dbname=lsmb13;host=localhost;port=5432 +DBname: lsmb13 +DBhost: localhost +DBport: 5432 DBUserName: postgres -# DBPassword: password +DBPassword: -- cgit v1.2.3