X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fam.pl;h=bcf934ed1ac1fc624df7dd9553d559caa94eb122;hb=d5440cc6f9cc5b2942458ce7480526e2b90b17a4;hp=b7c980c9eb4c76757be9cae8114498aa39de11de;hpb=f8b476b8f9814fdee4685df9b2b5b78e91d9b184;p=kivitendo-erp.git diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index b7c980c9e..bcf934ed1 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -34,6 +34,7 @@ use utf8; use SL::Auth; +use SL::Auth::PasswordPolicy; use SL::AM; use SL::CA; use SL::Form; @@ -1110,7 +1111,7 @@ sub list_business { $form->{title} = $locale->text('Type of Business'); my @column_index = qw(description discount customernumberinit); - push @column_index, 'salesman' if $::vertreter; + push @column_index, 'salesman' if $::lx_office_conf{system}->{vertreter}; my %column_header; $column_header{description} = qq|| @@ -1223,7 +1224,7 @@ sub business_header { $form->format_amount(\%myconfig, $form->{discount} * 100); my $salesman_code; - if ($::vertreter) { + if ($::lx_office_conf{system}->{vertreter}) { $salesman_code = qq| | . $locale->text('Representative') . qq| @@ -1872,7 +1873,7 @@ sub buchungsgruppe_header { } my $linkaccounts; - if (!$main::eur) { + if (!$::lx_office_conf{system}->{eur}) { $linkaccounts = qq| | . $locale->text('Inventory') . qq| @@ -2456,20 +2457,21 @@ sub config { _build_cfg_options('numberformat', ('1,000.00', '1000.00', '1.000,00', '1000,00')); my @formats = (); - if ($main::opendocument_templates && $main::openofficeorg_writer_bin && - $main::xvfb_bin && (-x $main::openofficeorg_writer_bin) && (-x $main::xvfb_bin)) { + if ($::lx_office_conf{print_templates}->{opendocument} + && $::lx_office_conf{applications}->{openofficeorg_writer} && (-x $::lx_office_conf{applications}->{openofficeorg_writer}) + && $::lx_office_conf{applications}->{xvfb} && (-x $::lx_office_conf{applications}->{xvfb})) { push(@formats, { "name" => $locale->text("PDF (OpenDocument/OASIS)"), "value" => "opendocument_pdf" }); } - if ($main::latex_templates) { + if ($::lx_office_conf{print_templates}->{latex}) { push(@formats, { "name" => $locale->text("PDF"), "value" => "pdf" }); } push(@formats, { "name" => "HTML", "value" => "html" }); - if ($main::latex_templates) { + if ($::lx_office_conf{print_templates}->{latex}) { push(@formats, { "name" => $locale->text("Postscript"), "value" => "postscript" }); } - if ($main::opendocument_templates) { + if ($::lx_office_conf{print_templates}->{opendocument}) { push(@formats, { "name" => $locale->text("OpenDocument/OASIS"), "value" => "opendocument" }); } @@ -2549,7 +2551,27 @@ sub save_preferences { TODO->save_user_config('login' => $form->{login}, %{ $form->{todo_cfg} || { } }); - $form->redirect($locale->text('Preferences saved!')) if (AM->save_preferences(\%myconfig, \%$form, 0)); + if (AM->save_preferences(\%myconfig, $form)) { + if ($::auth->can_change_password() + && defined $form->{new_password} + && ($form->{new_password} ne '********')) { + my $verifier = SL::Auth::PasswordPolicy->new; + my $result = $verifier->verify($form->{new_password}); + + if ($result != SL::Auth::PasswordPolicy->OK()) { + $form->error($::locale->text('The settings were saved, but the password was not changed.') . ' ' . join(' ', $verifier->errors($result))); + } + + $::auth->change_password($form->{login}, $form->{new_password}); + + $form->{password} = $form->{new_password}; + $::auth->set_session_value('password', $form->{password}); + $::auth->create_or_refresh_session(); + } + + $form->redirect($locale->text('Preferences saved!')); + } + $form->error($locale->text('Cannot save preferences!')); $main::lxdebug->leave_sub();