X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FUser.pm;h=0fbd66a398325eef5d947d48417a30c10759cc9b;hb=f2354caba6501475fb0f09c8fb1fe970ea430c22;hp=487236800cdf8c016cd2a7d3fc05e80cc3020ea5;hpb=14c1b704816c9dcfebca1d0bf9fd0e2fc2d253e4;p=kivitendo-erp.git diff --git a/SL/User.pm b/SL/User.pm index 487236800..0fbd66a39 100644 --- a/SL/User.pm +++ b/SL/User.pm @@ -34,17 +34,17 @@ package User; -#use strict; - use IO::File; use Fcntl qw(:seek); -use SL::Auth; +#use SL::Auth; use SL::DBUpgrade2; use SL::DBUtils; use SL::Iconv; use SL::Inifile; +use strict; + sub new { $main::lxdebug->enter_sub(); @@ -107,7 +107,7 @@ sub login { my $dbh = DBI->connect($myconfig{dbconnect}, $myconfig{dbuser}, $myconfig{dbpasswd}) - or $self->error(DBI::errstr); + or $self->error($DBI::errstr); # we got a connection, check the version my $query = qq|SELECT version FROM defaults|; @@ -445,6 +445,7 @@ sub process_perl_script { $dbh->begin_work(); + # setup dbup_ export vars my %dbup_myconfig = (); map({ $dbup_myconfig{$_} = $form->{$_}; } qw(dbname dbuser dbpasswd dbhost dbport dbconnect)); @@ -802,7 +803,7 @@ sub dbupdate { last if ($version < $mindb); # apply upgrade - $main::lxdebug->message(LXDebug::DEBUG2, "Applying Update $upgradescript"); + $main::lxdebug->message(LXDebug->DEBUG2(), "Applying Update $upgradescript"); if ($file_type eq "sql") { $self->process_query($form, $dbh, "sql/" . $form->{"dbdriver"} . "-upgrade/$upgradescript", $str_maxdb, $db_charset); @@ -886,7 +887,7 @@ sub dbupdate2 { my $file_type = $1; # apply upgrade - $main::lxdebug->message(LXDebug::DEBUG2, "Applying Update $control->{file}"); + $main::lxdebug->message(LXDebug->DEBUG2(), "Applying Update $control->{file}"); print $form->parse_html_template("dbupgrade/upgrade_message2", $control); if ($file_type eq "sql") { @@ -971,6 +972,11 @@ sub create_employee_entry { my $myconfig = shift; my $update_existing = shift; + if (!does_table_exist($dbh, 'employee')) { + $main::lxdebug->leave_sub(); + return; + } + # add login to employee table if it does not exist # no error check for employee table, ignore if it does not exist my ($id) = selectrow_query($form, $dbh, qq|SELECT id FROM employee WHERE login = ?|, $self->{login}); @@ -997,7 +1003,7 @@ sub config_vars { bestellungen rechnungen anfragen lieferantenbestellungen einkaufsrechnungen taxnumber co_ustid duns menustyle template_format default_media default_printer_id copies show_form_details favorites - pdonumber sdonumber); + pdonumber sdonumber hide_cvar_search_options); $main::lxdebug->leave_sub();