From: maniacikarus Date: Thu, 7 Jun 2007 12:33:20 +0000 (+0000) Subject: Outgoing Firewall CGI geschrieben, Proxy CGI verkleinert X-Git-Tag: v2.3-beta1~644 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=9141bd3433f6c6adfe44749f6743a594e587eb0a Outgoing Firewall CGI geschrieben, Proxy CGI verkleinert git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@615 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- diff --git a/html/cgi-bin/outgoingfw.cgi b/html/cgi-bin/outgoingfw.cgi index c48f28574c..2b529752ef 100644 --- a/html/cgi-bin/outgoingfw.cgi +++ b/html/cgi-bin/outgoingfw.cgi @@ -78,11 +78,18 @@ if ($outfwsettings{'ACTION'} eq $Lang::tr{'reset'}) $outfwsettings{'POLICY'}='MODE0'; unlink $configfile; system("/usr/bin/touch $configfile"); + my $MODE = $outfwsettings{'POLICY'}; + %outfwsettings = (); + $outfwsettings{'POLICY'} = "$MODE"; &General::writehash("${General::swroot}/outgoing/settings", \%outfwsettings); } if ($outfwsettings{'ACTION'} eq $Lang::tr{'save'}) { + my $MODE = $outfwsettings{'POLICY'}; + %outfwsettings = (); + $outfwsettings{'POLICY'} = "$MODE"; &General::writehash("${General::swroot}/outgoing/settings", \%outfwsettings); + system("/usr/local/bin/outgoingfwctrl"); } if ($outfwsettings{'ACTION'} eq 'enable') { @@ -100,6 +107,7 @@ if ($outfwsettings{'ACTION'} eq 'enable') } } close FILE; + system("/usr/local/bin/outgoingfwctrl"); } if ($outfwsettings{'ACTION'} eq 'disable') { @@ -117,6 +125,7 @@ if ($outfwsettings{'ACTION'} eq 'disable') } } close FILE; + system("/usr/local/bin/outgoingfwctrl"); } if ($outfwsettings{'ACTION'} eq $Lang::tr{'edit'}) { @@ -134,7 +143,8 @@ if ($outfwsettings{'ACTION'} eq $Lang::tr{'edit'}) ($configline[4] eq $outfwsettings{'NAME'}) && ($configline[5] eq $outfwsettings{'SIP'}) && ($configline[6] eq $outfwsettings{'SMAC'}) && - ($configline[7] eq $outfwsettings{'DIP'}) && + ($configline[7] eq $outfwsettings{'DIP'}) && + ($configline[9] eq $outfwsettings{'LOG'}) && ($configline[8] eq $outfwsettings{'DPORT'})) { print FILE $configentry; @@ -143,10 +153,12 @@ if ($outfwsettings{'ACTION'} eq $Lang::tr{'edit'}) close FILE; $selected{'SNET'}{"$outfwsettings{'SNET'}"} = 'selected'; $selected{'PROT'}{"$outfwsettings{'PROT'}"} = 'selected'; + $selected{'LOG'}{"$outfwsettings{'LOG'}"} = 'selected'; &addrule(); &Header::closebigbox(); &Header::closepage(); - exit + exit + system("/usr/local/bin/outgoingfwctrl"); } if ($outfwsettings{'ACTION'} eq $Lang::tr{'delete'}) { @@ -165,22 +177,25 @@ if ($outfwsettings{'ACTION'} eq $Lang::tr{'delete'}) ($configline[5] eq $outfwsettings{'SIP'}) && ($configline[6] eq $outfwsettings{'SMAC'}) && ($configline[7] eq $outfwsettings{'DIP'}) && + ($configline[9] eq $outfwsettings{'LOG'}) && ($configline[8] eq $outfwsettings{'DPORT'})) { print FILE $configentry; } } close FILE; + system("/usr/local/bin/outgoingfwctrl"); } if ($outfwsettings{'ACTION'} eq $Lang::tr{'add'}) { if ( $outfwsettings{'VALID'} eq 'yes' ) { open( FILE, ">> $configfile" ) or die "Unable to write $configfile"; print FILE <Ziel Anmerkung Politik - Aktionen + Logging + Aktionen END ; foreach $configentry (sort @configs) @@ -239,10 +255,11 @@ END $outfwsettings{'SMAC'} = $configline[6]; $outfwsettings{'DIP'} = $configline[7]; $outfwsettings{'DPORT'} = $configline[8]; + $outfwsettings{'LOG'} = $configline[9]; 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'}; } - if ($outfwsettings{'STATE'} eq 'DENY'){ $outfwsettings{'DISPLAY_STATE'} = "DENY"; } - if ($outfwsettings{'STATE'} eq 'ALLOW'){ $outfwsettings{'DISPLAY_STATE'} = "ALLOW"; } + if ($outfwsettings{'STATE'} eq 'DENY'){ $outfwsettings{'DISPLAY_STATE'} = "DENY"; } + if ($outfwsettings{'STATE'} eq 'ALLOW'){ $outfwsettings{'DISPLAY_STATE'} = "ALLOW"; } if ((($outfwsettings{'POLICY'} eq 'MODE1') && ($outfwsettings{'STATE'} eq 'ALLOW')) || (($outfwsettings{'POLICY'} eq 'MODE2') && ($outfwsettings{'STATE'} eq 'DENY'))){ print < @@ -251,33 +268,36 @@ END $outfwsettings{'DISPLAY_DIP'}:$outfwsettings{'DISPLAY_DPORT'} $outfwsettings{'NAME'} $outfwsettings{'DISPLAY_STATE'} - + $outfwsettings{'LOG'} +
- - - - - - - - - - - + + + + + + + + + + + +
- - - - - - - - - - - + + + + + + + + + + + +
END ; @@ -308,15 +328,15 @@ END &Header::closebox(); } -if ($outfwsettings{'POLICY'} eq 'MODE2'){ +if ($outfwsettings{'POLICY'} ne 'MODE0'){ open( FILE, "< $p2pfile" ) or die "Unable to read $p2pfile"; @p2ps = ; close FILE; &Header::openbox('100%', 'center', 'P2P-Block'); print < - Protokoll - Status + Protokoll + Status END ; my $id = 1; @@ -327,22 +347,22 @@ END
END ; - print "\t\t\t\n"; + print "\t\t\t\n"; print <$p2pline[0]: - + END ; if ($p2pline[2] eq 'on') { print < - + + END ; } else { print < - + + END ; } @@ -352,8 +372,8 @@ END ; } print <Klicken Sie auf die Symbole um das entsprechende P2P-Netz zu (de-)aktivieren. +
Klicken Sie auf die Symbole um das entsprechende iptables P2P-Blockmodul zu (de-)aktivieren. END ; &Header::closebox(); @@ -363,10 +383,10 @@ END print < - + + +
Modus 0:In diesem Modus ist es allen Rechnern im Netzwerk uneingeschraenkt moeglich Verbindungen ins Internet aufzubauen. -
Modus 1:In diesem Modus werden nur Verbindungen nach den oben definierten Regeln zugelassen. -
Modus 2:In diesem Modus werden saemtliche Verbindungen erlaubt, bis auf die oben definierten Block-Regeln.
Hier ist eine Besonderheit der P2P-Filter. -

+
Modus 0:In diesem Modus ist es allen Rechnern im Netzwerk uneingeschraenkt moeglich Verbindungen ins Internet aufzubauen.
Modus 1:In diesem Modus werden nur Verbindungen nach den oben definierten Regeln zugelassen.
Modus 2:In diesem Modus werden saemtliche Verbindungen erlaubt, bis auf die oben definierten Block-Regeln.

@@ -398,10 +418,10 @@ sub addrule print < - +
Anmerkung: - +
Anmerkung: + Aktiviert: - +
Protokoll: Sicherheitspolitik: @@ -409,9 +429,9 @@ sub addrule END ; if ($outfwsettings{'POLICY'} eq 'MODE1'){ - print "\t\t\tALLOW\n"; + print "\t\t\tALLOW\n"; } elsif ($outfwsettings{'POLICY'} eq 'MODE2'){ - print "\t\t\tDENY\n"; + print "\t\t\tDENY\n"; } print <Quellnetz: @@ -429,18 +449,19 @@ END } print < - Quell-IP-Adresse: - -
  - Quell-MAC-Adresse: - -
Ziel-IP-Adresse: - - Ziel-Port: - + Quell-IP-Adresse: + +
Logging: + Quell-MAC-Adresse: + +
Ziel-IP-Adresse: + + Ziel-Port: +
-
$Lang::tr{'this field may be blank'} - +
$Lang::tr{'this field may be blank'} +
END ; @@ -454,7 +475,7 @@ if ($outfwsettings{'POLICY'} eq 'MODE1' || $outfwsettings{'POLICY'} eq 'MODE2') my @defservices = ; close FILE; -print ""; +print "
$Lang::tr{'service'}$Lang::tr{'description'}$Lang::tr{'port'}$Lang::tr{'protocol'}$Lang::tr{'source net'}
"; foreach my $serviceline(@defservices) { my @service = split(/,/,$serviceline); @@ -474,19 +495,17 @@ END print ""; } print < + END ; + if ($outfwsettings{'POLICY'} eq 'MODE1'){ print "";} + elsif ($outfwsettings{'POLICY'} eq 'MODE2'){print "";} } -print "
$Lang::tr{'service'}$Lang::tr{'description'}$Lang::tr{'port'}$Lang::tr{'protocol'}$Lang::tr{'source net'}$Lang::tr{'logging'}
+ - -
"; - + print "
"; &Header::closebox(); + } } - -} - diff --git a/html/cgi-bin/proxy.cgi b/html/cgi-bin/proxy.cgi index ee44b0e344..58cf5c83fa 100644 --- a/html/cgi-bin/proxy.cgi +++ b/html/cgi-bin/proxy.cgi @@ -913,32 +913,30 @@ print <
+ + + + +
$Lang::tr{'advproxy url filter'} $Lang::tr{'advproxy enabled'}$Lang::tr{'advproxy update accelerator'} $Lang::tr{'advproxy enabled'}
+
+ - - - - + + - - - - + + - - - - + - - - - +
$Lang::tr{'advproxy upstream proxy'}
$Lang::tr{'advproxy via forwarding'}:$Lang::tr{'advproxy upstream proxy host:port'} *$Lang::tr{'advproxy via forwarding'}:$Lang::tr{'advproxy upstream proxy host:port'}*
$Lang::tr{'advproxy client IP forwarding'}:$Lang::tr{'advproxy upstream username'}: *$Lang::tr{'advproxy client IP forwarding'}:$Lang::tr{'advproxy upstream username'}*
$Lang::tr{'advproxy username forwarding'}:$Lang::tr{'advproxy upstream password'}: *$Lang::tr{'advproxy username forwarding'}: + $Lang::tr{'advproxy upstream password'}:*
$Lang::tr{'advproxy no connection auth'}:  $Lang::tr{'advproxy no connection auth'}:

@@ -947,16 +945,9 @@ print <$Lang::tr{'advproxy log settings'} - $Lang::tr{'advproxy log enabled'}: - - $Lang::tr{'advproxy log query'}: - - - -   -   - $Lang::tr{'advproxy log useragent'}: - + $Lang::tr{'advproxy log enabled'}: + $Lang::tr{'advproxy log query'}: + $Lang::tr{'advproxy log useragent'}:
@@ -965,7 +956,7 @@ print <$Lang::tr{'advproxy cache management'} - + $Lang::tr{'advproxy ram cache size'}: @@ -1003,7 +994,7 @@ print < - - - - - - -
END ; +} +print "
"; + } else { print < @@ -1437,12 +1435,12 @@ print < - - - - - + +END +; +if ( $proxysettings{'ENABLE_MIME_FILTER'} eq 'on' ){ +print < @@ -1460,18 +1458,21 @@ print <  +END +; +} +print < +
$Lang::tr{'advproxy MIME filter'}
$Lang::tr{'advproxy enabled'}:$Lang::tr{'advproxy MIME filter'} $Lang::tr{'advproxy enabled'}:
$Lang::tr{'advproxy MIME block types'}: *   
- - - - - - - + +END +; +if ( $proxysettings{'ENABLE_BROWSER_CHECK'} eq 'on' ){ +print < - - - - - +
$Lang::tr{'advproxy web browser'}
$Lang::tr{'advproxy UA enable filter'}:  $Lang::tr{'advproxy web browser'} $Lang::tr{'advproxy UA enable filter'}:
END @@ -1496,7 +1497,7 @@ for ($n=0; $n<=@useragentlist; $n = $n + $i) { if ($i eq 3) { print "<\/tr>\n"; } } } - +} print <
@@ -1506,14 +1507,10 @@ print <
$Lang::tr{'advproxy fake useragent'}: *
$Lang::tr{'advproxy fake referer'}: *
@@ -1522,32 +1519,6 @@ END ; print < - - $Lang::tr{'advproxy url filter'} - - - $Lang::tr{'advproxy enabled'}: - -   -   - - -
- - - - - - - - - - - -
$Lang::tr{'advproxy update accelerator'}
$Lang::tr{'advproxy enabled'}:  
-
- diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index 3173e7fd69..91f31e23ca 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -926,6 +926,7 @@ 'log viewing options' => 'Log Ansichts-Optionen', 'log-options' => 'Logfile options', 'loged in at' => 'Angemeldet seit', +'logging' => 'Logging', 'logging server' => 'Protokollierungs-Server', 'loginlogout' => 'Login/Logout', 'lookup failed' => 'Reverse Lookup gescheitert', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index ade961edb0..6dbe21c05f 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -937,6 +937,7 @@ 'log viewing options' => 'Log viewing options', 'log-options' => 'Logfile options', 'loged in at' => 'Logged In At', +'logging' => 'Logging', 'logging server' => 'Logging server', 'loginlogout' => 'Login/Logout', 'lookup failed' => 'Reverse lookup failed',
$Lang::tr{'advproxy AUTH method'}