X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fadmin.pl;h=c2db1384dc5f9ec0c0504d03c53c0d63cb2ddb9c;hb=eaa48aeab931d62b1a14bba95537480758695655;hp=c1fbb7c6c2968ff0c12607294494a04161390340;hpb=9a22f14c16b2ba3ee47bc2ea0c97078260e3c167;p=kivitendo-erp.git diff --git a/bin/mozilla/admin.pl b/bin/mozilla/admin.pl index c1fbb7c6c..c2db1384d 100644 --- a/bin/mozilla/admin.pl +++ b/bin/mozilla/admin.pl @@ -38,6 +38,7 @@ use SL::Form; use SL::User; $form = new Form; +$form->{"root"} = "root login"; $locale = new Locale $language, "admin"; @@ -55,6 +56,7 @@ $form->{favicon} = "favicon.ico"; if ($form->{action}) { + $subroutine = $locale->findsub($form->{action}); if ($subroutine eq 'login') { @@ -120,11 +122,9 @@ sub adminlogin { | . $locale->text('Password') . qq| + . $locale->text('Login') . qq|"> - {path}> @@ -164,6 +164,10 @@ sub add_user { } $myconfig->{vclimit} = 200; + $myconfig->{"countrycode"} = "de"; + $myconfig->{"numberformat"} = "1000,00"; + $myconfig->{"dateformat"} = "dd.mm.yy"; + &form_header; &form_footer; @@ -193,8 +197,7 @@ sub form_footer { print qq| - - + {path}> {rpw}> @@ -236,7 +239,7 @@ sub list_users { if (/^(name=|company=|templates=|dbuser=|dbdriver=|dbname=|dbhost=)/) { chop($var = $&); - ($null, $member{$login}{$var}) = split /=/, $_, 2; + ($null, $member{$login}{$var}) = split(/=/, $_, 2); } } @@ -290,7 +293,7 @@ sub list_users { foreach $key (sort keys %member) { $href = - "$script?action=edit&login=$key&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}"; + "$script?action=edit&login=$key&path=$form->{path}&rpw=$form->{rpw}"; $href =~ s/ /%20/g; $member{$key}{templates} =~ s/^$templates\///; @@ -299,7 +302,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 +313,7 @@ sub list_users { $i++; $i %= 2; print qq| - |; + |; map { print "$column_data{$_}\n" } @column_index; @@ -329,7 +332,6 @@ sub list_users { {path}> {rpw}> -
@@ -344,7 +346,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,8 +371,7 @@ $nologin | . $locale->text('Password') . qq| + . $locale->text('Login') . qq|"> {path}> @@ -420,7 +423,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 +1159,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 +1184,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&path=$form->{path}&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 +1240,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 +1287,9 @@ sub dbselect_source { | . $locale->text('User') . qq| - {dbuser}> + | . $locale->text('Password') . qq| - + @@ -1255,18 +1305,18 @@ sub dbselect_source { - - + {path}> {rpw}>
- -|; +# Vorübergehend Deaktiviert +# +print qq|

@@ -1275,7 +1325,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}} @@ -1311,11 +1363,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 +1380,12 @@ sub update_dataset { {script}> -{dbdriver}> -{dbhost}> -{dbport}> -{dbuser}> -{dbpasswd}> -{dbdefault}> + + + + + + @@ -1349,9 +1402,8 @@ $upd - + -{path}> {rpw}> @@ -1383,10 +1435,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 +1468,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, @@ -1406,21 +1477,22 @@ 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('Create Chart of Accounts') - . qq| @charts

-{dbdriver}> -{dbuser}> -{dbhost}> -{dbport}> -{dbpasswd}> -{dbdefault}> + + + + + + - + - {path}> {rpw}> @@ -1537,7 +1607,6 @@ sub dbcreate { . qq| - @@ -1594,16 +1663,15 @@ sub delete_dataset {

-{dbdriver}> -{dbuser}> -{dbhost}> -{dbport}> -{dbpasswd}> -{dbdefault}> + + + + + + - + - @@ -1654,7 +1722,6 @@ $form->{db} | . $locale->text('successfully deleted!') . qq| - @@ -1676,7 +1743,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&path=$form->{path}&rpw=$root->{password}"; $form->redirect($locale->text('Lockfile removed!')); @@ -1689,7 +1756,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&path=$form->{path}&rpw=$root->{password}"; $form->redirect($locale->text('Lockfile created!'));