summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-11-10 04:38:33 +0100
committerJonas Smedegaard <dr@jones.dk>2008-12-02 17:49:18 +0100
commit534811efaeead497f00cc976861af8512a7e6859 (patch)
tree1556daa4e193e1da1d6d752a1dd7e3ef6d7fac97 /LedgerSMB
parent126edd066746ce415510e049017e7aeb03b2869b (diff)
Simple socket-based Postgres login.
Diffstat (limited to 'LedgerSMB')
-rw-r--r--LedgerSMB/Sysconfig.pm4
-rwxr-xr-xLedgerSMB/User.pm20
2 files changed, 5 insertions, 19 deletions
diff --git a/LedgerSMB/Sysconfig.pm b/LedgerSMB/Sysconfig.pm
index 94d85a35..b87c2b13 100644
--- a/LedgerSMB/Sysconfig.pm
+++ b/LedgerSMB/Sysconfig.pm
@@ -123,9 +123,7 @@ $globalDBPassword = $config{globaldb}{DBPassword}
#putting this in an if clause for now so not to break other devel users
if ( $config{globaldb}{DBname} ) {
- my $dbconnect = "dbi:Pg:dbname=$globalDBname host=$globalDBhost
- port=$globalDBport user=$globalDBUserName
- password=$globalDBPassword"; # for easier debugging
+ my $dbconnect = "dbi:Pg:dbname=$globalDBname";
$GLOBALDBH = DBI->connect($dbconnect);
if ( !$GLOBALDBH ) {
$form = new Form;
diff --git a/LedgerSMB/User.pm b/LedgerSMB/User.pm
index e935583d..de1ff12d 100755
--- a/LedgerSMB/User.pm
+++ b/LedgerSMB/User.pm
@@ -77,10 +77,7 @@ sub new {
$self->{dbconnect} =
'dbi:Pg:dbname='
. $self->{dbname}
- . ';host='
- . $self->{dbhost}
- . ';port='
- . $self->{dbport};
+ ;
if ( $self->{username} ) {
$self->{login} = $login;
@@ -163,10 +160,7 @@ sub fetch_config {
$myconfig{'dbconnect'} =
'dbi:Pg:dbname='
. $myconfig{'dbname'}
- . ';host='
- . $myconfig{'dbhost'}
- . ';port='
- . $myconfig{'dbport'};
+ ;
return \%myconfig;
}
@@ -295,8 +289,6 @@ sub dbconnect_vars {
$form->{dboptions} = $dboptions{ $form->{dbdriver} }{ $form->{dateformat} };
$form->{dbconnect} = "dbi:$form->{dbdriver}:dbname=$db";
- $form->{dbconnect} .= ";host=$form->{dbhost}";
- $form->{dbconnect} .= ";port=$form->{dbport}";
}
@@ -455,11 +447,7 @@ sub process_query {
return unless ( -f $filename );
- $ENV{PGPASSWORD} = $form->{dbpasswd};
- $ENV{PGUSER} = $form->{dbuser};
$ENV{PGDATABASE} = $form->{db};
- $ENV{PGHOST} = $form->{dbhost};
- $ENV{PGPORT} = $form->{dbport};
$results = `psql -f $filename 2>&1`;
if ($?) {
@@ -675,10 +663,10 @@ sub save_member {
my ($userID) = $userCheck->fetchrow_array;
if ( !$self->{dbhost} ) {
- $self->{dbhost} = 'localhost';
+ $self->{dbhost} = '';
}
if ( !$self->{dbport} ) {
- $self->{dbport} = '5432';
+ $self->{dbport} = '';
}
my $userConfExists = 0;