X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Flogin.pl;h=665cb9193a6fecb14c91d9c9972a70712c305b24;hb=8a2d9daf01083e1271cf6118591bb2c242734261;hp=49cb6c613e62bfafc0e48a6ee58457d13360ac96;hpb=3a94f4d2dd9a835d4a7007e1b999ea00b3c4e1cd;p=kivitendo-erp.git diff --git a/bin/mozilla/login.pl b/bin/mozilla/login.pl index 49cb6c613..665cb9193 100644 --- a/bin/mozilla/login.pl +++ b/bin/mozilla/login.pl @@ -45,7 +45,6 @@ sub run { $::lxdebug->enter_sub; my $session_result = shift; - $cgi = $::cgi; $form = $::form; $auth = $::auth; @@ -65,12 +64,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,16 +111,22 @@ 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(); } - my %style_to_script_map = ( 'v3' => 'v3', - 'neu' => 'new', - 'v4' => 'v4', - 'xml' => 'XML', - ); + my %style_to_script_map = ( + v3 => 'v3', + neu => 'new', + v4 => 'v4', + ); my $menu_script = $style_to_script_map{$user->{menustyle}} || ''; @@ -163,6 +169,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}; @@ -182,6 +189,7 @@ sub show_error { 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();