return $self->format_amount($var * 100, $places, $skip_zero);
}
+sub escape_br {
+ my ($self, $var) = @_;
+
+ $var =~ s/\r//g;
+ $var =~ s/\n/<br>/g;
+
+ return $var;
+}
+
1;
}
# 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}";
call_sub($locale->findsub($form->{action}));
+
} else {
- &login_screen;
+ login_screen();
}
1;
$form->{fokus} = "loginscreen.login";
$form->header;
- print qq|
-
-
-<body class=login onLoad="fokus()">
-
-<pre>
-
-</pre>
-
-<center>
-<table class=login border=3 cellpadding=20>
- <tr>
- <td class=login align=center><a href="http://www.lx-office.org" target=_top><img src="image/lx-office-erp.png" border=0></a>
-<h1 class=login align=center>|
- . $locale->text('Version') . qq| $form->{version}
-</h1>
-
-<p>
-
-<form method=post name=loginscreen action=$form->{script}>
-
- <input type="hidden" name="show_dbupdate_warning" value="1">
-
- <table width=100%>
- <tr>
- <td align=center>
- <table>
- <tr>
- <th align=right>| . $locale->text('Login Name') . qq|</th>
- <td><input class=login name=login size=30 tabindex="1"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Password') . qq|</th>
- <td><input class=login type=password name=password size=30 tabindex="2"></td>
- </tr>
- </table>
-
- <br>
- <input type=submit name=action value="| . $locale->text('Login') . qq|" tabindex="3">
-
- </td>
- </tr>
- </table>
-
-</form>
-
- </td>
- </tr>
-</table>
-
-</body>
-</html>
-|;
+ print $form->parse_html_template('login/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};
# if we get an error back, bale out
- if (($errno = $user->login(\%$form, $userspath)) <= -1) {
- $errno *= -1;
- $err[1] = $err[3] = $locale->text('Incorrect username or password!');
-
- if ($errno == 2) {
+ if (($result = $user->login(\%$form, $userspath)) <= -1) {
+ if ($result == -2) {
exit;
}
- $form->error($err[$errno]);
+ $form->error($locale->text('Incorrect username or password!'));
}
+ my %style_to_script_map = ( 'v3' => 'v3',
+ 'neu' => 'new',
+ 'xml' => 'XML',
+ );
+
+ my $menu_script = $style_to_script_map{$user->{menustyle}} || '';
+
# made it this far, execute the menu
- if ($user->{menustyle} eq "v3") {
- $form->{callback} =
- "menuv3.pl?login=$form->{login}&password=$form->{password}&action=display";
- } elsif ($user->{menustyle} eq "neu") {
- $form->{callback} =
- "menunew.pl?login=$form->{login}&password=$form->{password}&action=display";
- } elsif ($user->{menustyle} eq "xml") {
- $form->{callback} =
- "menuXML.pl?login=$form->{login}&password=$form->{password}&action=display";
- } else {
- $form->{callback} =
- "menu.pl?login=$form->{login}&password=$form->{password}&action=display";
- }
+ $form->{callback} = build_std_url("script=menu${menu_script}.pl", 'action=display');
- $form->redirect;
+ $form->redirect();
$lxdebug->leave_sub();
}
$lxdebug->enter_sub();
require "$userspath/$form->{login}.conf";
- $locale = new Locale $myconfig{countrycode}, "login"
- unless ($language eq $myconfig{countrycode});
- $myconfig{address} =~ s/\\n/<br>/g;
- $myconfig{dbhost} = $locale->text('localhost') unless $myconfig{dbhost};
+ $locale = new Locale $myconfig{countrycode}, "login" if ($language ne $myconfig{countrycode});
- $form->{stylesheet} = $myconfig{stylesheet};
-
- $form->{title} = $locale->text('About');
+ $form->{stylesheet} = $myconfig{stylesheet};
+ $form->{title} = $locale->text('About');
# create the logo screen
- $form->header unless $form->{noheader};
-
- print qq|
-<body>
-<center>
-<a href="http://www.lx-office.org" target=_top><img src="image/lx-office-erp.png" border=0></a>
-<h2 class=login>| . $locale->text('Version') . qq| $form->{version}</h2>
-
-| . $locale->text('Licensed to') . qq|
-<p>
-<b>
-$myconfig{company}
-<br>$myconfig{address}
-</b>
-
-
-<br>
-<table border=0>
- <tr>
- <th align=left>| . $locale->text('User') . qq|</th>
- <td>$myconfig{name}</td>
- </tr>
- <tr>
- <th align=left>| . $locale->text('Dataset') . qq|</th>
- <td>$myconfig{dbname}</td>
- </tr>
- <tr>
- <th align=left>| . $locale->text('Database Host') . qq|</th>
- <td>$myconfig{dbhost}</td>
- </tr>
- <tr>
- </tr>
- <tr>
- </tr>
- <tr>
- <th colspan="2" align="center"><a href="http://lx-office.org" target="blank">http://lx-office.org</a></th>
- </tr>
- <tr>
- <th colspan="2" align="center"><a href="mailto:info@lx-office.org" target="blank">info@lx-office.org</a></th>
- </tr>
-</table>
-
-</center>
-
-</body>
-</html>
-|;
+ $form->header() unless $form->{noheader};
+
+ print $form->parse_html_template('login/company_logo');
$lxdebug->leave_sub();
}
'list_of_payments' => 'zahlungsausgaenge',
'list_of_receipts' => 'zahlungseingaenge',
'list_of_transactions' => 'buchungsliste',
- 'localhost' => 'lokaler Rechner',
'logout' => 'abmelden',
'mark as paid' => 'als bezahlt markieren',
'month' => 'Monatliche Abgabe',
'Customer details' => 'Kundendetails',
'DELETED' => 'Gelöscht',
'DUNNING STARTED' => 'Mahnprozess gestartet',
- 'Database Host' => 'Datenbankcomputer',
- 'Dataset' => 'Datenbank',
'Dataset upgrade' => 'Datenbankaktualisierung',
'Date' => 'Datum',
'Dependency loop detected:' => 'Schleife in den Abhängigkeiten entdeckt:',
'History' => 'Historie',
'Incorrect username or password!' => 'Ungültiger Benutzername oder falsches Passwort!',
'Invoice' => 'Rechnung',
- 'Licensed to' => 'Lizensiert für',
- 'Login' => 'Anmeldung',
- 'Login Name' => 'Benutzername',
'MAILED' => 'Gesendet',
'Mark as paid?' => 'Als bezahlt markieren?',
'Marked as paid' => 'Als bezahlt markiert',
'Packing List' => 'Lieferschein',
'Part Number' => 'Artikelnummer',
'Part description' => 'Artikelbeschreibung',
- 'Password' => 'Passwort',
'Pick List' => 'Sammelliste',
'Please enter values' => 'Bitte Werte eingeben',
'Proforma Invoice' => 'Proformarechnung',
'Trying to call a sub without a name' => 'Es wurde versucht, eine Unterfunktion ohne Namen aufzurufen.',
'Unit' => 'Einheit',
'Unknown dependency \'%s\'.' => 'Unbekannte Abhängigkeit \'%s\'.',
- 'User' => 'Benutzer',
'Value' => 'Wert',
'Variable' => 'Variable',
'Vendor details' => 'Lieferantendetails',
'[email]' => '[email]',
'bin_list' => 'Lagerliste',
'invoice' => 'Rechnung',
- 'localhost' => 'lokaler Rechner',
'no' => 'nein',
'packing_list' => 'Versandliste',
'pick_list' => 'Entnahmeliste',
--- /dev/null
+[% USE HTML %][% USE LxERP %]<body>
+ [%- DEFAULT myconfig_dbhost = 'localhost' %]
+
+ <center>
+ <a href="http://www.lx-office.org" target="_top"><img src="image/lx-office-erp.png" border="0"></a>
+
+ <h2 class="login">Version [% version %]</h2>
+
+ <p>Lizensiert für</p>
+
+ <p>
+ <b>
+ [% HTML.escape(myconfig_company) %]
+ <br>
+ [% HTML.escape(myconfig_address).replace('\\\\n', '<br>') %]
+ </b>
+
+ <br>
+
+ <table border="0">
+ <tr>
+ <th align="left">Benutzer</th>
+ <td>[% HTML.escape(myconfig_name) %]</td>
+ </tr>
+ <tr>
+ <th align="left">Datenbank</th>
+ <td>[% HTML.escape(myconfig_dbname) %]</td>
+ </tr>
+ <tr>
+ <th align="left">Datenbankcomputer</th>
+ <td>[% HTML.escape(myconfig_dbhost) %]</td>
+ </tr>
+ <tr>
+ </tr>
+ <tr>
+ </tr>
+ <tr>
+ <th colspan="2" align="center"><a href="http://lx-office.org" target="blank">http://lx-office.org</a></th>
+ </tr>
+ <tr>
+ <th colspan="2" align="center"><a href="mailto:info@lx-office.org" target="blank">info@lx-office.org</a></th>
+ </tr>
+ </table>
+
+ </center>
+
+</body>
+</html>
--- /dev/null
+[% USE HTML %][% USE LxERP %]<body>
+ [%- DEFAULT myconfig_dbhost = 'localhost' %]
+
+ <center>
+ <a href="http://www.lx-office.org" target="_top"><img src="image/lx-office-erp.png" border="0"></a>
+
+ <h2 class="login"><translate>Version</translate> [% version %]</h2>
+
+ <p><translate>Licensed to</translate></p>
+
+ <p>
+ <b>
+ [% HTML.escape(myconfig_company) %]
+ <br>
+ [% HTML.escape(myconfig_address).replace('\\\\n', '<br>') %]
+ </b>
+
+ <br>
+
+ <table border="0">
+ <tr>
+ <th align="left"><translate>User</translate></th>
+ <td>[% HTML.escape(myconfig_name) %]</td>
+ </tr>
+ <tr>
+ <th align="left"><translate>Dataset</translate></th>
+ <td>[% HTML.escape(myconfig_dbname) %]</td>
+ </tr>
+ <tr>
+ <th align="left"><translate>Database Host</translate></th>
+ <td>[% HTML.escape(myconfig_dbhost) %]</td>
+ </tr>
+ <tr>
+ </tr>
+ <tr>
+ </tr>
+ <tr>
+ <th colspan="2" align="center"><a href="http://lx-office.org" target="blank">http://lx-office.org</a></th>
+ </tr>
+ <tr>
+ <th colspan="2" align="center"><a href="mailto:info@lx-office.org" target="blank">info@lx-office.org</a></th>
+ </tr>
+ </table>
+
+ </center>
+
+</body>
+</html>
--- /dev/null
+[% USE HTML %]<body class="login" onLoad="fokus()">
+
+ <center>
+ <table class="login" border="3" cellpadding="20">
+ <tr>
+ <td class="login" align="center">
+ <a href="http://www.lx-office.org" target="_top"><img src="image/lx-office-erp.png" border="0"></a>
+ <h1 class="login" align="center">Version [% version %]</h1>
+
+ <p>
+
+ <form method="post" name="loginscreen" action="login.pl">
+
+ <input type="hidden" name="show_dbupdate_warning" value="1">
+
+ <table width="100%">
+ <tr>
+ <td align="center">
+ <table>
+ <tr>
+ <th align="right">Benutzername</th>
+ <td><input class="login" name="login" size="30" tabindex="1"></td>
+ </tr>
+ <tr>
+ <th align="right">Passwort</th>
+ <td><input class="login" type="password" name="password" size="30" tabindex="2"></td>
+ </tr>
+ </table>
+
+ <br>
+ <input type="submit" name="action" value="Anmeldung" tabindex="3">
+
+ </td>
+ </tr>
+ </table>
+
+ </form>
+
+ </td>
+ </tr>
+ </table>
+
+</body>
+</html>
--- /dev/null
+[% USE HTML %]<body class="login" onLoad="fokus()">
+
+ <center>
+ <table class="login" border="3" cellpadding="20">
+ <tr>
+ <td class="login" align="center">
+ <a href="http://www.lx-office.org" target="_top"><img src="image/lx-office-erp.png" border="0"></a>
+ <h1 class="login" align="center"><translate>Version</translate> [% version %]</h1>
+
+ <p>
+
+ <form method="post" name="loginscreen" action="login.pl">
+
+ <input type="hidden" name="show_dbupdate_warning" value="1">
+
+ <table width="100%">
+ <tr>
+ <td align="center">
+ <table>
+ <tr>
+ <th align="right"><translate>Login Name</translate></th>
+ <td><input class="login" name="login" size="30" tabindex="1"></td>
+ </tr>
+ <tr>
+ <th align="right"><translate>Password</translate></th>
+ <td><input class="login" type="password" name="password" size="30" tabindex="2"></td>
+ </tr>
+ </table>
+
+ <br>
+ <input type="submit" name="action" value="<translate>Login</translate>" tabindex="3">
+
+ </td>
+ </tr>
+ </table>
+
+ </form>
+
+ </td>
+ </tr>
+ </table>
+
+</body>
+</html>