Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 22c02125

Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt

  • ID 22c021254b5dcf3367d95d48cea3e1f7412ef369
  • Vorgänger ae9df702
  • Nachfolger 40cd9c84

Alle Datenbankverbindungen über DBIx::Log4perl laufen lassen, sofern dies in der Konfiguration aktiviert ist

Unterschiede anzeigen:

SL/User.pm
38 38
use Fcntl qw(:seek);
39 39

  
40 40
#use SL::Auth;
41
use SL::DBConnect;
41 42
use SL::DBUpgrade2;
42 43
use SL::DBUtils;
43 44
use SL::Iconv;
......
104 105
    my %myconfig = $main::auth->read_user($self->{login});
105 106

  
106 107
    # check if database is down
107
    my $dbh =
108
      DBI->connect($myconfig{dbconnect}, $myconfig{dbuser},
109
                   $myconfig{dbpasswd})
108
    my $dbh = SL::DBConnect->connect($myconfig{dbconnect}, $myconfig{dbuser}, $myconfig{dbpasswd})
110 109
      or $self->error($DBI::errstr);
111 110

  
112 111
    # we got a connection, check the version
......
252 251
  $form->{sid} = $form->{dbdefault};
253 252
  &dbconnect_vars($form, $form->{dbdefault});
254 253

  
255
  my $dbh =
256
    DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd})
254
  my $dbh = SL::DBConnect->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd})
257 255
    or $form->dberror;
258 256

  
259 257
  if ($form->{dbdriver} eq 'Pg') {
......
270 268
        next if ($db =~ /^template/);
271 269

  
272 270
        &dbconnect_vars($form, $db);
273
        my $dbh =
274
          DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd})
271
        my $dbh = SL::DBConnect->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd})
275 272
          or $form->dberror;
276 273

  
277 274
        $query =
......
326 323

  
327 324
  dbconnect_vars($form, $form->{dbdefault});
328 325

  
329
  my $dbh                = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) || $form->dberror();
326
  my $dbh                = SL::DBConnect->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) || $form->dberror();
330 327
  my $query              = qq|SELECT pg_encoding_to_char(encoding) FROM pg_database WHERE datname = 'template0'|;
331 328
  my ($cluster_encoding) = $dbh->selectrow_array($query);
332 329
  $dbh->disconnect();
......
344 341
  $form->{sid} = $form->{dbdefault};
345 342
  &dbconnect_vars($form, $form->{dbdefault});
346 343
  my $dbh =
347
    DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd})
344
    SL::DBConnect->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd})
348 345
    or $form->dberror;
349 346
  $form->{db} =~ s/\"//g;
350 347
  my %dbcreate = (
......
386 383

  
387 384
  &dbconnect_vars($form, $form->{db});
388 385

  
389
  $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd})
386
  $dbh = SL::DBConnect->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd})
390 387
    or $form->dberror;
391 388

  
392 389
  my $db_charset = $Common::db_encoding_to_charset{$form->{encoding}};
......
417 414

  
418 415
  $form->{sid} = $form->{dbdefault};
419 416
  &dbconnect_vars($form, $form->{dbdefault});
420
  my $dbh =
421
    DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd})
417
  my $dbh = SL::DBConnect->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd})
422 418
    or $form->dberror;
423 419
  my $query = $dbdelete{$form->{dbdriver}};
424 420
  do_query($form, $dbh, $query);
......
464 460
    map { $form->{$_} = $member->{$_} } qw(dbname dbuser dbpasswd dbhost dbport);
465 461
    dbconnect_vars($form, $form->{dbname});
466 462

  
467
    my $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd});
463
    my $dbh = SL::DBConnect->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd});
468 464

  
469 465
    next unless $dbh;
470 466

  
......
594 590
    $db =~ s/^db//;
595 591
    &dbconnect_vars($form, $db);
596 592

  
597
    my $dbh =
598
      DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd})
593
    my $dbh = SL::DBConnect->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd})
599 594
      or $form->dberror;
600 595

  
601 596
    $dbh->do($form->{dboptions}) if ($form->{dboptions});
......
659 654
    $db =~ s/^db//;
660 655
    &dbconnect_vars($form, $db);
661 656

  
662
    my $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) or $form->dberror;
657
    my $dbh = SL::DBConnect->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) or $form->dberror;
663 658

  
664 659
    $dbh->do($form->{dboptions}) if ($form->{dboptions});
665 660

  
......
700 695

  
701 696
  $main::auth->save_user($self->{login}, map { $_, $self->{$_} } config_vars());
702 697

  
703
  my $dbh = DBI->connect($self->{dbconnect}, $self->{dbuser}, $self->{dbpasswd});
698
  my $dbh = SL::DBConnect->connect($self->{dbconnect}, $self->{dbuser}, $self->{dbpasswd});
704 699
  if ($dbh) {
705 700
    $self->create_employee_entry($form, $dbh, $self, 1);
706 701
    $dbh->disconnect();

Auch abrufbar als: Unified diff