[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[6939] trunk
- Subject: SF.net SVN: ledger-smb:[6939] trunk
- From: ..hidden..
- Date: Mon, 17 Mar 2014 14:47:08 +0000
Revision: 6939
http://sourceforge.net/p/ledger-smb/code/6939
Author: tshvr
Date: 2014-03-17 14:47:05 +0000 (Mon, 17 Mar 2014)
Log Message:
-----------
use database entered by user on setup;more tracing
Modified Paths:
--------------
trunk/LedgerSMB/Database.pm
trunk/LedgerSMB/Scripts/setup.pm
trunk/UI/setup/login.js
Modified: trunk/LedgerSMB/Database.pm
===================================================================
--- trunk/LedgerSMB/Database.pm 2014-03-17 09:20:24 UTC (rev 6938)
+++ trunk/LedgerSMB/Database.pm 2014-03-17 14:47:05 UTC (rev 6939)
@@ -33,7 +33,7 @@
use DateTime;
use Log::Log4perl;
Log::Log4perl::init(\$LedgerSMB::Sysconfig::log4perl_config);
-my $logger = Log::Log4perl->get_logger('');
+my $logger = Log::Log4perl->get_logger('LedgerSMB::Database');
my $dbversions = {
'1.2' => '1.2.0',
@@ -56,7 +56,6 @@
return $temp . "/dblog_${dt}_$$";
}
-my $logger = Log::Log4perl->get_logger('LedgerSMB::Database');
=item LedgerSMB::Database->new({dbname = $dbname, countrycode = $cc, chart_name = $name, company_name = $company, username = $username, password = $password})
@@ -317,6 +316,7 @@
};
my $creds = LedgerSMB::Auth->get_credentials();
+ $logger->trace("\$creds=".Data::Dumper::Dumper(\$creds));
my $dbh = $self->dbh();
if (!$dbh){ # Could not connect, try to validate existance by connecting
# to postgres and checking
@@ -446,9 +446,12 @@
sub server_version {
my $self = shift @_;
+ $logger->trace("\$self=".Data::Dumper::Dumper(\$self));
+ my $dbName=$self->{company_name}||'postgres';
my $creds = LedgerSMB::Auth->get_credentials();
+ $logger->trace("\$creds=".Data::Dumper::Dumper(\$creds));
my $dbh = DBI->connect(
- "dbi:Pg:dbname=postgres",
+ "dbi:Pg:dbname=$dbName",
"$creds->{login}", "$creds->{password}", { AutoCommit => 0 }
) or LedgerSMB::Auth::credential_prompt;
my ($version) = $dbh->selectrow_array('SELECT version()');
@@ -473,7 +476,7 @@
my $dbh = DBI->connect(
"dbi:Pg:dbname=postgres",
"$creds->{login}", "$creds->{password}", { AutoCommit => 0 }
- );
+ ) or LedgerSMB::Auth::credential_prompt;
my $resultref = $dbh->selectall_arrayref(
"SELECT datname FROM pg_database
WHERE datname <> 'postgres' AND datname NOT LIKE 'template%'
Modified: trunk/LedgerSMB/Scripts/setup.pm
===================================================================
--- trunk/LedgerSMB/Scripts/setup.pm 2014-03-17 09:20:24 UTC (rev 6938)
+++ trunk/LedgerSMB/Scripts/setup.pm 2014-03-17 14:47:05 UTC (rev 6939)
@@ -128,7 +128,9 @@
return;
}
my $database = _get_database($request);
+ $logger->trace("\$database=".Data::Dumper::Dumper(\$database));
my $server_info = $database->server_version;
+ $logger->trace("\$server_info=".Data::Dumper::Dumper(\$server_info));
my $version_info = $database->get_info();
Modified: trunk/UI/setup/login.js
===================================================================
--- trunk/UI/setup/login.js 2014-03-17 09:20:24 UTC (rev 6938)
+++ trunk/UI/setup/login.js 2014-03-17 14:47:05 UTC (rev 6939)
@@ -2,7 +2,9 @@
var http = get_http_request_object();
var username = document.getElementById('s-user').value;
var password = document.getElementById('s-password').value;
- http.open("get", 'login.pl?action=authenticate&company=template1',
+ var dbName = document.getElementById('database').value;
+ if(!dbName) dbname='postgres';//'template1'
+ http.open("get", 'login.pl?action=authenticate&company='+dbName,
false, username, password);
http.send("");
if (http.status != 200){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits