X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/d629acd82a27e980899a044ca8b0f4becc8e94bb..d1e4ee7951b4ea788fcfd6bf882865f1b2724966:/bin/mozilla/login.pl diff --git a/bin/mozilla/login.pl b/bin/mozilla/login.pl index 39890982d..b9a29c3ed 100644 --- a/bin/mozilla/login.pl +++ b/bin/mozilla/login.pl @@ -50,14 +50,14 @@ 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; + login_screen(); } 1; @@ -72,59 +72,7 @@ sub login_screen { $form->{fokus} = "loginscreen.login"; $form->header; - print qq| - - - - -
-
-
- -
- - - - -
- - - -|; + print $form->parse_html_template('login/login_screen'); $lxdebug->leave_sub(); } @@ -132,36 +80,30 @@ sub login_screen { sub login { $lxdebug->enter_sub(); - $form->error($locale->text('You did not enter a name!')) - unless ($form->{login}); + $form->error($locale->text('You did not enter a name!')) unless ($form->{login}); $user = new User $memberfile, $form->{login}; # if we get an error back, bale out - if (($errno = $user->login(\%$form, $userspath)) <= -1) { - $errno *= -1; - $err[1] = $err[3] = $locale->text('Incorrect username or password!'); - - if ($errno == 2) { + if (($result = $user->login(\%$form, $userspath)) <= -1) { + if ($result == -2) { exit; } - $form->error($err[$errno]); + $form->error($locale->text('Incorrect username or password!')); } + my %style_to_script_map = ( 'v3' => 'v3', + 'neu' => 'new', + 'xml' => 'XML', + ); + + my $menu_script = $style_to_script_map{$user->{menustyle}} || ''; + # made it this far, execute the menu - if ($user->{menustyle} eq "v3") { - $form->{callback} = - "menuv3.pl?login=$form->{login}&password=$form->{password}&action=display"; - } elsif ($user->{menustyle} eq "neu") { - $form->{callback} = - "menunew.pl?login=$form->{login}&password=$form->{password}&action=display"; - } else { - $form->{callback} = - "menu.pl?login=$form->{login}&password=$form->{password}&action=display"; - } + $form->{callback} = build_std_url("script=menu${menu_script}.pl", 'action=display'); - $form->redirect; + $form->redirect(); $lxdebug->leave_sub(); } @@ -182,64 +124,16 @@ sub company_logo { $lxdebug->enter_sub(); require "$userspath/$form->{login}.conf"; - $locale = new Locale $myconfig{countrycode}, "login" - unless ($language eq $myconfig{countrycode}); - $myconfig{address} =~ s/\\n/
/g; - $myconfig{dbhost} = $locale->text('localhost') unless $myconfig{dbhost}; + $locale = new Locale $myconfig{countrycode}, "login" if ($language ne $myconfig{countrycode}); - map { $form->{$_} = $myconfig{$_} } qw(charset stylesheet); - - $form->{title} = $locale->text('About'); + $form->{stylesheet} = $myconfig{stylesheet}; + $form->{title} = $locale->text('About'); # create the logo screen - $form->header unless $form->{noheader}; - - print qq| - -
- - - -| . $locale->text('Licensed to') . qq| -

- -$myconfig{company} -
$myconfig{address} -
- - -
- - - - - - - - - - - - - - - - - - - - - - - -
| . $locale->text('User') . qq|$myconfig{name}
| . $locale->text('Dataset') . qq|$myconfig{dbname}
| . $locale->text('Database Host') . qq|$myconfig{dbhost}
http://lx-office.org
info@lx-office.org
- -

- - - -|; + $form->header() unless $form->{noheader}; + + print $form->parse_html_template('login/company_logo'); $lxdebug->leave_sub(); }