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 #######################################################################
34 require "bin/mozilla/common.pl";
38 $locale = new Locale $language, "login";
41 if (-f "bin/mozilla/custom_$form->{script}") {
42 eval { require "bin/mozilla/custom_$form->{script}"; };
43 $form->error($@) if ($@);
46 # per login customization
47 if (-f "bin/mozilla/$form->{login}_$form->{script}") {
48 eval { require "bin/mozilla/$form->{login}_$form->{script}"; };
49 $form->error($@) if ($@);
52 # window title bar, user info
54 "Lx-Office " . $locale->text('Version') . " $form->{version}";
56 if ($form->{action}) {
57 $form->{titlebar} .= " - $myconfig{name} - $myconfig{dbname}";
58 call_sub($locale->findsub($form->{action}));
66 $lxdebug->enter_sub();
68 if (-f "css/lx-office-erp.css") {
69 $form->{stylesheet} = "lx-office-erp.css";
72 $form->{fokus} = "loginscreen.login";
78 <body class=login onLoad="fokus()">
85 <table class=login border=3 cellpadding=20>
87 <td class=login align=center><a href="http://www.lx-office.org" target=_top><img src="image/lx-office-erp.png" border=0></a>
88 <h1 class=login align=center>|
89 . $locale->text('Version') . qq| $form->{version}
94 <form method=post name=loginscreen action=$form->{script}>
96 <input type="hidden" name="show_dbupdate_warning" value="1">
103 <th align=right>| . $locale->text('Login Name') . qq|</th>
104 <td><input class=login name=login size=30 tabindex="1"></td>
107 <th align=right>| . $locale->text('Password') . qq|</th>
108 <td><input class=login type=password name=password size=30 tabindex="2"></td>
113 <input type=submit name=action value="| . $locale->text('Login') . qq|" tabindex="3">
129 $lxdebug->leave_sub();
133 $lxdebug->enter_sub();
135 $form->error($locale->text('You did not enter a name!'))
136 unless ($form->{login});
138 $user = new User $memberfile, $form->{login};
140 # if we get an error back, bale out
141 if (($errno = $user->login(\%$form, $userspath)) <= -1) {
143 $err[1] = $err[3] = $locale->text('Incorrect username or password!');
149 $form->error($err[$errno]);
152 # made it this far, execute the menu
153 if ($user->{menustyle} eq "v3") {
155 "menuv3.pl?login=$form->{login}&password=$form->{password}&action=display";
156 } elsif ($user->{menustyle} eq "neu") {
158 "menunew.pl?login=$form->{login}&password=$form->{password}&action=display";
161 "menu.pl?login=$form->{login}&password=$form->{password}&action=display";
166 $lxdebug->leave_sub();
170 $lxdebug->enter_sub();
172 unlink "$userspath/$form->{login}.conf";
174 # remove the callback to display the message
175 $form->{callback} = "login.pl?action=&login=";
176 $form->redirect($locale->text('You are logged out!'));
178 $lxdebug->leave_sub();
182 $lxdebug->enter_sub();
184 require "$userspath/$form->{login}.conf";
185 $locale = new Locale $myconfig{countrycode}, "login"
186 unless ($language eq $myconfig{countrycode});
188 $myconfig{address} =~ s/\\n/<br>/g;
189 $myconfig{dbhost} = $locale->text('localhost') unless $myconfig{dbhost};
191 $form->{stylesheet} = $myconfig{stylesheet};
193 $form->{title} = $locale->text('About');
195 # create the logo screen
196 $form->header unless $form->{noheader};
201 <a href="http://www.lx-office.org" target=_top><img src="image/lx-office-erp.png" border=0></a>
202 <h2 class=login>| . $locale->text('Version') . qq| $form->{version}</h2>
204 | . $locale->text('Licensed to') . qq|
208 <br>$myconfig{address}
215 <th align=left>| . $locale->text('User') . qq|</th>
216 <td>$myconfig{name}</td>
219 <th align=left>| . $locale->text('Dataset') . qq|</th>
220 <td>$myconfig{dbname}</td>
223 <th align=left>| . $locale->text('Database Host') . qq|</th>
224 <td>$myconfig{dbhost}</td>
231 <th colspan="2" align="center"><a href="http://lx-office.org" target="blank">http://lx-office.org</a></th>
234 <th colspan="2" align="center"><a href="mailto:info@lx-office.org" target="blank">info@lx-office.org</a></th>
244 $lxdebug->leave_sub();