X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Flogin.pl;h=94905e4edca453fe6b70bb23a838977df31d344c;hb=5d8dbe98677296f277230024db5af5307861ab22;hp=5d71b7686387c15ab8166dee23e12e4019a053c7;hpb=6cf3f7762efd40bee49a2b8f11bb4ab6915d9071;p=kivitendo-erp.git diff --git a/bin/mozilla/login.pl b/bin/mozilla/login.pl index 5d71b7686..94905e4ed 100644 --- a/bin/mozilla/login.pl +++ b/bin/mozilla/login.pl @@ -65,12 +65,13 @@ sub run { %::myconfig = $auth->read_user($form->{login}) if ($form->{login}); $::locale = Locale->new($::myconfig{countrycode}) if $::myconfig{countrycode}; - if (!$::myconfig{login} || (SL::Auth::OK != $auth->authenticate($form->{login}, $form->{password}, 0))) { + if (SL::Auth::OK != $auth->authenticate($::myconfig{login}, $form->{password})) { $form->{error_message} = $::locale->text('Incorrect username or password!'); login_screen(); } else { - $auth->set_session_value('login', $form->{login}, 'password', $form->{password}); + $auth->store_credentials_in_session(login => $form->{login}, password => $form->{password}); $auth->create_or_refresh_session(); + delete $form->{password}; $form->{titlebar} .= " - $::myconfig{name} - $::myconfig{dbname}"; call_sub($::locale->findsub($action)); @@ -111,6 +112,12 @@ sub login { # if we get an error back, bale out my $result; if (($result = $user->login($form)) <= -1) { + if ($result == -3) { + show_error('login/auth_db_needs_update'); + $::auth->destroy_session; + ::end_of_request(); + } + ::end_of_request() if $result == -2; login_screen($::locale->text('Incorrect username or password!')); ::end_of_request(); @@ -163,6 +170,7 @@ sub company_logo { $form->{stylesheet} = $myconfig{stylesheet}; $form->{title} = $::locale->text('Lx-Office'); + $form->{interface} = $::dispatcher->interface_type; # create the logo screen $form->header() unless $form->{noheader}; @@ -175,13 +183,14 @@ sub company_logo { sub show_error { my $template = shift; my %myconfig = %main::myconfig; - $myconfig{countrycode} = $main::language; + $myconfig{countrycode} = $::lx_office_conf{system}->{language}; $form->{stylesheet} = 'css/lx-office-erp.css'; $form->header(); print $form->parse_html_template($template); # $form->parse_html_template('login/auth_db_unreachable'); + # $form->parse_html_template('login/auth_db_needs_update'); # $form->parse_html_template('login/authentication_pl_missing'); ::end_of_request();