X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Fp2p-block.cgi;fp=html%2Fcgi-bin%2Fp2p-block.cgi;h=6683ca8b620d0536116c2daca7fb7345df5261b8;hp=aab2d3d1c4117310f7700d92814fcb0d624acdad;hb=e9a056234592750a42ff82c12e858069b32ab82e;hpb=85860aff263c41a74ff274fca2998e941b9134f6 diff --git a/html/cgi-bin/p2p-block.cgi b/html/cgi-bin/p2p-block.cgi index aab2d3d1c..6683ca8b6 100755 --- a/html/cgi-bin/p2p-block.cgi +++ b/html/cgi-bin/p2p-block.cgi @@ -32,6 +32,7 @@ require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; my $errormessage = ''; +my $notice; my $p2pfile = "${General::swroot}/firewall/p2protocols"; my @p2ps = (); @@ -44,8 +45,6 @@ my %mainsettings = (); &Header::showhttpheaders(); &Header::getcgihash(\%fwdfwsettings); -&Header::openpage($Lang::tr{'p2p block'}, 1, ''); -&Header::openbigbox('100%', 'center', $errormessage); if ($fwdfwsettings{'ACTION'} eq 'togglep2p') { open( FILE, "<$p2pfile") or die "Unable to read $p2pfile"; @@ -66,77 +65,83 @@ if ($fwdfwsettings{'ACTION'} eq 'togglep2p') { close FILE; &General::firewall_config_changed(); - &p2pblock(); -} else { - &p2pblock(); + + $notice = $Lang::tr{'p2p block save notice'}; } -sub p2pblock { - my $gif; +&Header::openpage($Lang::tr{'p2p block'}, 1, ''); +&Header::openbigbox('100%', 'center', $errormessage); - open(FILE, "<$p2pfile") or die "Unable to read $p2pfile"; - @p2ps = ; - close FILE; +if ($notice) { + &Header::openbox('100%', 'left', $Lang::tr{'notice'}); + print "$notice"; + &Header::closebox(); +} - &Header::openbox('100%', 'center', $Lang::tr{'p2p block'}); - print < - - - $Lang::tr{'protocol'} - - - $Lang::tr{'status'} - - +my $gif; + +open(FILE, "<$p2pfile") or die "Unable to read $p2pfile"; +@p2ps = ; +close FILE; + +&Header::openbox('100%', 'center', $Lang::tr{'p2p block'}); +print < + + + $Lang::tr{'protocol'} + + + $Lang::tr{'status'} + + END - foreach my $p2pentry (sort @p2ps) { - my @p2pline = split( /\;/, $p2pentry); - if ($p2pline[2] eq 'on') { - $gif = "/images/on.gif" - } else { - $gif = "/images/off.gif" - } - - print < - - $p2pline[0]: - - -
- - - -
- - -END +foreach my $p2pentry (sort @p2ps) { + my @p2pline = split( /\;/, $p2pentry); + if ($p2pline[2] eq 'on') { + $gif = "/images/on.gif" + } else { + $gif = "/images/off.gif" } print < - - - - - $Lang::tr{'outgoing firewall p2p allow'} - - - - - - - - $Lang::tr{'outgoing firewall p2p deny'} - - - + + + $p2pline[0]: + + +
+ + + +
+ + END - - &Header::closebox(); } +print < + + + + + $Lang::tr{'outgoing firewall p2p allow'} + + + + + + + + $Lang::tr{'outgoing firewall p2p deny'} + + + +END + +&Header::closebox(); + &Header::closebigbox(); &Header::closepage();