# remove lock file
unlink("$userspath/nologin");
- print($form->parse_html_template("dbupgrade/footer"));
+ my $menufile =
+ $self->{"menustyle"} eq "v3" ? "menuv3.pl" :
+ $self->{"menustyle"} eq "neu" ? "menunew.pl" :
+ "menu.pl";
+
+ print($form->parse_html_template("dbupgrade/footer",
+ { "menufile" => $menufile }));
$rc = -2;
my ($self, $form) = @_;
+ $form->{sid} = $form->{dbdefault};
+ &dbconnect_vars($form, $form->{dbdefault});
+ my $dbh =
+ DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd})
+ or $form->dberror;
+
my %dbcreate = (
'Pg' => qq|CREATE DATABASE "$form->{db}"|,
'Oracle' =>
qq|CREATE USER "$form->{db}" DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP IDENTIFIED BY "$form->{db}"|
);
- $dbcreate{Pg} .= " WITH ENCODING = '$form->{encoding}'" if $form->{encoding};
+ my %dboptions = (
+ 'Pg' => [],
+ );
+
+ push(@{$dboptions{"Pg"}}, "ENCODING = " . $dbh->quote($form->{"encoding"}))
+ if ($form->{"encoding"});
+ if ($form->{"dbdefault"}) {
+ my $dbdefault = $form->{"dbdefault"};
+ $dbdefault =~ s/[^a-zA-Z0-9_\-]//g;
+ push(@{$dboptions{"Pg"}}, "TEMPLATE = $dbdefault");
+ }
- $form->{sid} = $form->{dbdefault};
- &dbconnect_vars($form, $form->{dbdefault});
- my $dbh =
- DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd})
- or $form->dberror;
my $query = qq|$dbcreate{$form->{dbdriver}}|;
+ $query .= " WITH " . join(" ", @{$dboptions{"Pg"}}) if (@{$dboptions{"Pg"}});
+
$dbh->do($query) || $form->dberror($query);
if ($form->{dbdriver} eq 'Oracle') {
my @conf = qw(acs address admin businessnumber charset company countrycode
currency dateformat dbconnect dbdriver dbhost dbport dboptions
- dbname dbuser dbpasswd email fax name numberformat in_numberformat password
+ dbname dbuser dbpasswd email fax name numberformat password
printer role sid signature stylesheet tel templates vclimit angebote bestellungen rechnungen
anfragen lieferantenbestellungen einkaufsrechnungen taxnumber co_ustid duns menustyle
- template_format copies);
+ template_format default_media default_printer_id copies show_form_details);
$main::lxdebug->leave_sub();