X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Flogin.pl;h=82d50d7066b8a2dc9602a2c22a119e8ff4f961e5;hb=dbd0ae115bd9a6ba0ede24f9655a29df6bf7dc3b;hp=72032f3df8a573bdf0c30cf0992077ec59865f3e;hpb=faef45c2e723c9fbc80d1d84b8481367204719b7;p=kivitendo-erp.git diff --git a/bin/mozilla/login.pl b/bin/mozilla/login.pl index 72032f3df..82d50d706 100644 --- a/bin/mozilla/login.pl +++ b/bin/mozilla/login.pl @@ -28,14 +28,33 @@ ####################################################################### use DBI; +use SL::Auth; use SL::User; use SL::Form; require "bin/mozilla/common.pl"; +require "bin/mozilla/todo.pl"; -$form = new Form; +use strict; -$locale = new Locale $language, "login"; +# This is required because the am.pl in the root directory +# is not scanned by locales.pl: +# $form->parse_html_template('login/password_error') + +our $form = new Form; + +if (! -f 'config/authentication.pl') { + show_error('login/authentication_pl_missing'); +} + +our $locale = new Locale $main::language, "login"; + +our $auth = SL::Auth->new(); +if (!$auth->session_tables_present()) { + show_error('login/auth_db_unreachable'); +} +$auth->expire_sessions(); +my $session_result = $main::auth->restore_session(); # customization if (-f "bin/mozilla/custom_$form->{script}") { @@ -50,196 +69,137 @@ if (-f "bin/mozilla/$form->{login}_$form->{script}") { } # window title bar, user info -$form->{titlebar} = - "Lx-Office " . $locale->text('Version') . " $form->{version}"; +$form->{titlebar} = "Lx-Office " . $locale->text('Version') . " $form->{version}"; -if ($form->{action}) { - $form->{titlebar} .= " - $myconfig{name} - $myconfig{dbname}"; - call_sub($locale->findsub($form->{action})); -} else { - &login_screen; +if (SL::Auth::SESSION_EXPIRED == $session_result) { + $form->{error_message} = $locale->text('The session is invalid or has expired.'); + login_screen(); + exit; } -1; - -sub login_screen { - $lxdebug->enter_sub(); - - if (-f "css/lx-office-erp.css") { - $form->{stylesheet} = "lx-office-erp.css"; - } - - $form->{fokus} = "loginscreen.login"; - $form->header; - - print qq| +my $action = $form->{action}; +if (!$action && $auth->{SESSION}->{login}) { + $action = 'login'; +} -
- -- -- -