X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fadmin.pl;h=4e33ef200c80fedbd94c2434962d5c38103f5007;hb=8482e69b2e36af353705a84e4465668f7431dddf;hp=c1fbb7c6c2968ff0c12607294494a04161390340;hpb=0d9ac875bf41d614388e6cf3864806de4c04c0e9;p=kivitendo-erp.git diff --git a/bin/mozilla/admin.pl b/bin/mozilla/admin.pl index c1fbb7c6c..4e33ef200 100644 --- a/bin/mozilla/admin.pl +++ b/bin/mozilla/admin.pl @@ -34,19 +34,25 @@ $menufile = "menu.ini"; +use DBI; +use CGI; + use SL::Form; use SL::User; +use SL::Common; + +require "bin/mozilla/common.pl"; + +our $cgi = new CGI(''); $form = new Form; +$form->{"root"} = "root login"; $locale = new Locale $language, "admin"; -eval { require DBI; }; -$form->error($locale->text('DBI not installed!')) if ($@); - # customization -if (-f "$form->{path}/custom_$form->{script}") { - eval { require "$form->{path}/custom_$form->{script}"; }; +if (-f "bin/mozilla/custom_$form->{script}") { + eval { require "bin/mozilla/custom_$form->{script}"; }; $form->error($@) if ($@); } @@ -55,6 +61,7 @@ $form->{favicon} = "favicon.ico"; if ($form->{action}) { + $subroutine = $locale->findsub($form->{action}); if ($subroutine eq 'login') { @@ -65,7 +72,7 @@ if ($form->{action}) { &check_password; - &$subroutine; + call_sub($subroutine); } else { @@ -120,12 +127,9 @@ sub adminlogin { | . $locale->text('Password') . qq| + . $locale->text('Login') . qq|"> - -{path}> @@ -164,6 +168,10 @@ sub add_user { } $myconfig->{vclimit} = 200; + $myconfig->{"countrycode"} = "de"; + $myconfig->{"numberformat"} = "1000,00"; + $myconfig->{"dateformat"} = "dd.mm.yy"; + &form_header; &form_footer; @@ -193,9 +201,7 @@ sub form_footer { print qq| - - -{path}> + {rpw}> {path}&root=$form->{root}&rpw=$form->{rpw}"; + "$script?action=edit&login=$key&rpw=$form->{rpw}"; $href =~ s/ /%20/g; $member{$key}{templates} =~ s/^$templates\///; @@ -299,7 +305,7 @@ sub list_users { $member{$key}{dbname} = $member{$key}{dbuser} if ($member{$key}{dbdriver} eq 'Oracle'); - $column_data{login} = qq|$key|; + $column_data{login} = qq|$key|; $column_data{name} = qq|$member{$key}{name}|; $column_data{company} = qq|$member{$key}{company}|; $column_data{dbdriver} = qq|$member{$key}{dbdriver}|; @@ -310,7 +316,7 @@ sub list_users { $i++; $i %= 2; print qq| - |; + |; map { print "$column_data{$_}\n" } @column_index; @@ -327,9 +333,7 @@ sub list_users { -{path}> {rpw}> -
@@ -344,7 +348,9 @@ $nologin | . $locale->text('Click on login name to edit!') . qq|
| - . $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.') + . $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|

@@ -367,10 +373,8 @@ $nologin | . $locale->text('Password') . qq| + . $locale->text('Login') . qq|"> -{path}> @@ -420,7 +424,8 @@ sub form_header { %countrycodes = User->country_codes; $countrycodes = ""; foreach $key (sort { $countrycodes{$a} cmp $countrycodes{$b} } - keys %countrycodes) { + keys %countrycodes + ) { $countrycodes .= ($myconfig->{countrycode} eq $key) ? "

{script}> -| - . $locale->text('Password') - . qq| + + + + + + + + + +
| . $locale->text('Password') . qq|
| . $locale->text('Repeat the password') . qq|
- -{path}> {rpw}>

