]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/outgoingfw.cgi
This fixes Bug #0000642 - clearer description for p2p-block buttons on outgoing firew...
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / outgoingfw.cgi
index f3cf581a6a06aae27b9b817bd264e0e7b3a3f7f5..6e27262abec66da356a5d240a44c14eac10e146e 100644 (file)
@@ -2,7 +2,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2009  Michael Tremer & Christian Schmidt                      #
+# Copyright (C) 2005-2010  IPTifre Team                                       #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
@@ -21,8 +21,8 @@
 
 use strict;
 # enable only the following on debugging purpose
-use warnings;
-use CGI::Carp 'fatalsToBrowser';
+#use warnings;
+#use CGI::Carp 'fatalsToBrowser';
 
 require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
@@ -41,6 +41,7 @@ my @p2ps = ();
 my @p2pline = ();
 
 my $configfile = "/var/ipfire/outgoing/rules";
+my $configpath = "/var/ipfire/outgoing/groups/";
 my $p2pfile = "/var/ipfire/outgoing/p2protocols";
 my $servicefile = "/var/ipfire/outgoing/defaultservices";
 
@@ -79,6 +80,19 @@ $outfwsettings{'TIME_TO'} = '00:00';
 &General::readhash("${General::swroot}/outgoing/settings", \%outfwsettings);
 &Header::getcgihash(\%outfwsettings);
 
+###############
+# DEBUG DEBUG
+#&Header::openbox('100%', 'left', 'DEBUG');
+#my $debugCount = 0;
+#foreach my $line (sort keys %outfwsettings) {
+#print "$line = $outfwsettings{$line}<br />\n";
+# $debugCount++;
+#}
+#print "&nbsp;Count: $debugCount\n";
+#&Header::closebox();
+# DEBUG DEBUG
+###############
+
 $selected{'TIME_FROM'}{$outfwsettings{'TIME_FROM'}} = "selected='selected'";
 $selected{'TIME_TO'}{$outfwsettings{'TIME_TO'}} = "selected='selected'";
 
