This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree".
The branch, master has been updated via 4c700de4af3de72b80a540fef26b4e056b85193a (commit) from 98c474a4aa6802cc07088eafb60eb47a8b315d10 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 4c700de4af3de72b80a540fef26b4e056b85193a Author: Christian Schmidt maniacikarus@ipfire.org Date: Fri Dec 10 13:17:13 2010 +0100
Added the ability to edit existing firewall groups and persist changes.
-----------------------------------------------------------------------
Summary of changes: config/rootfiles/core/44/filelists/files | 1 + html/cgi-bin/outgoinggrp.cgi | 126 ++++++++++++++++++++++++++--- langs/de/cgi-bin/de.pl | 2 + langs/en/cgi-bin/en.pl | 2 + langs/fr/cgi-bin/fr.pl | 2 + 5 files changed, 120 insertions(+), 13 deletions(-)
Difference in files: diff --git a/config/rootfiles/core/44/filelists/files b/config/rootfiles/core/44/filelists/files index 866acf0..5d0a4d0 100644 --- a/config/rootfiles/core/44/filelists/files +++ b/config/rootfiles/core/44/filelists/files @@ -13,6 +13,7 @@ srv/web/ipfire/cgi-bin/speed.cgi srv/web/ipfire/cgi-bin/vpnmain.cgi srv/web/ipfire/cgi-bin/ids.cgi srv/web/ipfire/cgi-bin/outgoingfw.cgi +srv/web/ipfire/cgi-bin/outgoinggrp.cgi srv/web/ipfire/cgi-bin/pppsetup.cgi srv/web/ipfire/html/images/urlfilter/copy.gif var/ipfire/general-functions.pl diff --git a/html/cgi-bin/outgoinggrp.cgi b/html/cgi-bin/outgoinggrp.cgi index a00db2a..e757ca0 100644 --- a/html/cgi-bin/outgoinggrp.cgi +++ b/html/cgi-bin/outgoinggrp.cgi @@ -65,9 +65,9 @@ $selected{'macgroup'}{$outgrpsettings{'macgroup'}} = "selected='selected'"; # my $debugCount = 0; # foreach my $line (sort keys %outgrpsettings) { # print "$line = $outgrpsettings{$line}<br />\n"; - # $debugCount++; +# $debugCount++; # } -# print " Count: $debugCount\n"; +# print "Count: $debugCount\n"; # &Header::closebox(); # DEBUG DEBUG ############### @@ -78,6 +78,9 @@ $selected{'macgroup'}{$outgrpsettings{'macgroup'}} = "selected='selected'"; if ($outgrpsettings{'ACTION'} eq 'newipgroup') { &newipgroup(); +}elsif ($outgrpsettings{'ACTION'} eq 'editipgroup') +{ + &editipgroup(); } elsif ($outgrpsettings{'ACTION'} eq 'deleteipgroup' ) { unlink("$configpath/ipgroups/$outgrpsettings{'ipgroup'}"); } elsif ($outgrpsettings{'ACTION'} eq 'addipgroup') { @@ -90,6 +93,7 @@ if ($outgrpsettings{'ACTION'} eq 'newipgroup') $errormessage = "$Lang::tr{'outgoing firewall reserved groupname'}"; } else { open (FILE, ">$configpath/ipgroups/$outgrpsettings{'ipgroup'}") or die "Can't save $outgrpsettings{'ipgroup'} settings $!"; + $outgrpsettings{'ipgroupcontent'} =~ s/\s*$//; flock (FILE, 2); print FILE $outgrpsettings{'ipgroupcontent'}."\n"; close FILE; @@ -99,7 +103,10 @@ if ($outgrpsettings{'ACTION'} eq 'newipgroup') if ($outgrpsettings{'ACTION'} eq 'newmacgroup') { &newmacgroup(); -} elsif ($outgrpsettings{'ACTION'} eq 'deletemacgroup' ) { +}elsif ($outgrpsettings{'ACTION'} eq 'editmacgroup') +{ + &editmacgroup(); +}elsif ($outgrpsettings{'ACTION'} eq 'deletemacgroup' ) { unlink("$configpath/macgroups/$outgrpsettings{'macgroup'}"); } elsif ($outgrpsettings{'ACTION'} eq 'addmacgroup') {
@@ -111,6 +118,7 @@ if ($outgrpsettings{'ACTION'} eq 'newmacgroup') $errormessage = "$Lang::tr{'outgoing firewall reserved groupname'}"; } else { open (FILE, ">$configpath/macgroups/$outgrpsettings{'macgroup'}") or die "Can't save $outgrpsettings{'macgroup'} settings $!"; + $outgrpsettings{'macgroupcontent'} =~ s/\s*$//; flock (FILE, 2); print FILE $outgrpsettings{'macgroupcontent'}."\n"; close FILE; @@ -176,20 +184,27 @@ print <<END <table width='10%' cellspacing='0'> <tr> <td align='center'> - <form method='post' action='$ENV{'SCRIPT_NAME'}#outgoing showipgroup'> + <form method='post' action='$ENV{'SCRIPT_NAME'}'> + <input type='hidden' name='ACTION' value='editipgroup' /> + <input type='hidden' name='ipgroup' value='$outgrpsettings{'ipgroup'}' /> + <input type='image' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' src='/images/edit.gif' /> + </form> + </td> + <td align='center'> + <form method='post' action='$ENV{'SCRIPT_NAME'}'> <input type='hidden' name='ACTION' value='newipgroup' /> <input type='image' alt='$Lang::tr{'new'}' title='$Lang::tr{'new'}' src='/images/list-add.png' /> </form> </td> <td align='center'> - <form method='post' action='$ENV{'SCRIPT_NAME'}#outgoing showipgroup'> + <form method='post' action='$ENV{'SCRIPT_NAME'}'> <input type='hidden' name='ACTION' value='saveipgroup' /> <input type='hidden' name='ipgroup' value='$outgrpsettings{'ipgroup'}' /> <input type='image' alt='$Lang::tr{'save'}' title='$Lang::tr{'save'}' src='/images/media-floppy.png' /> </form> </td> <td align='center'> - <form method='post' action='$ENV{'SCRIPT_NAME'}#outgoing showipgroup'> + <form method='post' action='$ENV{'SCRIPT_NAME'}'> <input type='hidden' name='ACTION' value='deleteipgroup' /> <input type='hidden' name='ipgroup' value='$outgrpsettings{'ipgroup'}' /> <input type='image' alt='$Lang::tr{'delete'}' title='$Lang::tr{'delete'}' src='/images/user-trash.png' /> @@ -253,20 +268,27 @@ print <<END <table width='10%' cellspacing='0'> <tr> <td align='center'> - <form method='post' action='$ENV{'SCRIPT_NAME'}#outgoing showmacgroup'> + <form method='post' action='$ENV{'SCRIPT_NAME'}'> + <input type='hidden' name='ACTION' value='editmacgroup' /> + <input type='hidden' name='macgroup' value='$outgrpsettings{'macgroup'}' /> + <input type='image' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' src='/images/edit.gif' /> + </form> + </td> + <td align='center'> + <form method='post' action='$ENV{'SCRIPT_NAME'}'> <input type='hidden' name='ACTION' value='newmacgroup' /> <input type='image' alt='$Lang::tr{'new'}' title='$Lang::tr{'new'}' src='/images/list-add.png' /> </form> </td> <td align='center'> - <form method='post' action='$ENV{'SCRIPT_NAME'}#outgoing showmacgroup'> + <form method='post' action='$ENV{'SCRIPT_NAME'}'> <input type='hidden' name='ACTION' value='savemacgroup' /> <input type='hidden' name='macgroup' value='$outgrpsettings{'macgroup'}' /> <input type='image' alt='$Lang::tr{'save'}' title='$Lang::tr{'save'}' src='/images/media-floppy.png' /> </form> </td> <td align='center'> - <form method='post' action='$ENV{'SCRIPT_NAME'}#outgoing showmacgroup'> + <form method='post' action='$ENV{'SCRIPT_NAME'}'> <input type='hidden' name='ACTION' value='deletemacgroup' /> <input type='hidden' name='macgroup' value='$outgrpsettings{'macgroup'}' /> <input type='image' alt='$Lang::tr{'delete'}' title='$Lang::tr{'delete'}' src='/images/user-trash.png' /> @@ -302,7 +324,7 @@ print <<END </tr> <tr> <td align='left' colspan='2'> - <input type='text' name='ipgroup' value='newgroup' size="30" /> + <input type='text' name='ipgroup' value='newipgroup' size="30" /> </td> <td align='left'> <input type='hidden' name='ACTION' value='addipgroup' /> @@ -311,7 +333,46 @@ print <<END </tr> <tr> <td align='left' colspan='3'> - <textarea name="ipgroupcontent" cols="20" rows="5" Wrap="off">192.168.1.0/24\n192.168.3.0/255.255.255.0\n192.168.0.1\n192.168.0.2\n</textarea> + <textarea name="ipgroupcontent" cols="40" rows="5" Wrap="off">192.168.1.0/24\n192.168.3.0/255.255.255.0\n192.168.0.1\n192.168.0.2\n</textarea> + </td> + </tr> + </table> + </form> +END +; + &Header::closebox(); + &Header::closebigbox(); + &Header::closepage(); + exit 0; +} + +sub editipgroup +{ +my $ipgroupcontent = `cat $configpath/ipgroups/$outgrpsettings{'ipgroup'} 2>/dev/null`; + + &Header::openbox('100%', 'center', $Lang::tr{'outgoing firewall edit ip group'}); + +print <<END + <form method='post' action='$ENV{'SCRIPT_NAME'}'> + <table width='95%' cellspacing='0'> + <tr> + <td bgcolor='$color{'color20'}' colspan='3' align='left'><b>$Lang::tr{'outgoing firewall edit ip group'}</b></td> + </tr> + <tr> + <td colspan='3' align='left'><br /></td> + </tr> + <tr> + <td align='left' colspan='2'> + <input type='text' name='ipgroup' value='$outgrpsettings{'ipgroup'}' size='30' readonly style='color:$color{'color20'}'/> + </td> + <td align='left'> + <input type='hidden' name='ACTION' value='addipgroup' /> + <input type='image' alt='$Lang::tr{'save'}' title='$Lang::tr{'save'}' src='/images/media-floppy.png' /> + </td> + </tr> + <tr> + <td align='left' colspan='3'> + <textarea name="ipgroupcontent" cols="40" rows="5" Wrap="off">$ipgroupcontent</textarea> </td> </tr> </table> @@ -339,7 +400,7 @@ print <<END </tr> <tr> <td align='left' colspan='2'> - <input type='text' name='macgroup' value='newgroup' size="30" /> + <input type='text' name='macgroup' value='newmacgroup' size="30" /> </td> <td align='left'> <input type='hidden' name='ACTION' value='addmacgroup' /> @@ -359,4 +420,43 @@ END &Header::closebigbox(); &Header::closepage(); exit 0; -} \ No newline at end of file +} + +sub editmacgroup +{ +my $macgroupcontent = `cat $configpath/macgroups/$outgrpsettings{'macgroup'} 2>/dev/null`; + + &Header::openbox('100%', 'center', $Lang::tr{'outgoing firewall edit mac group'}); + +print <<END + <form method='post' action='$ENV{'SCRIPT_NAME'}#outgoing editmacgroup'> + <table width='95%' cellspacing='0'> + <tr> + <td bgcolor='$color{'color20'}' colspan='3' align='left'><b>$Lang::tr{'outgoing firewall edit mac group'}</b></td> + </tr> + <tr> + <td colspan='3' align='left'><br /></td> + </tr> + <tr> + <td align='left' colspan='2'> + <input type='text' name='macgroup' value='$outgrpsettings{'macgroup'}' size='30' readonly style='color:$color{'color20'}'/> + </td> + <td align='left'> + <input type='hidden' name='ACTION' value='addmacgroup' /> + <input type='image' alt='$Lang::tr{'save'}' title='$Lang::tr{'save'}' src='/images/media-floppy.png' /> + </td> + </tr> + <tr> + <td align='left' colspan='3'> + <textarea name="macgroupcontent" cols="20" rows="5" Wrap="off">$macgroupcontent</textarea> + </td> + </tr> + </table> + </form> +END +; + &Header::closebox(); + &Header::closebigbox(); + &Header::closepage(); + exit 0; +} diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index 8bdc100..35650da 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -1275,6 +1275,8 @@ 'outgoing firewall' => 'Ausgehende Firewall', 'outgoing firewall add ip group' => 'IP Adressgruppen hinzufügen', 'outgoing firewall add mac group' => 'MAC Adressgruppen hinzufügen', +'outgoing firewall edit ip group' => 'IP Adressgruppen bearbeiten', +'outgoing firewall edit mac group' => 'MAC Adressgruppen bearbeiten', 'outgoing firewall group error' => 'Eine Gruppe mit dem selben Namen existiert bereits.', 'outgoing firewall groups' => 'Firewall Gruppen', 'outgoing firewall ip groups' => 'Ausgehende Firewall IP Adressgruppen', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 035c9c7..8604433 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1303,6 +1303,8 @@ 'outgoing firewall' => 'Outgoing Firewall', 'outgoing firewall add ip group' => 'Add IP Address Group', 'outgoing firewall add mac group' => 'Add MAC Address Group', +'outgoing firewall edit ip group' => 'Edit IP Address Group', +'outgoing firewall edit mac group' => 'Edit MAC Address Group', 'outgoing firewall group error' => 'A group with the same name exists.', 'outgoing firewall groups' => 'Firewall Groups', 'outgoing firewall ip groups' => 'Outgoing Firewall IP Address Groups', diff --git a/langs/fr/cgi-bin/fr.pl b/langs/fr/cgi-bin/fr.pl index ff1b743..160bb1b 100644 --- a/langs/fr/cgi-bin/fr.pl +++ b/langs/fr/cgi-bin/fr.pl @@ -1300,6 +1300,8 @@ 'outgoing firewall' => 'Pare-feu sortant', 'outgoing firewall add ip group' => 'Ajouter un groupe d'adresses IP', 'outgoing firewall add mac group' => 'Ajouter un groupe d'adresses MAC', +'outgoing firewall edit ip group' => 'Modifier un groupe d'adresses IP', +'outgoing firewall edit mac group' => 'Modifier un groupe d'adresses MAC', 'outgoing firewall group error' => 'Un groupe portant le même nom existe.', 'outgoing firewall groups' => 'Groupes de pare-feu', 'outgoing firewall ip groups' => 'Groupes d'adresses IP du pare-feu sortant',
hooks/post-receive -- IPFire 2.x development tree