@@ -1127,6 +1157,24 @@ sub change_admin_password { } sub change_password { + if ($form->{"password"} ne $form->{"password_again"}) { + $form->{title} = + qq|Lx-Office ERP | + . $locale->text('Administration') . " / " + . $locale->text('Change Admin Password'); + + $form->header; + + print qq| + + + +

| . $locale->text('Change Admin Password') . qq|

+ +

| . $locale->text("The passwords do not match.") . qq|
+|; + return; + } $root->{password} = $form->{password}; @@ -1134,20 +1182,17 @@ sub change_password { $root->save_member($memberfile); $form->{callback} = - "$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$root->{password}"; + "$form->{script}?action=list_users&rpw=$root->{password}"; $form->redirect($locale->text('Password changed!')); } sub check_password { - $root = new User "$memberfile", $form->{root}; - if ($root->{password}) { - if ($root->{password} ne $form->{rpw}) { - $form->error($locale->text('Incorrect Password!')); - } + if (!defined($root->{password}) || ($root->{password} ne $form->{rpw})) { + $form->error($locale->text('Incorrect Password!')); } } @@ -1193,9 +1238,12 @@ sub dbselect_source { &dbdriver_defaults; $msg{Pg} = - $locale->text('Leave host and port field empty unless you want to make a remote connection.'); + $locale->text( + 'Leave host and port field empty unless you want to make a remote connection.' + ); $msg{Oracle} = - $locale->text('You must enter a host and port for local and remote connections!'); + $locale->text( + 'You must enter a host and port for local and remote connections!'); $form->{title} = "Lx-Office ERP / " . $locale->text('Database Administration'); @@ -1237,9 +1285,9 @@ sub dbselect_source { | . $locale->text('User') . qq| - {dbuser}> + | . $locale->text('Password') . qq| - + @@ -1255,18 +1303,17 @@ sub dbselect_source { - - -{path}> + {rpw}>
- -|; +# Vorübergehend Deaktiviert +# +print qq|

@@ -1275,7 +1322,9 @@ sub dbselect_source {

| - . $locale->text('This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!') + . $locale->text( + 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' + ) . qq|
$msg{$form->{dbdriver}} @@ -1288,9 +1337,7 @@ sub dbselect_source { } sub continue { - - &{ $form->{nextsub} }; - + call_sub($form->{"nextsub"}); } sub update_dataset { @@ -1311,11 +1358,12 @@ sub update_dataset {

$form->{title}

|; - + my $field_id = 0; foreach $key (sort keys %needsupdate) { if ($needsupdate{$key} ne $form->{dbversion}) { - $upd .= qq| $key\n|; + $upd .= qq| $key\n|; $form->{dbupdate} .= "db$key "; + $field_id++; } } @@ -1327,12 +1375,12 @@ sub update_dataset { {script}> -{dbdriver}> -{dbhost}> -{dbport}> -{dbuser}> -{dbpasswd}> -{dbdefault}> + + + + + + @@ -1349,10 +1397,8 @@ $upd - + - -{path}> {rpw}> @@ -1383,10 +1429,29 @@ $upd } sub dbupdate { + $form->{"stylesheet"} = "lx-office-erp.css"; + $form->{"title"} = $main::locale->text("Dataset upgrade"); + $form->header(); + my $dbname = + join(" ", + map({ s/\s//g; s/^db//; $_; } + grep({ $form->{$_} } + split(/\s+/, $form->{"dbupdate"})))); + print($form->parse_html_template("dbupgrade/header", + { "dbname" => $dbname })); User->dbupdate(\%$form); - $form->redirect($locale->text('Dataset updated!')); + print qq| +
+ +| . $locale->text('Dataset updated!') . qq| + +
+ +| . $locale->text("Continue") . qq||; } @@ -1397,7 +1462,7 @@ sub create_dataset { } opendir SQLDIR, "sql/." or $form - error($!); - foreach $item (sort grep /-chart\.sql/, readdir SQLDIR) { + foreach $item (sort grep /-chart\.sql\z/, readdir SQLDIR) { next if ($item eq 'Default-chart.sql'); $item =~ s/-chart\.sql//; push @charts, @@ -1405,23 +1470,24 @@ sub create_dataset { } closedir SQLDIR; - $selectencoding = qq| - + + . $locale->text('Create Chart of Accounts') . qq|
| . $locale->text('The following Datasets need to be updated') . qq|
| . $locale->text('Multibyte Encoding') . qq|$selectencoding
| - . $locale->text('Create Chart of Accounts') - . qq| @charts

-{dbdriver}> -{dbuser}> -{dbhost}> -{dbport}> -{dbpasswd}> -{dbdefault}> + + + + + + - + - -{path}> {rpw}> @@ -1537,8 +1600,6 @@ sub dbcreate { . qq| - - @@ -1594,17 +1655,15 @@ sub delete_dataset {

-{dbdriver}> -{dbuser}> -{dbhost}> -{dbport}> -{dbpasswd}> -{dbdefault}> + + + + + + - + - - @@ -1654,8 +1713,6 @@ $form->{db} | . $locale->text('successfully deleted!') . qq| - - @@ -1676,7 +1733,7 @@ sub unlock_system { unlink "$userspath/nologin"; $form->{callback} = - "$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$root->{password}"; + "$form->{script}?action=list_users&rpw=$root->{password}"; $form->redirect($locale->text('Lockfile removed!')); @@ -1689,7 +1746,7 @@ sub lock_system { close(FH); $form->{callback} = - "$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$root->{password}"; + "$form->{script}?action=list_users&rpw=$root->{password}"; $form->redirect($locale->text('Lockfile created!'));