Revision d1e4ee79
Von Moritz Bunkus vor etwa 17 Jahren hinzugefügt
SL/Template/Plugin/LxERP.pm | ||
---|---|---|
23 | 23 |
return $self->format_amount($var * 100, $places, $skip_zero); |
24 | 24 |
} |
25 | 25 |
|
26 |
sub escape_br { |
|
27 |
my ($self, $var) = @_; |
|
28 |
|
|
29 |
$var =~ s/\r//g; |
|
30 |
$var =~ s/\n/<br>/g; |
|
31 |
|
|
32 |
return $var; |
|
33 |
} |
|
34 |
|
|
26 | 35 |
1; |
27 | 36 |
|
bin/mozilla/login.pl | ||
---|---|---|
50 | 50 |
} |
51 | 51 |
|
52 | 52 |
# window title bar, user info |
53 |
$form->{titlebar} = |
|
54 |
"Lx-Office " . $locale->text('Version') . " $form->{version}"; |
|
53 |
$form->{titlebar} = "Lx-Office " . $locale->text('Version') . " $form->{version}"; |
|
55 | 54 |
|
56 | 55 |
if ($form->{action}) { |
57 | 56 |
$form->{titlebar} .= " - $myconfig{name} - $myconfig{dbname}"; |
58 | 57 |
call_sub($locale->findsub($form->{action})); |
58 |
|
|
59 | 59 |
} else { |
60 |
&login_screen;
|
|
60 |
login_screen();
|
|
61 | 61 |
} |
62 | 62 |
|
63 | 63 |
1; |
... | ... | |
72 | 72 |
$form->{fokus} = "loginscreen.login"; |
73 | 73 |
$form->header; |
74 | 74 |
|
75 |
print qq| |
|
76 |
|
|
77 |
|
|
78 |
<body class=login onLoad="fokus()"> |
|
79 |
|
|
80 |
<pre> |
|
81 |
|
|
82 |
</pre> |
|
83 |
|
|
84 |
<center> |
|
85 |
<table class=login border=3 cellpadding=20> |
|
86 |
<tr> |
|
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} |
|
90 |
</h1> |
|
91 |
|
|
92 |
<p> |
|
93 |
|
|
94 |
<form method=post name=loginscreen action=$form->{script}> |
|
95 |
|
|
96 |
<input type="hidden" name="show_dbupdate_warning" value="1"> |
|
97 |
|
|
98 |
<table width=100%> |
|
99 |
<tr> |
|
100 |
<td align=center> |
|
101 |
<table> |
|
102 |
<tr> |
|
103 |
<th align=right>| . $locale->text('Login Name') . qq|</th> |
|
104 |
<td><input class=login name=login size=30 tabindex="1"></td> |
|
105 |
</tr> |
|
106 |
<tr> |
|
107 |
<th align=right>| . $locale->text('Password') . qq|</th> |
|
108 |
<td><input class=login type=password name=password size=30 tabindex="2"></td> |
|
109 |
</tr> |
|
110 |
</table> |
|
111 |
|
|
112 |
<br> |
|
113 |
<input type=submit name=action value="| . $locale->text('Login') . qq|" tabindex="3"> |
|
114 |
|
|
115 |
</td> |
|
116 |
</tr> |
|
117 |
</table> |
|
118 |
|
|
119 |
</form> |
|
120 |
|
|
121 |
</td> |
|
122 |
</tr> |
|
123 |
</table> |
|
124 |
|
|
125 |
</body> |
|
126 |
</html> |
|
127 |
|; |
|
75 |
print $form->parse_html_template('login/login_screen'); |
|
128 | 76 |
|
129 | 77 |
$lxdebug->leave_sub(); |
130 | 78 |
} |
... | ... | |
132 | 80 |
sub login { |
133 | 81 |
$lxdebug->enter_sub(); |
134 | 82 |
|
135 |
$form->error($locale->text('You did not enter a name!')) |
|
136 |
unless ($form->{login}); |
|
83 |
$form->error($locale->text('You did not enter a name!')) unless ($form->{login}); |
|
137 | 84 |
|
138 | 85 |
$user = new User $memberfile, $form->{login}; |
139 | 86 |
|
140 | 87 |
# if we get an error back, bale out |
141 |
if (($errno = $user->login(\%$form, $userspath)) <= -1) { |
|
142 |
$errno *= -1; |
|
143 |
$err[1] = $err[3] = $locale->text('Incorrect username or password!'); |
|
144 |
|
|
145 |
if ($errno == 2) { |
|
88 |
if (($result = $user->login(\%$form, $userspath)) <= -1) { |
|
89 |
if ($result == -2) { |
|
146 | 90 |
exit; |
147 | 91 |
} |
148 | 92 |
|
149 |
$form->error($err[$errno]);
|
|
93 |
$form->error($locale->text('Incorrect username or password!'));
|
|
150 | 94 |
} |
151 | 95 |
|
96 |
my %style_to_script_map = ( 'v3' => 'v3', |
|
97 |
'neu' => 'new', |
|
98 |
'xml' => 'XML', |
|
99 |
); |
|
100 |
|
|
101 |
my $menu_script = $style_to_script_map{$user->{menustyle}} || ''; |
|
102 |
|
|
152 | 103 |
# made it this far, execute the menu |
153 |
if ($user->{menustyle} eq "v3") { |
|
154 |
$form->{callback} = |
|
155 |
"menuv3.pl?login=$form->{login}&password=$form->{password}&action=display"; |
|
156 |
} elsif ($user->{menustyle} eq "neu") { |
|
157 |
$form->{callback} = |
|
158 |
"menunew.pl?login=$form->{login}&password=$form->{password}&action=display"; |
|
159 |
} elsif ($user->{menustyle} eq "xml") { |
|
160 |
$form->{callback} = |
|
161 |
"menuXML.pl?login=$form->{login}&password=$form->{password}&action=display"; |
|
162 |
} else { |
|
163 |
$form->{callback} = |
|
164 |
"menu.pl?login=$form->{login}&password=$form->{password}&action=display"; |
|
165 |
} |
|
104 |
$form->{callback} = build_std_url("script=menu${menu_script}.pl", 'action=display'); |
|
166 | 105 |
|
167 |
$form->redirect; |
|
106 |
$form->redirect();
|
|
168 | 107 |
|
169 | 108 |
$lxdebug->leave_sub(); |
170 | 109 |
} |
... | ... | |
185 | 124 |
$lxdebug->enter_sub(); |
186 | 125 |
|
187 | 126 |
require "$userspath/$form->{login}.conf"; |
188 |
$locale = new Locale $myconfig{countrycode}, "login" |
|
189 |
unless ($language eq $myconfig{countrycode}); |
|
190 | 127 |
|
191 |
$myconfig{address} =~ s/\\n/<br>/g; |
|
192 |
$myconfig{dbhost} = $locale->text('localhost') unless $myconfig{dbhost}; |
|
128 |
$locale = new Locale $myconfig{countrycode}, "login" if ($language ne $myconfig{countrycode}); |
|
193 | 129 |
|
194 |
$form->{stylesheet} = $myconfig{stylesheet}; |
|
195 |
|
|
196 |
$form->{title} = $locale->text('About'); |
|
130 |
$form->{stylesheet} = $myconfig{stylesheet}; |
|
131 |
$form->{title} = $locale->text('About'); |
|
197 | 132 |
|
198 | 133 |
# create the logo screen |
199 |
$form->header unless $form->{noheader}; |
|
200 |
|
|
201 |
print qq| |
|
202 |
<body> |
|
203 |
<center> |
|
204 |
<a href="http://www.lx-office.org" target=_top><img src="image/lx-office-erp.png" border=0></a> |
|
205 |
<h2 class=login>| . $locale->text('Version') . qq| $form->{version}</h2> |
|
206 |
|
|
207 |
| . $locale->text('Licensed to') . qq| |
|
208 |
<p> |
|
209 |
<b> |
|
210 |
$myconfig{company} |
|
211 |
<br>$myconfig{address} |
|
212 |
</b> |
|
213 |
|
|
214 |
|
|
215 |
<br> |
|
216 |
<table border=0> |
|
217 |
<tr> |
|
218 |
<th align=left>| . $locale->text('User') . qq|</th> |
|
219 |
<td>$myconfig{name}</td> |
|
220 |
</tr> |
|
221 |
<tr> |
|
222 |
<th align=left>| . $locale->text('Dataset') . qq|</th> |
|
223 |
<td>$myconfig{dbname}</td> |
|
224 |
</tr> |
|
225 |
<tr> |
|
226 |
<th align=left>| . $locale->text('Database Host') . qq|</th> |
|
227 |
<td>$myconfig{dbhost}</td> |
|
228 |
</tr> |
|
229 |
<tr> |
|
230 |
</tr> |
|
231 |
<tr> |
|
232 |
</tr> |
|
233 |
<tr> |
|
234 |
<th colspan="2" align="center"><a href="http://lx-office.org" target="blank">http://lx-office.org</a></th> |
|
235 |
</tr> |
|
236 |
<tr> |
|
237 |
<th colspan="2" align="center"><a href="mailto:info@lx-office.org" target="blank">info@lx-office.org</a></th> |
|
238 |
</tr> |
|
239 |
</table> |
|
240 |
|
|
241 |
</center> |
|
242 |
|
|
243 |
</body> |
|
244 |
</html> |
|
245 |
|; |
|
134 |
$form->header() unless $form->{noheader}; |
|
135 |
|
|
136 |
print $form->parse_html_template('login/company_logo'); |
|
246 | 137 |
|
247 | 138 |
$lxdebug->leave_sub(); |
248 | 139 |
} |
locale/de/all | ||
---|---|---|
1341 | 1341 |
'list_of_payments' => 'zahlungsausgaenge', |
1342 | 1342 |
'list_of_receipts' => 'zahlungseingaenge', |
1343 | 1343 |
'list_of_transactions' => 'buchungsliste', |
1344 |
'localhost' => 'lokaler Rechner', |
|
1345 | 1344 |
'logout' => 'abmelden', |
1346 | 1345 |
'mark as paid' => 'als bezahlt markieren', |
1347 | 1346 |
'month' => 'Monatliche Abgabe', |
locale/de/login | ||
---|---|---|
13 | 13 |
'Customer details' => 'Kundendetails', |
14 | 14 |
'DELETED' => 'Gel?scht', |
15 | 15 |
'DUNNING STARTED' => 'Mahnprozess gestartet', |
16 |
'Database Host' => 'Datenbankcomputer', |
|
17 |
'Dataset' => 'Datenbank', |
|
18 | 16 |
'Dataset upgrade' => 'Datenbankaktualisierung', |
19 | 17 |
'Date' => 'Datum', |
20 | 18 |
'Dependency loop detected:' => 'Schleife in den Abhängigkeiten entdeckt:', |
... | ... | |
26 | 24 |
'History' => 'Historie', |
27 | 25 |
'Incorrect username or password!' => 'Ung?ltiger Benutzername oder falsches Passwort!', |
28 | 26 |
'Invoice' => 'Rechnung', |
29 |
'Licensed to' => 'Lizensiert f?r', |
|
30 |
'Login' => 'Anmeldung', |
|
31 |
'Login Name' => 'Benutzername', |
|
32 | 27 |
'MAILED' => 'Gesendet', |
33 | 28 |
'Mark as paid?' => 'Als bezahlt markieren?', |
34 | 29 |
'Marked as paid' => 'Als bezahlt markiert', |
... | ... | |
52 | 47 |
'Packing List' => 'Lieferschein', |
53 | 48 |
'Part Number' => 'Artikelnummer', |
54 | 49 |
'Part description' => 'Artikelbeschreibung', |
55 |
'Password' => 'Passwort', |
|
56 | 50 |
'Pick List' => 'Sammelliste', |
57 | 51 |
'Please enter values' => 'Bitte Werte eingeben', |
58 | 52 |
'Proforma Invoice' => 'Proformarechnung', |
... | ... | |
76 | 70 |
'Trying to call a sub without a name' => 'Es wurde versucht, eine Unterfunktion ohne Namen aufzurufen.', |
77 | 71 |
'Unit' => 'Einheit', |
78 | 72 |
'Unknown dependency \'%s\'.' => 'Unbekannte Abhängigkeit \'%s\'.', |
79 |
'User' => 'Benutzer', |
|
80 | 73 |
'Value' => 'Wert', |
81 | 74 |
'Variable' => 'Variable', |
82 | 75 |
'Vendor details' => 'Lieferantendetails', |
... | ... | |
86 | 79 |
'[email]' => '[email]', |
87 | 80 |
'bin_list' => 'Lagerliste', |
88 | 81 |
'invoice' => 'Rechnung', |
89 |
'localhost' => 'lokaler Rechner', |
|
90 | 82 |
'no' => 'nein', |
91 | 83 |
'packing_list' => 'Versandliste', |
92 | 84 |
'pick_list' => 'Entnahmeliste', |
templates/webpages/login/company_logo_de.html | ||
---|---|---|
1 |
[% USE HTML %][% USE LxERP %]<body> |
|
2 |
[%- DEFAULT myconfig_dbhost = 'localhost' %] |
|
3 |
|
|
4 |
<center> |
|
5 |
<a href="http://www.lx-office.org" target="_top"><img src="image/lx-office-erp.png" border="0"></a> |
|
6 |
|
|
7 |
<h2 class="login">Version [% version %]</h2> |
|
8 |
|
|
9 |
<p>Lizensiert f?r</p> |
|
10 |
|
|
11 |
<p> |
|
12 |
<b> |
|
13 |
[% HTML.escape(myconfig_company) %] |
|
14 |
<br> |
|
15 |
[% HTML.escape(myconfig_address).replace('\\\\n', '<br>') %] |
|
16 |
</b> |
|
17 |
|
|
18 |
<br> |
|
19 |
|
|
20 |
<table border="0"> |
|
21 |
<tr> |
|
22 |
<th align="left">Benutzer</th> |
|
23 |
<td>[% HTML.escape(myconfig_name) %]</td> |
|
24 |
</tr> |
|
25 |
<tr> |
|
26 |
<th align="left">Datenbank</th> |
|
27 |
<td>[% HTML.escape(myconfig_dbname) %]</td> |
|
28 |
</tr> |
|
29 |
<tr> |
|
30 |
<th align="left">Datenbankcomputer</th> |
|
31 |
<td>[% HTML.escape(myconfig_dbhost) %]</td> |
|
32 |
</tr> |
|
33 |
<tr> |
|
34 |
</tr> |
|
35 |
<tr> |
|
36 |
</tr> |
|
37 |
<tr> |
|
38 |
<th colspan="2" align="center"><a href="http://lx-office.org" target="blank">http://lx-office.org</a></th> |
|
39 |
</tr> |
|
40 |
<tr> |
|
41 |
<th colspan="2" align="center"><a href="mailto:info@lx-office.org" target="blank">info@lx-office.org</a></th> |
|
42 |
</tr> |
|
43 |
</table> |
|
44 |
|
|
45 |
</center> |
|
46 |
|
|
47 |
</body> |
|
48 |
</html> |
templates/webpages/login/company_logo_master.html | ||
---|---|---|
1 |
[% USE HTML %][% USE LxERP %]<body> |
|
2 |
[%- DEFAULT myconfig_dbhost = 'localhost' %] |
|
3 |
|
|
4 |
<center> |
|
5 |
<a href="http://www.lx-office.org" target="_top"><img src="image/lx-office-erp.png" border="0"></a> |
|
6 |
|
|
7 |
<h2 class="login"><translate>Version</translate> [% version %]</h2> |
|
8 |
|
|
9 |
<p><translate>Licensed to</translate></p> |
|
10 |
|
|
11 |
<p> |
|
12 |
<b> |
|
13 |
[% HTML.escape(myconfig_company) %] |
|
14 |
<br> |
|
15 |
[% HTML.escape(myconfig_address).replace('\\\\n', '<br>') %] |
|
16 |
</b> |
|
17 |
|
|
18 |
<br> |
|
19 |
|
|
20 |
<table border="0"> |
|
21 |
<tr> |
|
22 |
<th align="left"><translate>User</translate></th> |
|
23 |
<td>[% HTML.escape(myconfig_name) %]</td> |
|
24 |
</tr> |
|
25 |
<tr> |
|
26 |
<th align="left"><translate>Dataset</translate></th> |
|
27 |
<td>[% HTML.escape(myconfig_dbname) %]</td> |
|
28 |
</tr> |
|
29 |
<tr> |
|
30 |
<th align="left"><translate>Database Host</translate></th> |
|
31 |
<td>[% HTML.escape(myconfig_dbhost) %]</td> |
|
32 |
</tr> |
|
33 |
<tr> |
|
34 |
</tr> |
|
35 |
<tr> |
|
36 |
</tr> |
|
37 |
<tr> |
|
38 |
<th colspan="2" align="center"><a href="http://lx-office.org" target="blank">http://lx-office.org</a></th> |
|
39 |
</tr> |
|
40 |
<tr> |
|
41 |
<th colspan="2" align="center"><a href="mailto:info@lx-office.org" target="blank">info@lx-office.org</a></th> |
|
42 |
</tr> |
|
43 |
</table> |
|
44 |
|
|
45 |
</center> |
|
46 |
|
|
47 |
</body> |
|
48 |
</html> |
templates/webpages/login/login_screen_de.html | ||
---|---|---|
1 |
[% USE HTML %]<body class="login" onLoad="fokus()"> |
|
2 |
|
|
3 |
<center> |
|
4 |
<table class="login" border="3" cellpadding="20"> |
|
5 |
<tr> |
|
6 |
<td class="login" align="center"> |
|
7 |
<a href="http://www.lx-office.org" target="_top"><img src="image/lx-office-erp.png" border="0"></a> |
|
8 |
<h1 class="login" align="center">Version [% version %]</h1> |
|
9 |
|
|
10 |
<p> |
|
11 |
|
|
12 |
<form method="post" name="loginscreen" action="login.pl"> |
|
13 |
|
|
14 |
<input type="hidden" name="show_dbupdate_warning" value="1"> |
|
15 |
|
|
16 |
<table width="100%"> |
|
17 |
<tr> |
|
18 |
<td align="center"> |
|
19 |
<table> |
|
20 |
<tr> |
|
21 |
<th align="right">Benutzername</th> |
|
22 |
<td><input class="login" name="login" size="30" tabindex="1"></td> |
|
23 |
</tr> |
|
24 |
<tr> |
|
25 |
<th align="right">Passwort</th> |
|
26 |
<td><input class="login" type="password" name="password" size="30" tabindex="2"></td> |
|
27 |
</tr> |
|
28 |
</table> |
|
29 |
|
|
30 |
<br> |
|
31 |
<input type="submit" name="action" value="Anmeldung" tabindex="3"> |
|
32 |
|
|
33 |
</td> |
|
34 |
</tr> |
|
35 |
</table> |
|
36 |
|
|
37 |
</form> |
|
38 |
|
|
39 |
</td> |
|
40 |
</tr> |
|
41 |
</table> |
|
42 |
|
|
43 |
</body> |
|
44 |
</html> |
templates/webpages/login/login_screen_master.html | ||
---|---|---|
1 |
[% USE HTML %]<body class="login" onLoad="fokus()"> |
|
2 |
|
|
3 |
<center> |
|
4 |
<table class="login" border="3" cellpadding="20"> |
|
5 |
<tr> |
|
6 |
<td class="login" align="center"> |
|
7 |
<a href="http://www.lx-office.org" target="_top"><img src="image/lx-office-erp.png" border="0"></a> |
|
8 |
<h1 class="login" align="center"><translate>Version</translate> [% version %]</h1> |
|
9 |
|
|
10 |
<p> |
|
11 |
|
|
12 |
<form method="post" name="loginscreen" action="login.pl"> |
|
13 |
|
|
14 |
<input type="hidden" name="show_dbupdate_warning" value="1"> |
|
15 |
|
|
16 |
<table width="100%"> |
|
17 |
<tr> |
|
18 |
<td align="center"> |
|
19 |
<table> |
|
20 |
<tr> |
|
21 |
<th align="right"><translate>Login Name</translate></th> |
|
22 |
<td><input class="login" name="login" size="30" tabindex="1"></td> |
|
23 |
</tr> |
|
24 |
<tr> |
|
25 |
<th align="right"><translate>Password</translate></th> |
|
26 |
<td><input class="login" type="password" name="password" size="30" tabindex="2"></td> |
|
27 |
</tr> |
|
28 |
</table> |
|
29 |
|
|
30 |
<br> |
|
31 |
<input type="submit" name="action" value="<translate>Login</translate>" tabindex="3"> |
|
32 |
|
|
33 |
</td> |
|
34 |
</tr> |
|
35 |
</table> |
|
36 |
|
|
37 |
</form> |
|
38 |
|
|
39 |
</td> |
|
40 |
</tr> |
|
41 |
</table> |
|
42 |
|
|
43 |
</body> |
|
44 |
</html> |
Auch abrufbar als: Unified diff
Auslagern des HTML-Codes aus login.pl in HTML-Vorlagen.