X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Flogin.pl;h=22c37bf851396ae25192388166a04a6fa2a68f62;hb=f373f98d676d433b7db20e3e74435a34029cac0f;hp=2d96b54002f087f35abb09bac84d9b9e7e8525f2;hpb=8c7e44938a661e035f62840e1e177353240ace5d;p=kivitendo-erp.git diff --git a/bin/mozilla/login.pl b/bin/mozilla/login.pl index 2d96b5400..22c37bf85 100644 --- a/bin/mozilla/login.pl +++ b/bin/mozilla/login.pl @@ -33,6 +33,7 @@ use SL::User; use SL::Form; require "bin/mozilla/common.pl"; +require "bin/mozilla/todo.pl"; # This is required because the am.pl in the root directory # is not scanned by locales.pl: @@ -51,7 +52,7 @@ if (!$auth->session_tables_present()) { show_error('login/auth_db_unreachable'); } $auth->expire_sessions(); -$auth->restore_session(); +my $session_result = $auth->restore_session(); # customization if (-f "bin/mozilla/custom_$form->{script}") { @@ -68,7 +69,19 @@ if (-f "bin/mozilla/$form->{login}_$form->{script}") { # window title bar, user info $form->{titlebar} = "Lx-Office " . $locale->text('Version') . " $form->{version}"; -if ($form->{action}) { +if (SL::Auth::SESSION_EXPIRED == $session_result) { + $form->{error_message} = $locale->text('The session is invalid or has expired.'); + login_screen(); + exit; +} + +my $action = $form->{action}; + +if (!$action && $auth->{SESSION}->{login}) { + $action = 'login'; +} + +if ($action) { our %myconfig = $auth->read_user($form->{login}) if ($form->{login}); if (!$myconfig{login} || (SL::Auth::OK != $auth->authenticate($form->{login}, $form->{password}, 0))) { @@ -81,7 +94,7 @@ if ($form->{action}) { $auth->create_or_refresh_session(); $form->{titlebar} .= " - $myconfig{name} - $myconfig{dbname}"; - call_sub($locale->findsub($form->{action})); + call_sub($locale->findsub($action)); } else { login_screen(); @@ -97,9 +110,8 @@ sub login_screen { $form->{stylesheet} = "lx-office-erp.css"; } - $form->{msg} = $msg; - $form->{fokus} = "loginscreen.login"; - $form->header; + $form->{msg} = $msg; + $form->header(); print $form->parse_html_template('login/login_screen'); @@ -125,6 +137,7 @@ sub login { my %style_to_script_map = ( 'v3' => 'v3', 'neu' => 'new', + 'v4' => 'v4', 'xml' => 'XML', ); @@ -157,6 +170,8 @@ sub company_logo { $locale = new Locale $myconfig{countrycode}, "login" if ($language ne $myconfig{countrycode}); + $form->{todo_list} = create_todo_list('login_screen' => 1) if (!$form->{no_todo_list}); + $form->{stylesheet} = $myconfig{stylesheet}; $form->{title} = $locale->text('About'); @@ -182,3 +197,4 @@ sub show_error { exit; } +