X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Flogin.pl;h=e88872113808af90cbf6a61d87065bbbb69b9ad2;hb=9f0d85c2b00a0d3b7a92b63115801b2452846470;hp=765e4d33482e0a2f3575e3500ee7e086c3902585;hpb=4dbb09950c9f5596646537c12d991c99086fe7c1;p=kivitendo-erp.git diff --git a/bin/mozilla/login.pl b/bin/mozilla/login.pl index 765e4d334..e88872113 100644 --- a/bin/mozilla/login.pl +++ b/bin/mozilla/login.pl @@ -27,12 +27,10 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ####################################################################### - use DBI; use SL::User; use SL::Form; - $form = new Form; $locale = new Locale $language, "login"; @@ -50,7 +48,8 @@ if (-f "$form->{path}/$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}"; @@ -59,17 +58,15 @@ if ($form->{action}) { &login_screen; } - 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; @@ -86,7 +83,8 @@ sub login_screen { @@ -120,7 +118,7 @@ sub login_screen {
- + - + - + {path}>
|.$locale->text('Login Name').qq|| . $locale->text('Login Name') . qq|
|.$locale->text('Password').qq|| . $locale->text('Password') . qq|

- +
- + |; @@ -128,11 +126,11 @@ sub login_screen { $lxdebug->leave_sub(); } - 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}; @@ -140,31 +138,38 @@ sub login { if (($errno = $user->login(\%$form, $userspath)) <= -1) { $errno *= -1; $err[1] = $err[3] = $locale->text('Incorrect username or password!'); - + if ($errno == 2) { + # upgraded dataset, login again - $form->redirect("{login}&password=$form->{password}&path=$form->{path}&action=display>Continue"); + $form->redirect( + "{login}&password=$form->{password}&path=$form->{path}&action=display>Continue" + ); exit; } - + $form->error($err[$errno]); } - + # made it this far, execute the menu - $form->{callback} = "menu.pl?login=$form->{login}&password=$form->{password}&path=$form->{path}&action=display"; + if ($user->{menustyle} eq "neu") { + $form->{callback} = + "menunew.pl?login=$form->{login}&password=$form->{password}&path=$form->{path}&action=display"; + } else { + $form->{callback} = + "menu.pl?login=$form->{login}&password=$form->{password}&path=$form->{path}&action=display"; + } $form->redirect; - + $lxdebug->leave_sub(); } - - sub logout { $lxdebug->enter_sub(); unlink "$userspath/$form->{login}.conf"; - + # remove the callback to display the message $form->{callback} = "login.pl?path=$form->{path}&action=&login="; $form->redirect($locale->text('You are logged out!')); @@ -172,22 +177,20 @@ sub logout { $lxdebug->leave_sub(); } - - sub company_logo { $lxdebug->enter_sub(); - + require "$userspath/$form->{login}.conf"; - $locale = new Locale $myconfig{countrycode}, "login" unless ($language eq $myconfig{countrycode}); + $locale = new Locale $myconfig{countrycode}, "login" + unless ($language eq $myconfig{countrycode}); $myconfig{address} =~ s/\\n/
/g; $myconfig{dbhost} = $locale->text('localhost') unless $myconfig{dbhost}; map { $form->{$_} = $myconfig{$_} } qw(charset stylesheet); - + $form->{title} = $locale->text('About'); - - + # create the logo screen $form->header unless $form->{noheader}; @@ -195,9 +198,9 @@ sub company_logo {
-

|.$locale->text('Version').qq| $form->{version}

+

| . $locale->text('Version') . qq| $form->{version}

-|.$locale->text('Licensed to').qq| +| . $locale->text('Licensed to') . qq|

$myconfig{company} @@ -208,15 +211,15 @@ $myconfig{company}
- + - + - + @@ -239,6 +242,3 @@ $myconfig{company} $lxdebug->leave_sub(); } - - -
|.$locale->text('User').qq|| . $locale->text('User') . qq| $myconfig{name}
|.$locale->text('Dataset').qq|| . $locale->text('Dataset') . qq| $myconfig{dbname}
|.$locale->text('Database Host').qq|| . $locale->text('Database Host') . qq| $myconfig{dbhost}