- if (-e "$userspath/nologin") {
- $nologin = qq|
-<input type=submit class=submit name=action value="|
- . $locale->text('Unlock System') . qq|">|;
- }
-
- while (<FH>) {
- chop;
-
- if (/^\[.*\]/) {
- $login = $_;
- $login =~ s/(\[|\])//g;
- }
-
- if (/^(name=|company=|templates=|dbuser=|dbdriver=|dbname=|dbhost=)/) {
- chop($var = $&);
- ($null, $member{$login}{$var}) = split /=/, $_, 2;
- }
- }
-
- close(FH);
-
- # type=submit $locale->text('Pg Database Administration')
- # type=submit $locale->text('Oracle Database Administration')
-
- foreach $item (User->dbdrivers) {
- $dbdrivers .=
- qq|<input name=action type=submit class=submit value="|
- . $locale->text("$item Database Administration") . qq|">|;
- }
-
- $column_header{login} = qq|<th>| . $locale->text('Login') . qq|</th>|;
- $column_header{name} = qq|<th>| . $locale->text('Name') . qq|</th>|;
- $column_header{company} = qq|<th>| . $locale->text('Company') . qq|</th>|;
- $column_header{dbdriver} = qq|<th>| . $locale->text('Driver') . qq|</th>|;
- $column_header{dbhost} = qq|<th>| . $locale->text('Host') . qq|</th>|;
- $column_header{dataset} = qq|<th>| . $locale->text('Dataset') . qq|</th>|;
- $column_header{templates} =
- qq|<th>| . $locale->text('Templates') . qq|</th>|;
-
- @column_index = qw(login name company dbdriver dbhost dataset templates);
-
- $form->{title} = "Lx-Office ERP " . $locale->text('Administration');
-
- $form->header;
-
- print qq|
-<body class=admin>
-
-<form method=post action=$form->{script}>
-
-<table width=100%>
- <tr>
- <tr class=listheading>
- <th>$form->{title}</th>
- </tr>
- <tr size=5></tr>
- <tr>
- <td>
- <table width=100%>
- <tr class=listheading>|;
-
- map { print "$column_header{$_}\n" } @column_index;
-
- print qq|
- </tr>
-|;
-
- foreach $key (sort keys %member) {
- $href =
- "$script?action=edit&login=$key&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}";
- $href =~ s/ /%20/g;
-
- $member{$key}{templates} =~ s/^$templates\///;
- $member{$key}{dbhost} = $locale->text('localhost')
- unless $member{$key}{dbhost};
- $member{$key}{dbname} = $member{$key}{dbuser}
- if ($member{$key}{dbdriver} eq 'Oracle');
-
- $column_data{login} = qq|<td><a href=$href>$key</a></td>|;
- $column_data{name} = qq|<td>$member{$key}{name}</td>|;
- $column_data{company} = qq|<td>$member{$key}{company}</td>|;
- $column_data{dbdriver} = qq|<td>$member{$key}{dbdriver}</td>|;
- $column_data{dbhost} = qq|<td>$member{$key}{dbhost}</td>|;
- $column_data{dataset} = qq|<td>$member{$key}{dbname}</td>|;
- $column_data{templates} = qq|<td>$member{$key}{templates}</td>|;
-
- $i++;
- $i %= 2;
- print qq|
- <tr class=listrow$i>|;
-
- map { print "$column_data{$_}\n" } @column_index;
-
- print qq|
- </tr>|;
- }
-
- print qq|
- </table>
- </td>
- </tr>
- <tr>
- <td><hr size=3 noshade></td>
- </tr>
-</table>
-
-<input type=hidden name=path value=$form->{path}>
-<input type=hidden name=rpw value=$form->{rpw}>
-<input type=hidden name=root value="$form->{root}">
-
-<br><input type=submit class=submit name=action value="|
- . $locale->text('Add User') . qq|">
-<input type=submit class=submit name=action value="|
- . $locale->text('Change Admin Password') . qq|">
-
-$dbdrivers
-$nologin
-
-</form>
-
-| . $locale->text('Click on login name to edit!') . qq|
-<br>
-|
- . $locale->text('To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.')
- . qq|
-
-<p>
-
-<form method=post action=login.pl>
-
-<table border=0 width=100%>
- <tr class=listheading>
- <th>Lx-Office ERP | . $locale->text('Login') . qq|</th>
- </tr>
- <tr>
- <td>
- <table>
- <tr>
- <th align=right>| . $locale->text('Name') . qq|</th>
- <td><input class=login name=login></td>
- <td> </td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Password') . qq|</th>
- <td><input class=login type=password name=password></td>
- <td><input type=submit name=action value="|
- . $locale->text('Login')
- . qq|"></td>
- </tr>
-<input type=hidden name=path value=$form->{path}>
- </table>
- </td>
- </tr>
-</table>
-
-</form>
-
-<hr size=3 noshade>
-
-</body>
-</html>
-|;
-
-}
-
-sub form_header {
-
- # if there is a login, get user
- if ($form->{login}) {
-
- # get user
- $myconfig = new User "$memberfile", "$form->{login}";
-
- $myconfig->{signature} =~ s/\\n/\r\n/g;
- $myconfig->{address} =~ s/\\n/\r\n/g;
-
- # strip basedir from templates directory
- $myconfig->{templates} =~ s/^$templates\///;
-
- # $myconfig->{dbpasswd} = unpack 'u', $myconfig->{dbpasswd};
- }
-
- foreach $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) {
- $dateformat .=
- ($item eq $myconfig->{dateformat})
- ? "<option selected>$item\n"
- : "<option>$item\n";
- }
-
- foreach $item (qw(1,000.00 1000.00 1.000,00 1000,00)) {
- $numberformat .=
- ($item eq $myconfig->{numberformat})
- ? "<option selected>$item\n"
- : "<option>$item\n";
- }