Revision 540c0b5e
Von Moritz Bunkus vor etwa 12 Jahren hinzugefügt
SL/Dispatcher.pm | ||
---|---|---|
56 | 56 |
::run(); |
57 | 57 |
::end_of_request(); |
58 | 58 |
} else { |
59 |
show_error('login/auth_db_unreachable'); |
|
59 |
show_error('login_screen/auth_db_unreachable');
|
|
60 | 60 |
} |
61 | 61 |
} |
62 | 62 |
} |
... | ... | |
67 | 67 |
my $error_type = shift || ''; |
68 | 68 |
my %params = @_; |
69 | 69 |
|
70 |
$::locale = Locale->new($::lx_office_conf{system}->{language}); |
|
70 |
$::myconfig{countrycode} = delete($params{countrycode}) || $::lx_office_conf{system}->{language}; |
|
71 |
$::locale = Locale->new($::myconfig{countrycode}); |
|
71 | 72 |
$::form->{error} = $::locale->text('The session is invalid or has expired.') if ($error_type eq 'session'); |
72 |
$::form->{error} = $::locale->text('Incorrect password!.') if ($error_type eq 'password'); |
|
73 |
$::myconfig{countrycode} = $::lx_office_conf{system}->{language}; |
|
73 |
$::form->{error} = $::locale->text('Incorrect password!') if ($error_type eq 'password'); |
|
74 | 74 |
|
75 | 75 |
$::form->header; |
76 | 76 |
print $::form->parse_html_template($template, \%params); |
... | ... | |
200 | 200 |
|
201 | 201 |
$::form->error($::locale->text('System currently down for maintenance!')) if -e ($::lx_office_conf{paths}->{userspath} . "/nologin") && $script ne 'admin'; |
202 | 202 |
|
203 |
if ($script eq 'login' or $script eq 'admin') { |
|
204 |
$::form->{titlebar} = "Lx-Office " . $::locale->text('Version') . " $::form->{version}"; |
|
203 |
($routing_type, $script, $script_name, $action) = qw(controller controller LoginScreen login) if ($script eq 'login') && ($action eq 'login'); |
|
204 |
|
|
205 |
if (($script eq 'login') && !$action) { |
|
206 |
print $::request->{cgi}->redirect('controller.pl?action=LoginScreen/user_login'); |
|
207 |
|
|
208 |
} elsif ($script eq 'admin') { |
|
209 |
$::form->{titlebar} = "kivitendo " . $::locale->text('Version') . " $::form->{version}"; |
|
205 | 210 |
::run($session_result); |
206 | 211 |
|
207 | 212 |
} else { |
208 |
show_error('login/password_error', 'session') if SL::Auth::SESSION_EXPIRED == $session_result;
|
|
213 |
show_error('login_screen/user_login', 'session') if SL::Auth::SESSION_EXPIRED == $session_result;
|
|
209 | 214 |
|
210 |
my $auth_level = $self->{auth_handler}->handle(
|
|
215 |
my %auth_result = $self->{auth_handler}->handle(
|
|
211 | 216 |
routing_type => $routing_type, |
212 | 217 |
script => $script, |
213 | 218 |
controller => $script_name, |
214 | 219 |
action => $action, |
215 | 220 |
); |
216 | 221 |
|
217 |
delete @{ $::form }{ grep { m/^\{AUTH\}/ } keys %{ $::form } }; |
|
222 |
delete @{ $::form }{ grep { m/^\{AUTH\}/ } keys %{ $::form } } unless $auth_result{keep_auth_vars};
|
|
218 | 223 |
|
219 | 224 |
if ($action) { |
220 |
$::instance_conf->init if $auth_level eq 'user';
|
|
225 |
$::instance_conf->init if $auth_result{auth_level} eq 'user';
|
|
221 | 226 |
|
222 | 227 |
map { $::form->{$_} = $::myconfig{$_} } qw(charset) |
223 | 228 |
unless $action eq 'save' && $::form->{type} eq 'preferences'; |
... | ... | |
371 | 376 |
my @old_files = grep { -f "config/${_}" } qw(authentication.pl console.conf lx-erp.conf lx-erp-local.conf); |
372 | 377 |
return unless @old_files; |
373 | 378 |
|
374 |
$::form->{title} = $::locale->text('Old configuration files');
|
|
379 |
$::form->{title} = $::locale->text('Old configuration files'); |
|
375 | 380 |
$::form->header; |
376 |
print $::form->parse_html_template('login/old_configuration_files', { FILES => \@old_files }); |
|
381 |
print $::form->parse_html_template('login_screen/old_configuration_files', { FILES => \@old_files });
|
|
377 | 382 |
|
378 | 383 |
::end_of_request(); |
379 | 384 |
} |
Auch abrufbar als: Unified diff
User-Login auf Controller umgestellt