X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FUser.pm;h=805335a29e94708a3366d7309d6d8c24450d29b3;hb=58b90d2d1159a4564f4ef0533669a506442e88eb;hp=ece1fb8b584c098d884f05419f659cc75aa5de19;hpb=6b7624a4627d292e41b9ca4def084ae62be743ae;p=kivitendo-erp.git diff --git a/SL/User.pm b/SL/User.pm index ece1fb8b5..805335a29 100644 --- a/SL/User.pm +++ b/SL/User.pm @@ -145,7 +145,12 @@ sub login { } # update the tables - open(FH, ">$main::userspath/nologin") or die("$!"); + if (!open(FH, ">$main::userspath/nologin")) { + $form->show_generic_error($main::locale->text('A temporary file could not be created. ' . + 'Please verify that the directory "#1" is writeable by the webserver.', + $main::userspath), + 'back_button' => 1); + } # required for Oracle $form->{dbdefault} = $sid; @@ -311,6 +316,25 @@ sub dbsources { return @dbsources; } +sub dbclusterencoding { + $main::lxdebug->enter_sub(); + + my ($self, $form) = @_; + + $form->{dbdefault} ||= $form->{dbuser}; + + dbconnect_vars($form, $form->{dbdefault}); + + my $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) || $form->dberror(); + my $query = qq|SELECT pg_encoding_to_char(encoding) FROM pg_database WHERE datname = 'template0'|; + my ($cluster_encoding) = $dbh->selectrow_array($query); + $dbh->disconnect(); + + $main::lxdebug->leave_sub(); + + return $cluster_encoding; +} + sub dbcreate { $main::lxdebug->enter_sub(); @@ -768,7 +792,7 @@ sub dbupdate { last if ($version < $mindb); # apply upgrade - $main::lxdebug->message(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); @@ -852,7 +876,7 @@ sub dbupdate2 { my $file_type = $1; # apply upgrade - $main::lxdebug->message(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") { @@ -950,7 +974,7 @@ sub create_employee_entry { sub config_vars { $main::lxdebug->enter_sub(); - my @conf = qw(acs address admin businessnumber company countrycode + my @conf = qw(address admin businessnumber company countrycode currency dateformat dbconnect dbdriver dbhost dbport dboptions dbname dbuser dbpasswd email fax name numberformat password printer role sid signature stylesheet tel templates vclimit angebote