]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - html/cgi-bin/outgoingfw.cgi
Forward Firewall: added a customservices file with default values
[people/teissler/ipfire-2.x.git] / html / cgi-bin / outgoingfw.cgi
index 07fcb39cbbd43258288476217fc455b63f8d3414..b417817a257cb524c46e257a23a0a6f9dbde76cf 100644 (file)
@@ -310,6 +310,11 @@ if ($outfwsettings{'ACTION'} eq $Lang::tr{'delete'})
 if ($outfwsettings{'ACTION'} eq $Lang::tr{'add'})
 {
        if ( $outfwsettings{'VALID'} eq 'yes' ) {
+
+               if ( $outfwsettings{'SNET'} eq "all" ) {
+                       $outfwsettings{'SIP'} ="";
+                       $outfwsettings{'SMAC'}="";
+               }
                open( FILE, ">> $configfile" ) or die "Unable to write $configfile";
                print FILE <<END
 $outfwsettings{'STATE'};$outfwsettings{'ENABLED'};$outfwsettings{'SNET'};$outfwsettings{'PROT'};$outfwsettings{'NAME'};$outfwsettings{'SIP'};$outfwsettings{'SMAC'};$outfwsettings{'DIP'};$outfwsettings{'DPORT'};$outfwsettings{'LOG'};$outfwsettings{'TIME_MON'};$outfwsettings{'TIME_TUE'};$outfwsettings{'TIME_WED'};$outfwsettings{'TIME_THU'};$outfwsettings{'TIME_FRI'};$outfwsettings{'TIME_SAT'};$outfwsettings{'TIME_SUN'};$outfwsettings{'TIME_FROM'};$outfwsettings{'TIME_TO'};
@@ -403,8 +408,12 @@ END
                                if ($outfwsettings{'STATE'} eq 'DENY'){ $outfwsettings{'DISPLAY_STATE'} = "<img src='/images/stock_stop.png' alt='DENY' />"; }
                                if ($outfwsettings{'STATE'} eq 'ALLOW'){ $outfwsettings{'DISPLAY_STATE'} = "<img src='/images/stock_ok.png' alt='ALLOW' />"; }
                                if ((($outfwsettings{'POLICY'} eq 'MODE1') && ($outfwsettings{'STATE'} eq 'ALLOW')) || (($outfwsettings{'POLICY'} eq 'MODE2') && ($outfwsettings{'STATE'} eq 'DENY'))){
-                                       print <<END
-                                       <tr bgcolor='$color{'color20'}'>
+                               if ( $outfwsettings{'ENABLED'} eq "on" ){
+                                       print "<tr bgcolor='$color{'color20'}'>";
+                               } else {
+                                       print "<tr bgcolor='$color{'color18'}'>";
+                               }
+                                       print <<END
                                            <td align='center'>$outfwsettings{'PROT'}
                                            <td align='center'>$outfwsettings{'SNET'}
                                            <td align='center'>$outfwsettings{'DISPLAY_DIP'}:$outfwsettings{'DISPLAY_DPORT'}
@@ -622,7 +631,7 @@ END
 sub addrule
 {
        &Header::openbox('100%', 'center', $Lang::tr{'Add Rule'});
-       if ($outfwsettings{'EDIT'} eq 'no') { $selected{'ENABLED'} = 'checked'; }
+       if ($outfwsettings{'ENABLED'} eq 'on') { $selected{'ENABLED'} = 'checked'; }
        $selected{'TIME_FROM'}{$outfwsettings{'TIME_FROM'}} = "selected='selected'";
        $selected{'TIME_TO'}{$outfwsettings{'TIME_TO'}} = "selected='selected'";
 print <<END
@@ -690,7 +699,8 @@ END
 ;
        my @ipgroups = qx(ls $configpath/ipgroups/);
        foreach (sort @ipgroups){
-               print "\t\t\t\t\t<option value='$_' $selected{'SNET'}{'$_'}>$_</option>\n";
+               chomp($_);
+               print "\t\t\t\t\t<option value='$_' $selected{'SNET'}{$_}>$_</option>\n";
        }
        print <<END
                                        </optgroup>
@@ -699,7 +709,8 @@ END
 ;
        my @macgroups = qx(ls $configpath/macgroups/);
        foreach (sort @macgroups){
-               print "\t\t\t\t\t<option value='$_' $selected{'SNET'}{'$_'}>$_</option>\n";
+               chomp($_);
+               print "\t\t\t\t\t<option value='$_' $selected{'SNET'}{$_}>$_</option>\n";
        }
        print <<END
                                        </optgroup>
@@ -835,4 +846,4 @@ END
 }
 
 &Header::closebigbox();
-&Header::closepage();
\ No newline at end of file
+&Header::closepage();