[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [953] branches/1.2/LedgerSMB/Sysconfig.pm



Revision: 953
          http://svn.sourceforge.net/ledger-smb/?rev=953&view=rev
Author:   linuxpoet
Date:     2007-03-19 20:27:56 -0700 (Mon, 19 Mar 2007)

Log Message:
-----------
backport 1.3 sysconfig changes

Modified Paths:
--------------
    branches/1.2/LedgerSMB/Sysconfig.pm

Modified: branches/1.2/LedgerSMB/Sysconfig.pm
===================================================================
--- branches/1.2/LedgerSMB/Sysconfig.pm	2007-03-20 03:07:30 UTC (rev 952)
+++ branches/1.2/LedgerSMB/Sysconfig.pm	2007-03-20 03:27:56 UTC (rev 953)
@@ -78,8 +78,6 @@
 
 %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 @@
 $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
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.