X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fadmin.pl;h=8cd34c35e225207fb69048c50a9f63a8b63865d6;hb=ccd0b365250f57021a756203f65a4d153709b45d;hp=e478d6ba1f68e86c657c61b9711272ef8b7856c2;hpb=2d6988532a665bd7e42bb88a38a8b52cbb352646;p=kivitendo-erp.git
diff --git a/bin/mozilla/admin.pl b/bin/mozilla/admin.pl
index e478d6ba1..8cd34c35e 100644
--- a/bin/mozilla/admin.pl
+++ b/bin/mozilla/admin.pl
@@ -36,10 +36,19 @@ $menufile = "menu.ini";
use DBI;
use CGI;
+use POSIX qw(strftime);
+use IO::File;
+use Fcntl;
+use English qw(-no_match_vars);
+use Sys::Hostname;
use SL::Form;
+use SL::Mailer;
use SL::User;
use SL::Common;
+use SL::Inifile;
+use SL::DBUpgrade2;
+use SL::DBUtils;
require "bin/mozilla/common.pl";
@@ -70,7 +79,7 @@ if ($form->{action}) {
}
}
- &check_password;
+ check_password();
call_sub($subroutine);
@@ -82,7 +91,7 @@ if ($form->{action}) {
# create memberfile
if (!-f $memberfile) {
- open(FH, ">$memberfile") or $form->error("$memberfile : $!");
+ open(FH, ">$memberfile") or $form->error("$memberfile : $ERRNO");
print FH qq|# SQL-Ledger Accounting members
[root login]
@@ -92,7 +101,7 @@ password=
close FH;
}
- &adminlogin;
+ adminlogin();
}
@@ -106,7 +115,7 @@ sub adminlogin {
qq|Lx-Office ERP $form->{version} | . $locale->text('Administration');
$form->header();
- print $form->parse_html_template('admin/adminlogin');
+ print $form->parse_html_template2('admin/adminlogin');
}
sub login {
@@ -117,7 +126,7 @@ sub list_users {
$form->error($locale->text('File locked!')) if (-f "${memberfile}.LCK");
- open(FH, "$memberfile") or $form->error("$memberfile : $!");
+ open(FH, "$memberfile") or $form->error("$memberfile : $ERRNO");
my %members;
@@ -146,7 +155,7 @@ sub list_users {
$form->{MEMBERS} = [ @members{sort { lc $a cmp lc $b } keys %members} ];
$form->header();
- print $form->parse_html_template("admin/list_users");
+ print $form->parse_html_template2("admin/list_users");
}
sub add_user {
@@ -156,22 +165,16 @@ sub add_user {
. $locale->text('Administration') . " / "
. $locale->text('Add User');
- $form->{Oracle_sid} = $sid;
- $form->{Oracle_dbport} = '1521';
- $form->{Oracle_dbhost} = `hostname`;
-
- if (-f "css/lx-office-erp.css") {
- $myconfig->{stylesheet} = "lx-office-erp.css";
- }
-
- $myconfig->{vclimit} = 200;
- $myconfig->{countrycode} = "de";
- $myconfig->{numberformat} = "1000,00";
- $myconfig->{dateformat} = "dd.mm.yy";
-
- &form_header;
- &form_footer;
+ my $myconfig = {
+ "vclimit" => 200,
+ "countrycode" => "de",
+ "numberformat" => "1000,00",
+ "dateformat" => "dd.mm.yy",
+ "stylesheet" => "lx-office-erp.css",
+ "menustyle" => "v3",
+ };
+ edit_user_form($myconfig);
}
sub edit {
@@ -182,91 +185,46 @@ sub edit {
. $locale->text('Edit User');
$form->{edit} = 1;
- &form_header;
- &form_footer;
-
-}
-
-sub form_footer {
-
- if ($form->{edit}) {
- $delete =
- qq|
-|;
- }
-
- print qq|
+ $form->isblank("login", $locale->text("The login is missing."));
-
-{rpw}>
+ # get user
+ my $myconfig = new User "$memberfile", "$form->{login}";
-
-$delete
+ $myconfig->{signature} =~ s/\\n/\r\n/g;
+ $myconfig->{address} =~ s/\\n/\r\n/g;
-
-
-