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

SF.net SVN: ledger-smb: [692] branches/1.2



Revision: 692
          http://svn.sourceforge.net/ledger-smb/?rev=692&view=rev
Author:   einhverfr
Date:     2006-11-22 17:14:57 -0800 (Wed, 22 Nov 2006)

Log Message:
-----------
Applying patch 15998004

Modified Paths:
--------------
    branches/1.2/LedgerSMB/User.pm
    branches/1.2/bin/admin.pl

Modified: branches/1.2/LedgerSMB/User.pm
===================================================================
--- branches/1.2/LedgerSMB/User.pm	2006-11-22 18:17:12 UTC (rev 691)
+++ branches/1.2/LedgerSMB/User.pm	2006-11-23 01:14:57 UTC (rev 692)
@@ -71,10 +71,6 @@
 		chomp($self->{dbname});
 		chomp($self->{dbhost});
 
-		if(! int($self->{dbport})){#in case there's a space or junk in the dbport
-			$self->{dbport} = '5432';
-		}
-
 		$self->{dbconnect} = 'dbi:Pg:dbname='.$self->{dbname}.';host='.$self->{dbhost}.';port='.$self->{dbport};
 
 		if($self->{username}){
@@ -142,13 +138,10 @@
 			$myconfig{$key} = $value;
 		}
 
-		if(! int($myconfig{'dbport'})){#in case there's a space or junk in the dbport
-			$myconfig{'dbport'} = '5432';
-		}
+		chomp($myconfig{'dbport'});
+		chomp($myconfig{'dbname'});
+		chomp($myconfig{'dbhost'});
 
-		if (! $myconfig{'dbhost'}){ # necessary to avoid many issues
-			$myconfig{'dbhost'} = 'localhost';
-		}
 		$myconfig{'login'} = $login;
 		$myconfig{'dbconnect'} = 'dbi:Pg:dbname='.$myconfig{'dbname'}.';host='.$myconfig{'dbhost'}.';port='.$myconfig{'dbport'};
 	}
@@ -277,21 +270,8 @@
 	$form->{dboptions} = $dboptions{$form->{dbdriver}}{$form->{dateformat}};
 
 	$form->{dbconnect} = "dbi:$form->{dbdriver}:dbname=$db";
-
-
-	if ($form->{dbhost}) {
-		$form->{dbconnect} .= ";host=$form->{dbhost}";
-
-	} else {
-		$form->{dbconnect} .= ";host=localhost";
-	}
-
-
-	if ($form->{dbport}) {
-		$form->{dbconnect} .= ";port=$form->{dbport}";
-	} else {
-		$form->{dbconnect} .= ";port=5432";
-	}
+	$form->{dbconnect} .= ";host=$form->{dbhost}";
+	$form->{dbconnect} .= ";port=$form->{dbport}";
   
 }
 
@@ -720,6 +700,14 @@
 	my $userCheck = $dbh->prepare("SELECT id FROM users WHERE username = ?");
 	$userCheck->execute($self->{login});
 	my ($userID) = $userCheck->fetchrow_array;
+
+        if (! $self->{dbhost}) {
+                $self->{dbhost} = 'localhost';
+        }
+        if (! $self->{dbport}) {
+                $self->{dbport} = '5432';
+        }
+
 	my $userConfExists = 0;
 
 	if($userID){

Modified: branches/1.2/bin/admin.pl
===================================================================
--- branches/1.2/bin/admin.pl	2006-11-22 18:17:12 UTC (rev 691)
+++ branches/1.2/bin/admin.pl	2006-11-23 01:14:57 UTC (rev 692)
@@ -270,7 +270,6 @@
 		$href =~ s/ /%20/g;
 
 		$member{$key}{templates} =~ s/^${LedgerSMB::Sysconfig::templates}\///;
-		$member{$key}{dbhost} = 'localhost' unless $member{$key}{dbhost};
 
 		$column_data{login} = qq|<td><a href="$href">$key</a></td>|;
 		$column_data{name} = qq|<td>$member{$key}{name}</td>|;


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