summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristopherm <christopherm@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-31 19:27:18 +0000
committerchristopherm <christopherm@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-31 19:27:18 +0000
commit6a7e49e39b53202fd6e848e6590372645285d8ac (patch)
treeddecf8bc90dee95d241fed83cea9edb453889251
parentf91dc64e5e02a2bdc66b166250248087627531cc (diff)
putting global db parameters into ledger-smb.conf file, updating LedgerSMB::Sysconfig. Lines are commented out so to not break current testing and development
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@426 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--LedgerSMB/Sysconfig.pm21
-rw-r--r--ledger-smb.conf10
2 files changed, 18 insertions, 13 deletions
diff --git a/LedgerSMB/Sysconfig.pm b/LedgerSMB/Sysconfig.pm
index a8b2e827..962c16fc 100644
--- a/LedgerSMB/Sysconfig.pm
+++ b/LedgerSMB/Sysconfig.pm
@@ -5,6 +5,8 @@
package LedgerSMB::Sysconfig;
use Config::Std;
+use DBI qw(:sql_types);
+
$session='DB';
$logging=0; # No logging on by default
@@ -46,15 +48,6 @@ $localepath = 'locale/po';
Epson => 'lpr -PEpson',
);
-#################################
-# Global database parameters
-#################################
-# These parameters *must* be set correctly
-# for LedgerSMB >= 1.2 to work
-my $globalDBConnect = 'dbi:Pg:dbname=ledgersmb;host=localhost;port=5432';
-my $globalUserName = "ledgersmb";
-my $globalPassword = "set me to correct password";
-
my %config;
read_config('ledger-smb.conf' => %config) or die;
@@ -82,11 +75,13 @@ $sendmail = $config{programs}{sendmail} if $config{programs}{sendmail};
$gzip = $config{programs}{gzip} if $config{programs}{gzip};
$globalDBConnect = $config{globaldb}{DBConnect} if $config{globaldb}{DBConnect};
-$globalUserName = $config{globaldb}{UserName} if $config{globaldb}{UserName};
-$globalPassword = $config{globaldb}{Password} if $config{globaldb}{Password};
-
-#$GLOBALDBH = DBI->connect($globalDBConnect, $globalDBUserName, $globalDBPassword);
+$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) or die;
+}
# These lines prevent other apps in mod_perl from seeing the global db
# connection info
diff --git a/ledger-smb.conf b/ledger-smb.conf
index 737dc901..07072266 100644
--- a/ledger-smb.conf
+++ b/ledger-smb.conf
@@ -6,3 +6,13 @@ PATH: /usr/local/pgsql/bin
# on mac os X using Fink's Perl libs, add the path
#PERL5LIB: /sw/lib/perl5
+#################################
+# Global database parameters
+#################################
+# These parameters *must* be set correctly for LedgerSMB >= 1.2 to work
+#
+[globaldb]
+##uncomment and set these
+#DBConnect: dbi:Pg:dbname=ledgersmb;host=localhost;port=5432
+#DBUserName: ledgersmb
+#DBPassword: password