+sub _init_environment {
+ my %key_map = ( lib => { name => 'PERL5LIB', append_path => 1 },
+ path => { name => 'PATH', append_path => 1 },
+ );
+ my $cfg = $::lx_office_conf{environment} || {};
+
+ while (my ($key, $value) = each %{ $cfg }) {
+ next unless $value;
+
+ my $info = $key_map{$key} || {};
+ $key = $info->{name} || $key;
+
+ if ($info->{append_path}) {
+ $value = ':' . $value unless $value =~ m/^:/ || !$ENV{$key};
+ $value = $ENV{$key} . $value;
+ }
+
+ $ENV{$key} = $value;
+ }
+}
+
+sub _check_for_old_config_files {
+ my @old_files = grep { -f "config/${_}" } qw(authentication.pl console.conf lx-erp.conf lx-erp-local.conf);
+ return unless @old_files;
+
+ $::form->{title} = $::locale->text('Old configuration files');
+ $::form->{stylesheet} = 'lx-office-erp.css';
+ $::form->header;
+ print $::form->parse_html_template('login/old_configuration_files', { FILES => \@old_files });
+
+ ::end_of_request();
+}
+