@@ -111,7 +125,28 @@ if ($outfwsettings{'POLICY'} eq 'MODE0'){ $selected{'POLICY'}{'MODE0'} = 'select
 if ($outfwsettings{'POLICY'} eq 'MODE1'){ $selected{'POLICY'}{'MODE1'} = 'selected'; } else { $selected{'POLICY'}{'MODE1'} = ''; }
 if ($outfwsettings{'POLICY'} eq 'MODE2'){ $selected{'POLICY'}{'MODE2'} = 'selected'; } else { $selected{'POLICY'}{'MODE2'} = ''; }
 
-&Header::openpage('Ausgehende Firewall', 1, '');
+# This is a little hack if poeple donĀ“t mark any date then all will be selected, because they might have forgotten to select
+# a valid day. A Rule without any matching day will never work, because the timeranges are new feature people might not notice
+# that they have to select a day for the rule.
+
+if ( $outfwsettings{'TIME_MON'} eq "" &&
+     $outfwsettings{'TIME_TUE'} eq "" &&
+        $outfwsettings{'TIME_WED'} eq "" &&
+        $outfwsettings{'TIME_THU'} eq "" &&
+        $outfwsettings{'TIME_FRI'} eq "" &&
+        $outfwsettings{'TIME_SAT'} eq "" &&
+        $outfwsettings{'TIME_SUN'} eq "" )
+        {
+               $outfwsettings{'TIME_MON'} = "on";
+               $outfwsettings{'TIME_TUE'} = "on";
+               $outfwsettings{'TIME_WED'} = "on";
+               $outfwsettings{'TIME_THU'} = "on";
+               $outfwsettings{'TIME_FRI'} = "on";
+               $outfwsettings{'TIME_SAT'} = "on";
+               $outfwsettings{'TIME_SUN'} = "on";
+        }
+
+&Header::openpage($Lang::tr{'outgoing firewall'}, 1, '');
 &Header::openbigbox('100%', 'left', '', $errormessage);
 
 ############################################################################################################################
@@ -182,6 +217,17 @@ if ($outfwsettings{'ACTION'} eq $Lang::tr{'edit'})
        foreach $configentry (sort @configs)
        {
                @configline = split( /\;/, $configentry );
+               
+               $configline[10] =  "on" if not exists $configline[11];
+               $configline[11] =  "on" if not exists $configline[11];
+               $configline[12] =  "on" if not exists $configline[12];
+               $configline[13] =  "on" if not exists $configline[13];
+               $configline[14] =  "on" if not exists $configline[14];
+               $configline[15] =  "on" if not exists $configline[15];
+               $configline[16] =  "on" if not exists $configline[16];
+               $configline[17] =  "00:00" if not exists $configline[17];
+               $configline[18] =  "00:00" if not exists $configline[18];
+
                unless  (($configline[0] eq $outfwsettings{'STATE'}) && 
                        ($configline[1] eq $outfwsettings{'ENABLED'}) && 
                        ($configline[2] eq $outfwsettings{'SNET'}) && 
@@ -224,6 +270,17 @@ if ($outfwsettings{'ACTION'} eq $Lang::tr{'delete'})
        foreach $configentry (sort @configs)
        {
                @configline = split( /\;/, $configentry );
+               
+               $configline[10] =  "on" if not exists $configline[11];
+               $configline[11] =  "on" if not exists $configline[11];
+               $configline[12] =  "on" if not exists $configline[12];
+               $configline[13] =  "on" if not exists $configline[13];
+               $configline[14] =  "on" if not exists $configline[14];
+               $configline[15] =  "on" if not exists $configline[15];
+               $configline[16] =  "on" if not exists $configline[16];
+               $configline[17] =  "00:00" if not exists $configline[17];
+               $configline[18] =  "00:00" if not exists $configline[18];
+                               
                unless  (($configline[0] eq $outfwsettings{'STATE'}) && 
                        ($configline[1] eq $outfwsettings{'ENABLED'}) && 
                        ($configline[2] eq $outfwsettings{'SNET'}) && 
@@ -320,15 +377,26 @@ END
                                $outfwsettings{'DIP'} = $configline[7];
                                $outfwsettings{'DPORT'} = $configline[8];
                                $outfwsettings{'LOG'} = $configline[9];
-                               $outfwsettings{'TIME_MON'} = $configline[10];
-                               $outfwsettings{'TIME_TUE'} = $configline[11];
-                               $outfwsettings{'TIME_WED'} = $configline[12];
-                               $outfwsettings{'TIME_THU'} = $configline[13];
-                               $outfwsettings{'TIME_FRI'} = $configline[14];
-                               $outfwsettings{'TIME_SAT'} = $configline[15];
-                               $outfwsettings{'TIME_SUN'} = $configline[16];
-                               $outfwsettings{'TIME_FROM'} = $configline[17];
-                               $outfwsettings{'TIME_TO'} = $configline[18];
+                               
+                               $configline[10] =  "on" if not exists $configline[11];
+                               $configline[11] =  "on" if not exists $configline[11];
+                               $configline[12] =  "on" if not exists $configline[12];
+                               $configline[13] =  "on" if not exists $configline[13];
+                               $configline[14] =  "on" if not exists $configline[14];
+                               $configline[15] =  "on" if not exists $configline[15];
+                               $configline[16] =  "on" if not exists $configline[16];
+                               $configline[17] =  "00:00" if not exists $configline[17];
+                               $configline[18] =  "00:00" if not exists $configline[18];
+                               
+                               $outfwsettings{'TIME_MON'} =  $configline[10];
+                               $outfwsettings{'TIME_TUE'} =  $configline[11];
+                               $outfwsettings{'TIME_WED'} =  $configline[12];
+                               $outfwsettings{'TIME_THU'} =  $configline[13];
+                               $outfwsettings{'TIME_FRI'} =  $configline[14];
+                               $outfwsettings{'TIME_SAT'} =  $configline[15];
+                               $outfwsettings{'TIME_SUN'} =  $configline[16];
+                               $outfwsettings{'TIME_FROM'} =  $configline[17];
+                               $outfwsettings{'TIME_TO'} =  $configline[18];
 
                                if ($outfwsettings{'DIP'} eq ''){ $outfwsettings{'DISPLAY_DIP'} = 'ALL'; } else { $outfwsettings{'DISPLAY_DIP'} = $outfwsettings{'DIP'}; }
                                if ($outfwsettings{'DPORT'} eq ''){ $outfwsettings{'DISPLAY_DPORT'} = 'ALL'; } else { $outfwsettings{'DISPLAY_DPORT'} = $outfwsettings{'DPORT'}; }
@@ -397,14 +465,14 @@ END
                                                unless ($outfwsettings{'SIP'}) { $outfwsettings{'DISPLAY_SIP'} = 'ALL'; } else { $outfwsettings{'DISPLAY_SIP'} = $outfwsettings{'SIP'}; }
                                                unless ($outfwsettings{'SMAC'}) { $outfwsettings{'DISPLAY_SMAC'} = 'ALL'; } else { $outfwsettings{'DISPLAY_SMAC'} = $outfwsettings{'SMAC'}; }
                                                print <<END
-                                               <tr><td width='14%' align='right'>$Lang::tr{'source ip'}:
+                                               <tr><td width='14%' align='right'>$Lang::tr{'source ip or net'}:
                                                    <td width='14%' align='left'>$outfwsettings{'DISPLAY_SIP'}
                                                    <td width='44%' colspan='2' align='center'>
 END
 ;
                                        }
                                                print <<END
-                                               <tr><td width='14%' align='right'>$Lang::tr{'time'} - </td>
+                                               <tr><td width='14%' align='right'>$Lang::tr{'time'} -  </td>
                                                    <td width='14%' align='left'>
 END
 ;
@@ -441,7 +509,7 @@ END
 if ($outfwsettings{'POLICY'} eq 'MODE1'){
 print <<END
                                        <tr bgcolor='$color{'color20'}'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
-                                           <td align='center'>tcp&udp
+                                           <td align='center'>all
                                            <td align='center'>all
                                            <td align='center'>ALL
                                            <td align='center'>drop
@@ -491,13 +559,13 @@ END
                if ($p2pline[2] eq 'on') {
                        print <<END
                                <input type='hidden' name='ACTION' value='disable' />
-                               <input type='image' name='submit' src='/images/stock_ok.png' alt='/>
+                               <input type='image' name='submit' src='/images/stock_ok.png' alt='$Lang::tr{'outgoingfw p2p allow'}' title='$Lang::tr{'outgoingfw p2p allow'}'/>
 END
 ;
                } else {
                        print <<END
                                <input type='hidden' name='ACTION' value='enable' />
-                               <input type='image' name='submit' src='/images/stock_stop.png' alt='' />
+                               <input type='image' name='submit' src='/images/stock_stop.png' alt='$Lang::tr{'outgoingfw p2p deny'}' title='$Lang::tr{'outgoingfw p2p deny'}' />
 END
 ;
                }
@@ -508,7 +576,7 @@ END
        }
        print <<END
        </table>
-  <br />$Lang::tr{'outgoingfw p2p description'}
+  <br />$Lang::tr{'outgoingfw p2p description 1'} <img src='/images/stock_ok.png' align='absmiddle' alt='$Lang::tr{'outgoingfw p2p deny'}'> $Lang::tr{'outgoingfw p2p description 2'} <img src='/images/stock_stop.png' align='absmiddle' alt='$Lang::tr{'outgoingfw p2p deny'}'> $Lang::tr{'outgoingfw p2p description 3'}
 END
 ;
        &Header::closebox();
@@ -540,86 +608,124 @@ END
 ;
 &Header::closebox();
 
-&Header::closebigbox();
-&Header::closepage();
-
 ############################################################################################################################
 ############################################################################################################################
 
 sub addrule
 {
-       &Header::openbox('100%', 'center', 'Rules hinzufuegen');
+       &Header::openbox('100%', 'center', $Lang::tr{'Add Rule'});
        if ($outfwsettings{'EDIT'} eq 'no') { $selected{'ENABLED'} = 'checked'; }
        $selected{'TIME_FROM'}{$outfwsettings{'TIME_FROM'}} = "selected='selected'";
        $selected{'TIME_TO'}{$outfwsettings{'TIME_TO'}} = "selected='selected'";
-       print <<END
+print <<END
        <form method='post' action='$ENV{'SCRIPT_NAME'}'>
        <table width='80%'>
-               <tr><td width='20%' align='right'>$Lang::tr{'description'}: <img src='/blob.gif' />
-                   <td width='30%' align='left'><input type='text' name='NAME' maxlength='30' value='$outfwsettings{'NAME'}' />
-                   <td width='20%' align='right' colspan='2'>$Lang::tr{'active'}:
-                   <td width='30%' align='left' colspan='2'><input type='checkbox' name='ENABLED' $selected{'ENABLED'} />
-               <tr><td width='20%' align='right'>$Lang::tr{'protocol'}:
-                   <td width='30%' align='left'><select name='PROT'><option value='all' $selected{'PROT'}{'all'}>All</option><option value='tcp' $selected{'PROT'}{'tcp'}>TCP</option><option value='tcp&udp' $selected{'PROT'}{'tcp&udp'}>TCP & UDP</option><option value='udp' $selected{'PROT'}{'udp'}>UDP</option></select>
-                   <td width='20%' align='right' colspan='2'>$Lang::tr{'policy'}:
-                   <td width='30%' align='left' colspan='2'>
+               <tr>
+                       <td width='20%' align='right'>$Lang::tr{'description'}: <img src='/blob.gif' /></td>
+                       <td width='30%' align='left'><input type='text' name='NAME' maxlength='30' value='$outfwsettings{'NAME'}' /></td>
+                       <td width='20%' align='right' colspan='2'>$Lang::tr{'active'}:</td>
+                       <td width='30%' align='left' colspan='2'><input type='checkbox' name='ENABLED' $selected{'ENABLED'} /></td>
+               </tr>
+               <tr>
+                       <td width='20%' align='right'>$Lang::tr{'protocol'}:</td>
+                       <td width='30%' align='left'>
+                               <select name='PROT'>
+                                       <option value='all' $selected{'PROT'}{'all'}>All</option>
+                                       <option value='tcp' $selected{'PROT'}{'tcp'}>TCP</option>
+                                       <option value='udp' $selected{'PROT'}{'udp'}>UDP</option>
+                                       <option value='gre' $selected{'PROT'}{'gre'}>GRE</option>
+                                       <option value='esp' $selected{'PROT'}{'esp'}>ESP</option>
+                               </select>
+                       </td>
+                       <td width='20%' align='right' colspan='2'>$Lang::tr{'policy'}:</td>
+                       <td width='30%' align='left' colspan='2'>
 END
 ;
        if ($outfwsettings{'POLICY'} eq 'MODE1'){
-               print "\t\t\tALLOW<input type='hidden' name='STATE' value='ALLOW' />\n";
+               print "\t\t\t\tALLOW<input type='hidden' name='STATE' value='ALLOW' />\n";
        } elsif ($outfwsettings{'POLICY'} eq 'MODE2'){
-               print "\t\t\tDENY<input type='hidden' name='STATE' value='DENY' />\n";
+               print "\t\t\t\tDENY<input type='hidden' name='STATE' value='DENY' />\n";
        }
        print <<END
-               <tr><td width='20%' align='right'>$Lang::tr{'source net'}:
-                   <td width='30%' align='left'><select name='SNET'>
-                       <option value='all' $selected{'SNET'}{'ALL'}>$Lang::tr{'all'}</option>
-                       <option value='ip' $selected{'SNET'}{'ip'}>$Lang::tr{'source ip'}</option>
-                       <option value='red' $selected{'SNET'}{'red'}>$Lang::tr{'red'} IP</option>
-                       <option value='green' $selected{'SNET'}{'green'}>$Lang::tr{'green'}</option>
+                       </td>
+               </tr>
+               <tr>
+                       <td width='20%' align='right'>$Lang::tr{'source'}:</td>
+                       <td width='30%' align='left'>
+                               <select name='SNET'>
+                                       <optgroup label='---'>
+                                               <option value='all' $selected{'SNET'}{'ALL'}>$Lang::tr{'all'}</option>
+                                       <optgroup label='$Lang::tr{'ip address'}'>
+                                               <option value='ip' $selected{'SNET'}{'ip'}>$Lang::tr{'source ip or net'}</option>
+                                               <option value='red' $selected{'SNET'}{'red'}>$Lang::tr{'red'} IP</option>
+                                       </optgroup>
+                                       <optgroup label='$Lang::tr{'alt vpn'}'>
+                                               <option value='ipsec' $selected{'SNET'}{'ipsec'}>IPSEC $Lang::tr{'interface'}</option>
+                                               <option value='ovpn' $selected{'SNET'}{'ovpn'}>OpenVPN $Lang::tr{'interface'}</option>
+                                       </optgroup>
+                                       <optgroup label='$Lang::tr{'network'}'>
+                                               <option value='green' $selected{'SNET'}{'green'}>$Lang::tr{'green'}</option>
 END
 ;
        if (&Header::blue_used()){
-               print "\t\t\t<option value='blue' $selected{'SNET'}{'blue'}>$Lang::tr{'wireless'}</option>\n";
+               print "\t\t\t\t\t<option value='blue' $selected{'SNET'}{'blue'}>$Lang::tr{'wireless'}</option>\n";
        }
        if (&Header::orange_used()){
-               print "\t\t\t<option value='orange' $selected{'SNET'}{'orange'}>$Lang::tr{'dmz'}</option>\n";
+               print "\t\t\t\t\t<option value='orange' $selected{'SNET'}{'orange'}>$Lang::tr{'dmz'}</option>\n";
        }
        print <<END
-                       </select>
-                   <td width='20%' align='right' colspan='2'>$Lang::tr{'source ip'}: <img src='/blob.gif' />
-                   <td width='30%' align='left' colspan='2'><input type='text' name='SIP' maxlength='15' value='$outfwsettings{'SIP'}' />
-               <tr><td width='20%' align='right'>$Lang::tr{'logging'}:
+                                       </optgroup>
+                                       <optgroup label='$Lang::tr{'advproxy NCSA group'}'>
 END
 ;
-if ($outfwsettings{'POLICY'} eq 'MODE1'){
-        print "<td width='30%' align='left'><input type='text' name='LOG' maxlength='10' value='$Lang::tr{'inactive'}' readonly='true' /></td>";
-}
-else{
-        print "<td width='30%' align='left'><select name='LOG'><option value='$Lang::tr{'active'}' $selected{'LOG'}{$Lang::tr{'active'}}>$Lang::tr{'active'}</option><option value='$Lang::tr{'inactive'}' $selected{'LOG'}{$Lang::tr{'inactive'}}>$Lang::tr{'inactive'}</option></select></td>";
-}
-print <<END
-                   <td width='20%' align='right' colspan='2' />
-                   <td width='30%' align='left' colspan='2' />
-               <tr><td width='20%' align='right'>$Lang::tr{'destination ip'}: <img src='/blob.gif' />
-                   <td width='30%' align='left'><input type='text' name='DIP' maxlength='15' value='$outfwsettings{'DIP'}' />
-                   <td width='20%' align='right' colspan='2'>$Lang::tr{'destination port'}: <img src='/blob.gif' />
-                   <td width='30%' align='left' colspan='2'><input type='text' name='DPORT' maxlength='11' value='$outfwsettings{'DPORT'}' />
-               <tr><td width='20%' align='right'>$Lang::tr{'time'}:</td>
+       my @ipgroups = qx(ls $configpath/ipgroups/);
+       foreach (sort @ipgroups){
+               print "\t\t\t\t\t<option value='$_' $selected{'SNET'}{'$_'}>$_</option>\n";
+       }
+       print <<END
+                                       </optgroup>
+                               </select>
+                       </td>
+                       <td width='20%' align='right' colspan='2'>$Lang::tr{'source ip or net'}<img src='/blob.gif' /></td>
+                       <td width='30%' align='left' colspan='2'><input type='text' name='SIP' value='$outfwsettings{'SIP'}' /></td>
+               </tr>
+               <tr>
+                       <td width='20%' align='right'>$Lang::tr{'logging'}:</td>
+                       <td width='30%' align='left'>
+                               <select name='LOG'>
+                                       <option value='$Lang::tr{'active'}' $selected{'LOG'}{$Lang::tr{'active'}}>$Lang::tr{'active'}</option>
+                                       <option value='$Lang::tr{'inactive'}' $selected{'LOG'}{$Lang::tr{'inactive'}}>$Lang::tr{'inactive'}</option>
+                               </select>
+                       </td>
+                       <td width='20%' align='right' colspan='2' />
+                       <td width='30%' align='left' colspan='2' />
+               <tr>
+                       <td width='20%' align='right'>$Lang::tr{'destination ip or net'}: <img src='/blob.gif' /></td>
+                       <td width='30%' align='left'><input type='text' name='DIP'  value='$outfwsettings{'DIP'}' /></td>
+                       <td width='20%' align='right' colspan='2'>$Lang::tr{'destination port'}(s) <img src='/blob.gif' /></td>
+                       <td width='30%' align='left' colspan='2'><input type='text' name='DPORT' value='$outfwsettings{'DPORT'}' /></td>
+               </tr>
+               <tr>
+                       <td width='20%' align='right'>$Lang::tr{'time'}:</td>
                        <td width='30%' align='left'>$Lang::tr{'advproxy monday'} $Lang::tr{'advproxy tuesday'} $Lang::tr{'advproxy wednesday'} $Lang::tr{'advproxy thursday'} $Lang::tr{'advproxy friday'} $Lang::tr{'advproxy saturday'} $Lang::tr{'advproxy sunday'}</td>
                        <td width='20%' align='right' colspan='2' />
                        <td width='15%' align='left'>$Lang::tr{'advproxy from'}</td>
-                       <td width='15%' align='left'>$Lang::tr{'advproxy to'}</td></tr>
-               <tr><td width='20%' align='right'></td>
-                       <td width='30%' align='left'><input type='checkbox' name='TIME_MON' $checked{'TIME_MON'}{'on'} />
-                                                                                <input type='checkbox' name='TIME_TUE' $checked{'TIME_TUE'}{'on'} />
-                                                                                <input type='checkbox' name='TIME_WED' $checked{'TIME_WED'}{'on'} />
-                                                                                <input type='checkbox' name='TIME_THU' $checked{'TIME_THU'}{'on'} />
-                                                                                <input type='checkbox' name='TIME_FRI' $checked{'TIME_FRI'}{'on'} />
-                                                                                <input type='checkbox' name='TIME_SAT' $checked{'TIME_SAT'}{'on'} />
-                                                                                <input type='checkbox' name='TIME_SUN' $checked{'TIME_SUN'}{'on'} /></td>
+                       <td width='15%' align='left'>$Lang::tr{'advproxy to'}</td>
+               </tr>
+               <tr>
+                       <td width='20%' align='right'></td>
+                       <td width='30%' align='left'>
+                               <input type='checkbox' name='TIME_MON' $checked{'TIME_MON'}{'on'} />
+                               <input type='checkbox' name='TIME_TUE' $checked{'TIME_TUE'}{'on'} />
+                               <input type='checkbox' name='TIME_WED' $checked{'TIME_WED'}{'on'} />
+                               <input type='checkbox' name='TIME_THU' $checked{'TIME_THU'}{'on'} />
+                               <input type='checkbox' name='TIME_FRI' $checked{'TIME_FRI'}{'on'} />
+                               <input type='checkbox' name='TIME_SAT' $checked{'TIME_SAT'}{'on'} />
+                               <input type='checkbox' name='TIME_SUN' $checked{'TIME_SUN'}{'on'} />
+                       </td>
                        <td width='20%' align='right' colspan='2' />
-                       <td width='15%' align='left'><select name='TIME_FROM'>
+                       <td width='15%' align='left'>
+                               <select name='TIME_FROM'>
 END
 ;
 for (my $i=0;$i<=23;$i++) {
@@ -627,11 +733,12 @@ for (my $i=0;$i<=23;$i++) {
        for (my $j=0;$j<=45;$j+=15) {
                $j = sprintf("%02s",$j);
                my $time = $i.":".$j;
-               print "<option $selected{'TIME_FROM'}{$time}>$i:$j</option>\n";
+               print "\t\t\t\t\t<option $selected{'TIME_FROM'}{$time}>$i:$j</option>\n";
        }
 }
 print <<END    
-                       </select></td>
+                               </select>
+                       </td>
                        <td width='15%' align='left'><select name='TIME_TO'>
 END
 ;
@@ -640,14 +747,19 @@ for (my $i=0;$i<=23;$i++) {
        for (my $j=0;$j<=45;$j+=15) {
                $j = sprintf("%02s",$j);
                my $time = $i.":".$j;
-               print "<option $selected{'TIME_TO'}{$time}>$i:$j</option>\n";
+               print "\t\t\t\t\t<option $selected{'TIME_TO'}{$time}>$i:$j</option>\n";
        }
 }
 print <<END    
-                       </select></td></tr>
-               <tr><td colspan='6'>
-               <tr><td width='40%' align='right' colspan='2'><img src='/blob.gif' />$Lang::tr{'this field may be blank'}
-                   <td width='60%' align='left' colspan='4'><input type='submit' name='ACTION' value=$Lang::tr{'add'} />
+                               </select>
+                       </td>
+               </tr>
+               <tr>
+                       <td colspan='6' />
+               <tr>
+               <tr>
+                       <td width='40%' align='right' colspan='2'><img src='/blob.gif' />$Lang::tr{'this field may be blank'}</td>
+                       <td width='60%' align='left' colspan='4'><input type='submit' name='ACTION' value=$Lang::tr{'add'} /></td>
        </table></form>
 END
 ;
@@ -694,4 +806,7 @@ END
        print "</table>";
        &Header::closebox();
   }
-}
\ No newline at end of file
+}
+
+&Header::closebigbox();
+&Header::closepage();
\ No newline at end of file