fix bug noticed by ed long ago... STAFF_0_4
authorivan <ivan>
Wed, 10 Jul 2002 01:08:49 +0000 (01:08 +0000)
committerivan <ivan>
Wed, 10 Jul 2002 01:08:49 +0000 (01:08 +0000)
shift.cgi

index 295eda8..6738b82 100755 (executable)
--- a/shift.cgi
+++ b/shift.cgi
@@ -2,7 +2,7 @@
 #!/usr/bin/perl -Tw
 # (Text::Template can't do -T, but no user input is used dangerously)
 #
-# $Id: shift.cgi,v 1.4 2000-09-23 18:10:54 ivan Exp $
+# $Id: shift.cgi,v 1.5 2002-07-10 01:08:49 ivan Exp $
 #
 # Copyright (C) 2000 Adam Gould
 # Copyright (C) 2000 Michal Migurski
@@ -40,7 +40,7 @@ END
 use strict;
 use vars qw( $template_file $data_directory $mail_smtpserver $mail_from
              $mail_subject @mail_cc $mail_footer
-             $cgi $template %shifthash %warning @messages );
+             $cgi $template %shifthash %warning @messages $magic );
 use subs qw( form inputbox );
 use Fcntl ":flock";
 use CGI 2.15;
@@ -202,13 +202,15 @@ sub get_data {
 # subroutines for the template
 
 sub form {
- $cgi->start_form;
+ $magic = defined $cgi->param('__MAGIC') ? $cgi->param('__MAGIC') : '';
+ $cgi->delete_all();
+ $cgi->start_form();
 }
 
 sub inputbox {
   my $field = shift;
   return $shifthash{$field} || "&nbsp;"
-    if defined $cgi->param('__MAGIC') && $cgi->param('__MAGIC') eq 'print';
+    if $magic eq 'print';
   $shifthash{$field}='' unless defined $shifthash{$field};
   $warning{$field}='' unless defined $warning{$field};
   #"$field ".