1 #=====================================================================
 
   4 # Based on SQL-Ledger Version 2.1.9
 
   5 # Web http://www.lx-office.org
 
   7 ######################################################################
 
   8 # SQL-Ledger Accounting
 
   9 # Copyright (c) 1998-2002
 
  11 #  Author: Dieter Simader
 
  12 #   Email: dsimader@sql-ledger.org
 
  13 #     Web: http://www.sql-ledger.org
 
  16 # This program is free software; you can redistribute it and/or modify
 
  17 # it under the terms of the GNU General Public License as published by
 
  18 # the Free Software Foundation; either version 2 of the License, or
 
  19 # (at your option) any later version.
 
  21 # This program is distributed in the hope that it will be useful,
 
  22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
  24 # GNU General Public License for more details.
 
  25 # You should have received a copy of the GNU General Public License
 
  26 # along with this program; if not, write to the Free Software
 
  27 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
  28 #######################################################################
 
  36 $locale = new Locale $language, "login";
 
  39 if (-f "$form->{path}/custom_$form->{script}") {
 
  40   eval { require "$form->{path}/custom_$form->{script}"; };
 
  41   $form->error($@) if ($@);
 
  44 # per login customization
 
  45 if (-f "$form->{path}/$form->{login}_$form->{script}") {
 
  46   eval { require "$form->{path}/$form->{login}_$form->{script}"; };
 
  47   $form->error($@) if ($@);
 
  50 # window title bar, user info
 
  52   "Lx-Office " . $locale->text('Version') . " $form->{version}";
 
  54 if ($form->{action}) {
 
  55   $form->{titlebar} .= " - $myconfig{name} - $myconfig{dbname}";
 
  56   &{ $locale->findsub($form->{action}) };
 
  64   $lxdebug->enter_sub();
 
  66   if (-f "css/lx-office-erp.css") {
 
  67     $form->{stylesheet} = "lx-office-erp.css";
 
  70   $form->{fokus} = "loginscreen.login";
 
  76 <body class=login onLoad="fokus()">
 
  83 <table class=login border=3 cellpadding=20>
 
  85     <td class=login align=center><a href="http://www.lx-office.org" target=_top><img src="image/lx-office-erp.png" border=0></a>
 
  86 <h1 class=login align=center>|
 
  87     . $locale->text('Version') . qq| $form->{version}
 
  92 <form method=post name=loginscreen action=$form->{script}>
 
  99                 <th align=right>| . $locale->text('Login Name') . qq|</th>
 
 100                 <td><input class=login name=login size=30 tabindex="1"></td>
 
 103                 <th align=right>| . $locale->text('Password') . qq|</th>
 
 104                 <td><input class=login type=password name=password size=30 tabindex="2"></td>
 
 106               <input type=hidden name=path value=$form->{path}>
 
 110             <input type=submit name=action value="| . $locale->text('Login') . qq|">
 
 126   $lxdebug->leave_sub();
 
 130   $lxdebug->enter_sub();
 
 132   $form->error($locale->text('You did not enter a name!'))
 
 133     unless ($form->{login});
 
 135   $user = new User $memberfile, $form->{login};
 
 137   # if we get an error back, bale out
 
 138   if (($errno = $user->login(\%$form, $userspath)) <= -1) {
 
 140     $err[1] = $err[3] = $locale->text('Incorrect username or password!');
 
 144       # upgraded dataset, login again
 
 146         "<a href=menu.pl?login=$form->{login}&password=$form->{password}&path=$form->{path}&action=display>Continue</a>"
 
 151     $form->error($err[$errno]);
 
 154   # made it this far, execute the menu
 
 155   if ($user->{menustyle} eq "neu") {
 
 157       "menunew.pl?login=$form->{login}&password=$form->{password}&path=$form->{path}&action=display";
 
 160       "menu.pl?login=$form->{login}&password=$form->{password}&path=$form->{path}&action=display";
 
 165   $lxdebug->leave_sub();
 
 169   $lxdebug->enter_sub();
 
 171   unlink "$userspath/$form->{login}.conf";
 
 173   # remove the callback to display the message
 
 174   $form->{callback} = "login.pl?path=$form->{path}&action=&login=";
 
 175   $form->redirect($locale->text('You are logged out!'));
 
 177   $lxdebug->leave_sub();
 
 181   $lxdebug->enter_sub();
 
 183   require "$userspath/$form->{login}.conf";
 
 184   $locale = new Locale $myconfig{countrycode}, "login"
 
 185     unless ($language eq $myconfig{countrycode});
 
 187   $myconfig{address} =~ s/\\n/<br>/g;
 
 188   $myconfig{dbhost} = $locale->text('localhost') unless $myconfig{dbhost};
 
 190   map { $form->{$_} = $myconfig{$_} } qw(charset stylesheet);
 
 192   $form->{title} = $locale->text('About');
 
 194   # create the logo screen
 
 195   $form->header unless $form->{noheader};
 
 200 <a href="http://www.lx-office.org" target=_top><img src="image/lx-office-erp.png" border=0></a>
 
 201 <h2 class=login>| . $locale->text('Version') . qq| $form->{version}</h2>
 
 203 | . $locale->text('Licensed to') . qq|
 
 207 <br>$myconfig{address}
 
 214     <th align=left>| . $locale->text('User') . qq|</th>
 
 215     <td>$myconfig{name}</td>
 
 218     <th align=left>| . $locale->text('Dataset') . qq|</th>
 
 219     <td>$myconfig{dbname}</td>
 
 222     <th align=left>| . $locale->text('Database Host') . qq|</th>
 
 223     <td>$myconfig{dbhost}</td>
 
 230     <th colspan="2" align="center"><a href="http://lx-office.org" target="blank">http://lx-office.org</a></th>
 
 233     <th colspan="2" align="center"><a href="mailto:info@lx-office.org" target="blank">info@lx-office.org</a></th>
 
 243   $lxdebug->leave_sub();