+ if (SL::Auth::SESSION_EXPIRED == $session_result) {
+ $form->{error_message} = $::locale->text('The session is invalid or has expired.');
+ login_screen();
+ ::end_of_request();
+ }
+ my $action = $form->{action};
+ if (!$action && $auth->{SESSION}->{login}) {
+ $action = 'login';
+ }
+ if ($action) {
+ %::myconfig = $auth->read_user(login => $form->{login}) if ($form->{login});
+ $::locale = Locale->new($::myconfig{countrycode}) if $::myconfig{countrycode};
+
+ if (SL::Auth::OK != $auth->authenticate($::myconfig{login}, $form->{password})) {
+ $form->{error_message} = $::locale->text('Incorrect username or password!');
+ login_screen();
+ } else {
+ $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));
+ }
+ } else {
+ login_screen();
+ }
+
+ $::lxdebug->leave_sub;
+}