From: Sven Schöling Date: Fri, 15 Apr 2011 09:51:32 +0000 (+0200) Subject: Merge branch 'master' of git@lx-office.linet-services.de:lx-office-erp X-Git-Tag: release-2.6.3~33^2~7 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/commitdiff_plain/470a8fa1710b22e2b381eef4cacb01bebaeff725?hp=-c Merge branch 'master' of git@lx-office.linet-services.de:lx-office-erp --- 470a8fa1710b22e2b381eef4cacb01bebaeff725 diff --combined SL/Auth.pm index 73a37c5eb,095188306..978fe497d --- a/SL/Auth.pm +++ b/SL/Auth.pm @@@ -13,6 -13,7 +13,7 @@@ use SL::Auth::DB use SL::Auth::LDAP; use SL::User; + use SL::DBConnect; use SL::DBUpgrade2; use SL::DBUtils; @@@ -38,7 -39,7 +39,7 @@@ sub new sub get_user_dbh { my ($self, $login) = @_; my %user = $self->read_user($login); - my $dbh = DBI->connect( + my $dbh = SL::DBConnect->connect( $user{dbconnect}, $user{dbuser}, $user{dbpasswd}, @@@ -166,7 -167,7 +167,7 @@@ sub dbconnect $main::lxdebug->message(LXDebug->DEBUG1, "Auth::dbconnect DSN: $dsn"); - $self->{dbh} = DBI->connect($dsn, $cfg->{user}, $cfg->{password}, { pg_enable_utf8 => $::locale->is_utf8, AutoCommit => 1 }); + $self->{dbh} = SL::DBConnect->connect($dsn, $cfg->{user}, $cfg->{password}, { pg_enable_utf8 => $::locale->is_utf8, AutoCommit => 1 }); if (!$may_fail && !$self->{dbh}) { $main::form->error($main::locale->text('The connection to the authentication database failed:') . "\n" . $DBI::errstr); @@@ -246,7 -247,7 +247,7 @@@ sub create_database my $encoding = $Common::charset_to_db_encoding{$charset}; $encoding ||= 'UNICODE'; - my $dbh = DBI->connect($dsn, $params{superuser}, $params{superuser_password}, { pg_enable_utf8 => $charset =~ m/^utf-?8$/i }); + my $dbh = SL::DBConnect->connect($dsn, $params{superuser}, $params{superuser_password}, { pg_enable_utf8 => $charset =~ m/^utf-?8$/i }); if (!$dbh) { $main::form->error($main::locale->text('The connection to the template database failed:') . "\n" . $DBI::errstr); @@@ -970,7 -971,7 +971,7 @@@ sub delete_group my $self = shift; my $id = shift; - my $form = $main::from; + my $form = $main::form; my $dbh = $self->dbconnect(); $dbh->begin_work; diff --combined SL/Form.pm index 11d72a6ed,bcb7cd589..31020aebc --- a/SL/Form.pm +++ b/SL/Form.pm @@@ -52,6 -52,7 +52,7 @@@ use SL::AM use SL::Common; use SL::CVar; use SL::DB; + use SL::DBConnect; use SL::DBUtils; use SL::DO; use SL::IC; @@@ -745,7 -746,7 +746,7 @@@ sub redirect_header my $base_uri = $self->_get_request_uri; my $new_uri = URI->new_abs($new_url, $base_uri); - die "Headers already sent" if $::self->{header}; + die "Headers already sent" if $self->{header}; $self->{header} = 1; my $cgi = $main::cgi || CGI->new(''); @@@ -1582,7 -1583,7 +1583,7 @@@ sub dbconnect my ($self, $myconfig) = @_; # connect to database - my $dbh = DBI->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, $self->_dbconnect_options) + my $dbh = SL::DBConnect->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, $self->_dbconnect_options) or $self->dberror; # set db options @@@ -1601,7 -1602,7 +1602,7 @@@ sub dbconnect_noauto my ($self, $myconfig) = @_; # connect to database - my $dbh = DBI->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, $self->_dbconnect_options(AutoCommit => 0)) + my $dbh = SL::DBConnect->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, $self->_dbconnect_options(AutoCommit => 0)) or $self->dberror; # set db options