X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fadmin.pl;h=3258a317c268bf0236bd7e67601ed87834a37045;hb=c9902d7658d0cacdf665971b32de0e054637efd0;hp=6532eddfa3573d72754cb856d421e0bdaaa81ef4;hpb=dbe7d834d5df5db01bb5abce8f37473b711ed8b1;p=kivitendo-erp.git diff --git a/bin/mozilla/admin.pl b/bin/mozilla/admin.pl index 6532eddfa..3258a317c 100755 --- a/bin/mozilla/admin.pl +++ b/bin/mozilla/admin.pl @@ -43,6 +43,7 @@ use Sys::Hostname; use SL::Auth; use SL::Form; +use SL::Iconv; use SL::Mailer; use SL::User; use SL::Common; @@ -52,6 +53,7 @@ use SL::DBUtils; require "bin/mozilla/common.pl"; require "bin/mozilla/admin_groups.pl"; +require "bin/mozilla/admin_printer.pl"; use strict; @@ -79,14 +81,14 @@ sub run { $form->{error_message} = $locale->text('Incorrect Password!'); adminlogin(); } else { - $auth->create_or_refresh_session() if ($auth->session_tables_present()); + if ($auth->session_tables_present()) { + $::auth->set_session_value('rpw', $::form->{rpw}); + $::auth->create_or_refresh_session(); + _apply_dbupgrade_scripts(); + } + call_sub($locale->findsub($form->{action})); } - } elsif ($auth->authenticate_root($form->{rpw}, 0) == $auth->OK()) { - - $auth->create_or_refresh_session() if ($auth->session_tables_present()); - - login(); } else { # if there are no drivers bail out $form->error($locale->text('No Database Drivers available!')) @@ -351,13 +353,15 @@ sub add_user { $form->{title} = "Lx-Office ERP " . $locale->text('Administration') . " / " . $locale->text('Add User'); +# Note: Menu Style 'v3' is not compatible to all browsers! +# "menustyle" => "old" sets the HTML Menu to default. my $myconfig = { "vclimit" => 200, "countrycode" => "de", "numberformat" => "1.000,00", "dateformat" => "dd.mm.yy", "stylesheet" => "lx-office-erp.css", - "menustyle" => "v3", + "menustyle" => "old", }; edit_user_form($myconfig); @@ -413,7 +417,7 @@ sub edit_user_form { closedir TEMPLATEDIR; @alldir = grep !/\.(html|tex|sty|odt|xml|txb)$/, @alldir; - @alldir = grep !/^(webpages|cache|\.svn)$/, @alldir; + @alldir = grep !/^(webpages|\.svn)$/, @alldir; @allhtml = reverse grep !/Default/, @allhtml; push @allhtml, 'Default'; @@ -645,10 +649,10 @@ sub dbselect_source { my $form = $main::form; my $locale = $main::locale; - $form->{dbport} = '5432'; - $form->{dbuser} = 'postgres'; + $form->{dbport} = $::auth->{DB_config}->{port} || 5432; + $form->{dbuser} = $::auth->{DB_config}->{user} || 'lxoffice'; $form->{dbdefault} = 'template1'; - $form->{dbhost} = 'localhost'; + $form->{dbhost} = $::auth->{DB_config}->{host} || 'localhost'; $form->{title} = "Lx-Office ERP / " . $locale->text('Database Administration'); @@ -718,15 +722,13 @@ sub dbupdate { map { $form->{$_} = $form->{"${_}_${i}"} } qw(dbname dbdriver dbhost dbport dbuser dbpasswd); - my $controls = parse_dbupdate_controls($form, $form->{dbdriver}); - print $form->parse_html_template("admin/dbupgrade_header"); $form->{dbupdate} = $form->{dbname}; $form->{$form->{dbname}} = 1; User->dbupdate($form); - User->dbupdate2($form, $controls); + User->dbupdate2($form, SL::DBUpgrade2->new(form => $form, dbdriver => $form->{dbdriver})->parse_dbupdate_controls); print $form->parse_html_template("admin/dbupgrade_footer"); } @@ -1163,4 +1165,8 @@ sub dispatcher { $form->error($locale->text('No action defined.')); } +sub _apply_dbupgrade_scripts { + ::end_of_request() if SL::DBUpgrade2->new(form => $::form, dbdriver => 'Pg', auth => 1)->apply_admin_dbupgrade_scripts(1); +} + 1;