1 ######################################################################
2 # SQL-Ledger Accounting
3 # Copyright (c) 1998-2002
5 # Author: Dieter Simader
6 # Email: dsimader@sql-ledger.org
7 # Web: http://www.sql-ledger.org
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #######################################################################
32 $locale = new Locale $language, "login";
35 if (-f "$form->{path}/custom_$form->{script}") {
36 eval { require "$form->{path}/custom_$form->{script}"; };
37 $form->error($@) if ($@);
40 # per login customization
41 if (-f "$form->{path}/$form->{login}_$form->{script}") {
42 eval { require "$form->{path}/$form->{login}_$form->{script}"; };
43 $form->error($@) if ($@);
46 # window title bar, user info
47 $form->{titlebar} = "SQL-Ledger ".$locale->text('Version'). " $form->{version}";
49 if ($form->{action}) {
50 $form->{titlebar} .= " - $myconfig{name} - $myconfig{dbname}";
51 &{ $locale->findsub($form->{action}) };
62 if (-f "css/sql-ledger.css") {
63 $form->{stylesheet} = "sql-ledger.css";
76 <table class=login border=3 cellpadding=20>
78 <td class=login align=center><a href="http://www.sql-ledger.org" target=_top><img src=sql-ledger.png border=0></a>
79 <h1 class=login align=center>|.$locale->text('Version').qq| $form->{version}
84 <form method=post action=$form->{script}>
91 <th align=right>|.$locale->text('Name').qq|</th>
92 <td><input class=login name=login size=30></td>
95 <th align=right>|.$locale->text('Password').qq|</th>
96 <td><input class=login type=password name=password size=30></td>
98 <input type=hidden name=path value=$form->{path}>
102 <input type=submit name=action value="|.$locale->text('Login').qq|">
123 $form->error($locale->text('You did not enter a name!')) unless ($form->{login});
125 $user = new User $memberfile, $form->{login};
127 # if we get an error back, bale out
128 if (($errno = $user->login(\%$form, $userspath)) <= -1) {
130 $err[1] = $locale->text('Incorrect Password!');
131 $err[2] = $locale->text('Incorrect Dataset version!');
132 $err[3] = qq|$form->{login} |.$locale->text('is not a member!');
134 $form->error($err[$errno]);
137 # made it this far, execute the menu
138 $argv = "login=$form->{login}&password=$form->{password}&path=$form->{path}&action=display";
140 exec ("perl", "menu.pl", $argv);
148 unlink "$userspath/$form->{login}.conf";
150 # remove the callback to display the message
151 $form->{callback} = "login.pl?path=$form->{path}&action=&login=";
152 $form->redirect($locale->text('You are logged out!'));
160 require "$userspath/$form->{login}.conf";
161 $locale = new Locale $myconfig{countrycode}, "login" unless ($language eq $myconfig{countrycode});
163 $myconfig{address} =~ s/\\n/<br>/g;
164 $myconfig{dbhost} = $locale->text('localhost') unless $myconfig{dbhost};
166 map { $form->{$_} = $myconfig{$_} } qw(charset stylesheet);
168 $form->{title} = $locale->text('About');
171 # create the logo screen
172 $form->header unless $form->{noheader};
181 <a href="http://www.sql-ledger.org" target=_top><img src=sql-ledger.png border=0></a>
182 <h1 class=login>|.$locale->text('Version').qq| $form->{version}</h1>
185 |.$locale->text('Licensed to').qq|
189 <br>$myconfig{address}
195 <th align=right>|.$locale->text('User').qq|</th>
196 <td>$myconfig{name}</td>
199 <th align=right>|.$locale->text('Dataset').qq|</th>
200 <td>$myconfig{dbname}</td>
203 <th align=right>|.$locale->text('Database Host').qq|</th>
204 <td>$myconfig{dbhost}</td>