X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fadmin.pl;h=37ac193c21a66cbdead668df258b67770c807df4;hb=6a9ef5df5fb7f1ce451e8d492e3b2b3291eb55a3;hp=e478d6ba1f68e86c657c61b9711272ef8b7856c2;hpb=2d6988532a665bd7e42bb88a38a8b52cbb352646;p=kivitendo-erp.git diff --git a/bin/mozilla/admin.pl b/bin/mozilla/admin.pl index e478d6ba1..37ac193c2 100644 --- a/bin/mozilla/admin.pl +++ b/bin/mozilla/admin.pl @@ -40,6 +40,7 @@ use CGI; use SL::Form; use SL::User; use SL::Common; +use SL::Inifile; require "bin/mozilla/common.pl"; @@ -70,7 +71,7 @@ if ($form->{action}) { } } - &check_password; + check_password(); call_sub($subroutine); @@ -92,7 +93,7 @@ password= close FH; } - &adminlogin; + adminlogin(); } @@ -156,22 +157,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 +177,46 @@ sub edit { . $locale->text('Edit User'); $form->{edit} = 1; - &form_header; - &form_footer; + $form->isblank("login", $locale->text("The login is missing.")); -} - -sub form_footer { + # get user + my $myconfig = new User "$memberfile", "$form->{login}"; - if ($form->{edit}) { - $delete = - qq| -|; - } + $myconfig->{signature} =~ s/\\n/\r\n/g; + $myconfig->{address} =~ s/\\n/\r\n/g; - print qq| - - -{rpw}> - - -$delete - - - - - -|; + # strip basedir from templates directory + $myconfig->{templates} =~ s|.*/||; + edit_user_form($myconfig); } -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}; - } +sub edit_user_form { + my ($myconfig) = @_; - 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}) - ? "