From 71601d9c13343fe8451fee657de4c814fbfd108c Mon Sep 17 00:00:00 2001 From: linuxpoet Date: Tue, 20 Mar 2007 03:27:56 +0000 Subject: backport 1.3 sysconfig changes git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@953 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Sysconfig.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'LedgerSMB') diff --git a/LedgerSMB/Sysconfig.pm b/LedgerSMB/Sysconfig.pm index 7bcff26d..ef91c45d 100644 --- a/LedgerSMB/Sysconfig.pm +++ b/LedgerSMB/Sysconfig.pm @@ -78,8 +78,6 @@ $ENV{PERL5LIB} .= ":".(join ':', @{$config{environment}{PERL5LIB}}) if %printer = %{$config{printers}} if $config{printers}; -$memberfile = $config{paths}{memberfile} if $config{paths}{memberfile}; -$userspath = $config{paths}{userspath} if $config{paths}{userspath}; $localepath = $config{paths}{localepath} if $config{paths}{localepath}; $spool = $config{paths}{spool} if $config{paths}{spool}; $templates = $config{paths}{templates} if $config{paths}{templates}; @@ -90,19 +88,25 @@ $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}){ + my $dbconnect = "dbi:Pg:dbname=$globalDBname host=$globalDBhost + port=$globalDBport user=$globalDBUserName + password=$globalDBPassword"; # for easier debugging + $GLOBALDBH = DBI->connect($dbconnect); if (!$GLOBALDBH){ $form = new Form; $form->error("No GlobalDBH Configured or Could not Connect"); } } + # These lines prevent other apps in mod_perl from seeing the global db # connection info -- cgit v1.2.3