Recommit von r1166 von udo_spallek: Bug in verstecktem Feld: <input type=hidden name...
[kivitendo-erp.git] / bin / mozilla / admin.pl
index 0829934..1187125 100644 (file)
@@ -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') {
@@ -123,7 +125,6 @@ sub adminlogin {
     . $locale->text('Login') . qq|"></td>
   </tr>
 <input type=hidden name=action value=login>
-<input type=hidden name=root value="root login">
 <input type=hidden name=path value=$form->{path}>
 </table>
 
@@ -163,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;
 
@@ -192,8 +197,7 @@ sub form_footer {
 
   print qq|
 
-<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}">
-<input type=hidden name=root value="$form->{root}">
+<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&rpw=$form->{rpw}">
 <input type=hidden name=path value=$form->{path}>
 <input type=hidden name=rpw value=$form->{rpw}>
 
@@ -289,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\///;
@@ -328,7 +332,6 @@ sub list_users {
 
 <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|">
@@ -441,7 +444,8 @@ sub form_header {
   closedir TEMPLATEDIR;
 
   @allhtml = sort grep /\.html/, @all;
-  @alldir = grep !/\.(html|tex)$/, @all;
+  @alldir = grep !/\.(html|tex|sty|odt)$/, @all;
+  @alldir = grep !/^(webpages|\.svn)$/, @alldir;
 
   @allhtml = reverse grep !/Default/, @allhtml;
   push @allhtml, 'Default';
@@ -462,7 +466,8 @@ sub form_header {
     $item =~ s/-.*//g;
 
     if ($item ne $lastitem) {
-      $mastertemplates .= qq|<option>$item\n|;
+      my $selected = $item eq "German" ? " selected" : "";
+      $mastertemplates .= qq|<option$selected>$item\n|;
       $lastitem = $item;
     }
   }
@@ -539,7 +544,7 @@ sub form_header {
        </tr>
         <tr valign=top>
          <th align=right>| . $locale->text('Ust-IDNr') . qq|</th>
-         <td><input name=ustid size=14 value="$myconfig->{ustid}"></td>
+         <td><input name=co_ustid size=14 value="$myconfig->{co_ustid}"></td>
        </tr>
         <tr valign=top>
          <th align=right>| . $locale->text('DUNS-Nr') . qq|</th>
@@ -964,7 +969,7 @@ sub save {
 
       # copy templates to the directory
       opendir TEMPLATEDIR, "$templates/." or $form - error("$templates : $!");
-      @templates = grep /$form->{mastertemplates}.*?\.(html|tex)$/,
+      @templates = grep /$form->{mastertemplates}.*?\.(html|tex|sty)$/,
         readdir TEMPLATEDIR;
       closedir TEMPLATEDIR;
 
@@ -1065,6 +1070,7 @@ sub delete {
     if (-d "$dir") {
       unlink <$dir/*.html>;
       unlink <$dir/*.tex>;
+      unlink <$dir/*.sty>;
       rmdir "$dir";
     }
   }
@@ -1119,7 +1125,6 @@ sub change_admin_password {
     . $locale->text('Password')
     . qq|</b> <input type=password name=password size=8>
 
-<input type=hidden name=root value="$form->{root}">
 <input type=hidden name=path value=$form->{path}>
 <input type=hidden name=rpw value=$form->{rpw}>
 
@@ -1143,20 +1148,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!'));
   }
 
 }
@@ -1267,8 +1269,7 @@ sub dbselect_source {
 </td></tr>
 </table>
 
-<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}">
-<input type=hidden name=root value="$form->{root}">
+<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&rpw=$form->{rpw}">
 <input type=hidden name=path value=$form->{path}>
 <input type=hidden name=rpw value=$form->{rpw}>
 
@@ -1363,9 +1364,8 @@ $upd
 
 <input name=dbupdate type=hidden value="$form->{dbupdate}">
 
-<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}">
+<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&rpw=$form->{rpw}">
 
-<input type=hidden name=root value="$form->{root}">
 <input type=hidden name=path value=$form->{path}>
 <input type=hidden name=rpw value=$form->{rpw}>
 
@@ -1496,9 +1496,8 @@ sub create_dataset {
 <input type=hidden name=dbpasswd value=$form->{dbpasswd}>
 <input type=hidden name=dbdefault value=$form->{dbdefault}>
 
-<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}">
+<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&rpw=$form->{rpw}">
 
-<input type=hidden name=root value="$form->{root}">
 <input type=hidden name=path value=$form->{path}>
 <input type=hidden name=rpw value=$form->{rpw}>
 
@@ -1550,7 +1549,6 @@ sub dbcreate {
 
     . qq|
 
-<input type=hidden name=root value="$form->{root}">
 <input type=hidden name=path value="$form->{path}">
 <input type=hidden name=rpw value="$form->{rpw}">
 
@@ -1614,9 +1612,8 @@ sub delete_dataset {
 <input type=hidden name=dbpasswd value=$form->{dbpasswd}>
 <input type=hidden name=dbdefault value=$form->{dbdefault}>
 
-<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}">
+<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&rpw=$form->{rpw}">
 
-<input type=hidden name=root value="$form->{root}">
 <input type=hidden name=path value="$form->{path}">
 <input type=hidden name=rpw value="$form->{rpw}">
 
@@ -1667,7 +1664,6 @@ $form->{db} | . $locale->text('successfully deleted!')
 
     . qq|
 
-<input type=hidden name=root value="$form->{root}">
 <input type=hidden name=path value="$form->{path}">
 <input type=hidden name=rpw value="$form->{rpw}">
 
@@ -1689,7 +1685,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!'));
 
@@ -1702,7 +1698,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!'));