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

SF.net SVN: ledger-smb:[6474] trunk



Revision: 6474
          http://sourceforge.net/p/ledger-smb/code/6474
Author:   einhverfr
Date:     2014-01-16 08:07:10 +0000 (Thu, 16 Jan 2014)
Log Message:
-----------
Fixing bug 946, db names with spaces not supported

Modified Paths:
--------------
    trunk/Changelog
    trunk/LedgerSMB/DBObject/User.pm
    trunk/LedgerSMB/Database.pm
    trunk/LedgerSMB/Form.pm
    trunk/LedgerSMB.pm

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2014-01-16 04:55:21 UTC (rev 6473)
+++ trunk/Changelog	2014-01-16 08:07:10 UTC (rev 6474)
@@ -102,7 +102,8 @@
 Supported Presently
 
 Changelog for 1.3.37
-* 1.3-1.2 downgrade now drops extensions (Chris T, 946)
+* 1.3-1.2 downgrade now drops extensions (Chris T, 943)
+* Fixed db names with spaces not supported (Chris T, 946)
 
 Changelog for 1.3.36
 * Set default date for AP invoice creation to current date (Chris T)

Modified: trunk/LedgerSMB/DBObject/User.pm
===================================================================
--- trunk/LedgerSMB/DBObject/User.pm	2014-01-16 04:55:21 UTC (rev 6473)
+++ trunk/LedgerSMB/DBObject/User.pm	2014-01-16 08:07:10 UTC (rev 6474)
@@ -67,7 +67,7 @@
     # Just in case, however, I think it is a good idea to include the DBI
     # error string.  CT
     $self->{dbh} = DBI->connect(
-        "dbi:Pg:dbname=$dbname", "$self->{login}", "$self->{old_password}", { AutoCommit => 0 }
+        qq|dbi:Pg:dbname="$dbname"|, "$self->{login}", "$self->{old_password}", { AutoCommit => 0 }
     ); 
     if (!$self->{dbh}){
         $self->error($self->{_locale}->text('Incorrect Password'));

Modified: trunk/LedgerSMB/Database.pm
===================================================================
--- trunk/LedgerSMB/Database.pm	2014-01-16 04:55:21 UTC (rev 6473)
+++ trunk/LedgerSMB/Database.pm	2014-01-16 08:07:10 UTC (rev 6474)
@@ -99,7 +99,7 @@
 
     my $creds = LedgerSMB::Auth::get_credentials();
     $LedgerSMB::App_State::DBH = DBI->connect(
-        "dbi:Pg:dbname=$self->{company_name}",
+        qq|dbi:Pg:dbname="$self->{company_name}"|,
 	"$creds->{login}", "$creds->{password}",
 	{ AutoCommit => 0, PrintError => $logger->is_warn(), }
     );
@@ -729,7 +729,7 @@
     my $retval = {};
     my $qtemp = 'SELECT count(*) FROM TABLE';
     my $dbh = DBI->connect(
-        "dbi:Pg:dbname=$self->{company_name}",  
+        qq|dbi:Pg:dbname="$self->{company_name}"|,  
          $self->{username}, $self->{password},
          { AutoCommit => 0, PrintError => $logger->is_warn(), }
     );

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2014-01-16 04:55:21 UTC (rev 6473)
+++ trunk/LedgerSMB/Form.pm	2014-01-16 08:07:10 UTC (rev 6474)
@@ -1285,12 +1285,9 @@
         $self->{company} = $LedgerSMB::Sysconfig::default_db;
     }
     my $dbname = $self->{company};
-    my $dbconfig = { dbconnect => "dbi:Pg:dbname=$dbname",
-                  dbuser    => $login,
-                  dbpasswd  => $password
-    };
+    $self->{dbh} = DBI->connect(qq|dbi:Pg:dbname="$dbname"|, $login, $password,
+           { AutoCommit => 0 }) || $self->dberror();
 
-    $self->{dbh} = $self->dbconnect_noauto($dbconfig) || $self->dberror();
     $logger->debug("acquired dbh \$self->{dbh}=$self->{dbh}");
     $self->{dbh}->{pg_server_prepare} = 0;
     my $dbh = $self->{dbh};

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2014-01-16 04:55:21 UTC (rev 6473)
+++ trunk/LedgerSMB.pm	2014-01-16 08:07:10 UTC (rev 6474)
@@ -881,7 +881,7 @@
     # Just in case, however, I think it is a good idea to include the DBI
     # error string.  CT
     $self->{dbh} = DBI->connect(
-        "dbi:Pg:dbname=$dbname", "$creds->{login}", "$creds->{password}", { AutoCommit => 0 }
+        qq|dbi:Pg:dbname="$dbname"|, "$creds->{login}", "$creds->{password}", { AutoCommit => 0 }
     ); 
     #move dbi_trace further on , dbh may not have been acquired because of authentication error
 

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


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits