X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fadmin.pl;h=ddb12b1d854481badd03a94b470f5f35d6b89f47;hb=26ae178f70e8f0b44493ec7f501ec9eb28342229;hp=3d1185deb20bfbbc5b961366b89c7008da403f60;hpb=f2af9def6777d0192a83c8a86f1332569c742051;p=kivitendo-erp.git diff --git a/bin/mozilla/admin.pl b/bin/mozilla/admin.pl index 3d1185deb..ddb12b1d8 100755 --- a/bin/mozilla/admin.pl +++ b/bin/mozilla/admin.pl @@ -34,6 +34,7 @@ use DBI; use CGI; +use Encode; use English qw(-no_match_vars); use Fcntl; use File::Copy; @@ -78,7 +79,7 @@ sub run { $form->{favicon} = "favicon.ico"; if ($form->{action}) { - if ($auth->authenticate_root($form->{rpw}, 0) != $auth->OK()) { + if ($auth->authenticate_root($form->{rpw}) != $auth->OK()) { $form->{error_message} = $locale->text('Incorrect Password!'); adminlogin(); } else { @@ -194,6 +195,7 @@ sub create_auth_tables { $main::auth->save_group($group); } + _apply_dbupgrade_scripts(); login(); } @@ -341,7 +343,10 @@ sub list_users { delete $members{"root login"}; - map { $_->{templates} =~ s|.*/||; } values %members; + for (values %members) { + $_->{templates} =~ s|.*/||; + $_->{login_url} = $::locale->is_utf8 ? Encode::encode('utf-8-strict', $_->{login}) : $_->{login_url}; + } $form->{title} = "Lx-Office ERP " . $locale->text('Administration'); $form->{LOCKED} = -e _nologin_file_name(); @@ -767,12 +772,12 @@ sub create_dataset { } closedir SQLDIR; - my $default_charset = $main::dbcharset; + my $default_charset = $::lx_office_conf{system}->{dbcharset}; $default_charset ||= Common::DEFAULT_CHARSET; my $cluster_encoding = User->dbclusterencoding($form); if ($cluster_encoding && ($cluster_encoding =~ m/^(?:UTF-?8|UNICODE)$/i)) { - if ($main::dbcharset !~ m/^UTF-?8$/i) { + if ($::lx_office_conf{system}->{dbcharset} !~ m/^UTF-?8$/i) { $form->show_generic_error($locale->text('The selected PostgreSQL installation uses UTF-8 as its encoding. ' . 'Therefore you have to configure Lx-Office to use UTF-8 as well.'), 'back_button' => 1); @@ -846,7 +851,7 @@ sub backup_dataset { $form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Backup Dataset'); if ($::lx_office_conf{applications}->{pg_dump} eq "DISABLED") { - $form->error($locale->text('Database backups and restorations are disabled in lx-erp.conf.')); + $form->error($locale->text('Database backups and restorations are disabled in the configuration.')); } my @dbsources = sort User->dbsources($form); @@ -870,7 +875,7 @@ sub backup_dataset_start { my $pg_dump_exe = $::lx_office_conf{applications}->{pg_dump} || "pg_dump"; if ("$pg_dump_exe" eq "DISABLED") { - $form->error($locale->text('Database backups and restorations are disabled in lx-erp.conf.')); + $form->error($locale->text('Database backups and restorations are disabled in the configuration.')); } $form->isblank("dbname", $locale->text('The dataset name is missing.')); @@ -934,7 +939,7 @@ sub backup_dataset_start { map { $mail->{$_} = $form->{$_} } qw(from to cc subject message); - $mail->{charset} = $main::dbcharset ? $main::dbcharset : Common::DEFAULT_CHARSET; + $mail->{charset} = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET; $mail->{attachments} = [ { "filename" => $tmp, "name" => $name } ]; $mail->send(); @@ -955,10 +960,10 @@ sub restore_dataset { $form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Restore Dataset'); if ($::lx_office_conf{applications}->{pg_restore} eq "DISABLED") { - $form->error($locale->text('Database backups and restorations are disabled in lx-erp.conf.')); + $form->error($locale->text('Database backups and restorations are disabled in the configuration.')); } - my $default_charset = $main::dbcharset; + my $default_charset = $::lx_office_conf{system}->{dbcharset}; $default_charset ||= Common::DEFAULT_CHARSET; $form->{DBENCODINGS} = []; @@ -982,7 +987,7 @@ sub restore_dataset_start { my $pg_restore_exe = $::lx_office_conf{applications}->{pg_restore} || "pg_restore"; if ("$pg_restore_exe" eq "DISABLED") { - $form->error($locale->text('Database backups and restorations are disabled in lx-erp.conf.')); + $form->error($locale->text('Database backups and restorations are disabled in the configuration.')); } $form->isblank("new_dbname", $locale->text('The dataset name is missing.'));