]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - html/cgi-bin/fwhosts.cgi
FORWARD FIREWALL: Some Typos in language Files
[people/teissler/ipfire-2.x.git] / html / cgi-bin / fwhosts.cgi
index c45b0de587ab8bd21fed113a6381efcf24972370..afb47fa3d78acabfebe14c363a8b2a118e14e447 100755 (executable)
@@ -96,7 +96,8 @@ if ($fwhostsettings{'ACTION'} eq 'updatenet' )
                        $fwhostsettings{'orgname'}              = $customnetwork{$key}[0];
                        $fwhostsettings{'orgip'}                = $customnetwork{$key}[1];
                        $fwhostsettings{'orgsub'}               = $customnetwork{$key}[2];
-                       $fwhostsettings{'count'}                = $customnetwork{$key}[3];
+                       $fwhostsettings{'netremark'}    = $customnetwork{$key}[3];
+                       $fwhostsettings{'count'}                = $customnetwork{$key}[4];
                        delete $customnetwork{$key};
                        
                }
@@ -119,7 +120,7 @@ if ($fwhostsettings{'ACTION'} eq 'updatehost')
                                $ip = $customhost{$key}[2];
                        }
                        $fwhostsettings{'orgip'} = $ip;
-                       $fwhostsettings{'count'} = $customhost{$key}[3];
+                       $fwhostsettings{'count'} = $customhost{$key}[4];
                        delete $customhost{$key};
                        &General::writehasharray("$confighost", \%customhost);
                }
@@ -230,6 +231,11 @@ if ($fwhostsettings{'ACTION'} eq 'savenet' )
                        $fwhostsettings{'NOCHECK'}      ='false';
                        $fwhostsettings{'error'}        ='on';
                }
+               #check remark
+               if ($fwhostsettings{'NETREMARK'} ne '' && !&validremark($fwhostsettings{'NETREMARK'})){
+                       $errormessage=$Lang::tr{'fwhost err remark'};
+                       $fwhostsettings{'error'}        ='on';
+               }
                #check if subnet is sigle host
                if(&General::iporsubtocidr($fwhostsettings{'SUBNET'}) eq '32')
                {
@@ -280,17 +286,19 @@ if ($fwhostsettings{'ACTION'} eq 'savenet' )
                        $customnetwork{$key}[0] = $fwhostsettings{'orgname'} ;
                        $customnetwork{$key}[1] = $fwhostsettings{'orgip'} ;
                        $customnetwork{$key}[2] = $fwhostsettings{'orgsub'};
-                       $customnetwork{$key}[3] = $fwhostsettings{'count'};
+                       $customnetwork{$key}[3] = $fwhostsettings{'NETREMARK'};
+                       $customnetwork{$key}[4] = $fwhostsettings{'count'};
                        &General::writehasharray("$confignet", \%customnetwork);
                        undef %customnetwork;
                }                       
                if (!$errormessage){
+                       
                        &General::readhasharray("$confignet", \%customnetwork);
                        if ($fwhostsettings{'ACTION'} eq 'updatenet'){
                                if ($fwhostsettings{'update'} == '0'){
                                        foreach my $key (keys %customnetwork) {
                                                if($customnetwork{$key}[0] eq $fwhostsettings{'orgname'}){
-                                                       $count=$customnetwork{$key}[3];
+                                                       $count=$customnetwork{$key}[4];
                                                        delete $customnetwork{$key};
                                                        last;
                                                }
@@ -340,22 +348,24 @@ if ($fwhostsettings{'ACTION'} eq 'savenet' )
                                }
                        }                                       
                        my $key = &General::findhasharraykey (\%customnetwork);
-                       foreach my $i (0 .. 3) { $customnetwork{$key}[$i] = "";}
+                       foreach my $i (0 .. 4) { $customnetwork{$key}[$i] = "";}
                        $fwhostsettings{'SUBNET'}       = &General::iporsubtocidr($fwhostsettings{'SUBNET'});
                        $customnetwork{$key}[0]         = $fwhostsettings{'HOSTNAME'};
                        #convert ip when leading '0' in byte
-                       $fwhostsettings{'IP'}=&General::ip2dec($fwhostsettings{'IP'});
-                       $fwhostsettings{'IP'}=&General::dec2ip($fwhostsettings{'IP'});
+                       $fwhostsettings{'IP'}           =&General::ip2dec($fwhostsettings{'IP'});
+                       $fwhostsettings{'IP'}           =&General::dec2ip($fwhostsettings{'IP'});
                        $customnetwork{$key}[1]         = &General::getnetworkip($fwhostsettings{'IP'},$fwhostsettings{'SUBNET'}) ;
                        $customnetwork{$key}[2]         = &General::iporsubtodec($fwhostsettings{'SUBNET'}) ;
                        if($fwhostsettings{'newnet'} eq 'on'){$count=0;}
-                       $customnetwork{$key}[3]         = $count;
+                       $customnetwork{$key}[3]         = $fwhostsettings{'NETREMARK'};
+                       $customnetwork{$key}[4]         = $count;
                        &General::writehasharray("$confignet", \%customnetwork);
                        $fwhostsettings{'IP'}=$fwhostsettings{'IP'}."/".&General::iporsubtodec($fwhostsettings{'SUBNET'});
                        undef %customnetwork;
                        $fwhostsettings{'HOSTNAME'}='';
                        $fwhostsettings{'IP'}='';
                        $fwhostsettings{'SUBNET'}='';
+                       $fwhostsettings{'NETREMARK'}='';
                        #check if an edited net affected groups and need to reload rules
                        if ($needrules eq 'on'){
                                &rules;
@@ -400,6 +410,10 @@ if ($fwhostsettings{'ACTION'} eq 'savehost')
                                $errormessage=$Lang::tr{'fwhost err mac'};
                        }
                }
+               #check remark
+               if ($fwhostsettings{'HOSTREMARK'} ne '' && !&validremark($fwhostsettings{'HOSTREMARK'})){
+                       $errormessage=$Lang::tr{'fwhost err remark'};
+               }
                #CHECK IP-PART
                if ($fwhostsettings{'type'} eq 'ip'){
                        #check for subnet
@@ -426,7 +440,7 @@ if ($fwhostsettings{'ACTION'} eq 'savehost')
                if($fwhostsettings{'actualize'} eq 'on' && $fwhostsettings{'newhost'} ne 'on' && $errormessage){
                        $fwhostsettings{'actualize'} = '';
                        my $key = &General::findhasharraykey (\%customhost);
-                       foreach my $i (0 .. 3) { $customhost{$key}[$i] = "";}
+                       foreach my $i (0 .. 4) { $customhost{$key}[$i] = "";}
                        $customhost{$key}[0] = $fwhostsettings{'orgname'} ;
                        $customhost{$key}[1] = $fwhostsettings{'type'} ;
                        if($customhost{$key}[1] eq 'ip'){
@@ -434,7 +448,8 @@ if ($fwhostsettings{'ACTION'} eq 'savehost')
                        }else{
                                $customhost{$key}[2] = $fwhostsettings{'orgip'};
                        }
-                       $customhost{$key}[3] = $fwhostsettings{'count'};
+                       $customhost{$key}[3] = $fwhostsettings{'HOSTREMARK'};
+                       $customhost{$key}[4] = $fwhostsettings{'count'};
                        &General::writehasharray("$confighost", \%customhost);
                        undef %customhost;
                } 
@@ -480,7 +495,7 @@ if ($fwhostsettings{'ACTION'} eq 'savehost')
                                }
                        }
                        my $key = &General::findhasharraykey (\%customhost);
-                       foreach my $i (0 .. 3) { $customhost{$key}[$i] = "";}
+                       foreach my $i (0 .. 4) { $customhost{$key}[$i] = "";}
                        $customhost{$key}[0] = $fwhostsettings{'HOSTNAME'} ;
                        $customhost{$key}[1] = $fwhostsettings{'type'} ;
                        if ($fwhostsettings{'type'} eq 'ip'){
@@ -492,12 +507,14 @@ if ($fwhostsettings{'ACTION'} eq 'savehost')
                                $customhost{$key}[2] = $fwhostsettings{'IP'};
                        }
                        if($fwhostsettings{'newhost'} eq 'on'){$count=0;}
-                       $customhost{$key}[3] = $count;
+                       $customhost{$key}[3] = $fwhostsettings{'HOSTREMARK'};
+                       $customhost{$key}[4] =$count;
                        &General::writehasharray("$confighost", \%customhost);
                        undef %customhost;
                        $fwhostsettings{'HOSTNAME'}='';
                        $fwhostsettings{'IP'}='';
                        $fwhostsettings{'type'}='';
+                        $fwhostsettings{'HOSTREMARK'}='';
                        #check if we need to update rules while host was edited
                        if($needrules eq 'on'){
                                &rules;
@@ -527,10 +544,6 @@ if ($fwhostsettings{'ACTION'} eq 'savegrp')
        #check remark
        if ($rem ne '' && !&validremark($rem) && $fwhostsettings{'update'} ne 'on'){
                $errormessage.=$Lang::tr{'fwhost err remark'};
-               $fwhostsettings{'update'} = 'on';
-               $fwhostsettings{'remark'}=$fwhostsettings{'oldremark'};
-               &addgrp;
-               &viewtablegrp;
        }
        if ($fwhostsettings{'update'} eq 'on'){
                #check standard networks
@@ -659,7 +672,7 @@ if ($fwhostsettings{'ACTION'} eq 'savegrp')
                if($updcounter eq 'net'){
                        foreach my $key (keys %customnetwork) {
                                if($customnetwork{$key}[0] eq $fwhostsettings{'CUST_SRC_NET'}){
-                                       $customnetwork{$key}[3] = $customnetwork{$key}[3]+1;
+                                       $customnetwork{$key}[4] = $customnetwork{$key}[4]+1;
                                        last;
                                }
                        }
@@ -667,7 +680,7 @@ if ($fwhostsettings{'ACTION'} eq 'savegrp')
                }elsif($updcounter eq 'host'){
                        foreach my $key (keys %customhost) {
                                if ($customhost{$key}[0] eq $fwhostsettings{'CUST_SRC_HOST'}){
-                                       $customhost{$key}[3]=$customhost{$key}[3]+1;
+                                       $customhost{$key}[4]=$customhost{$key}[3]+1;
                                }
                        }
                        &General::writehasharray("$confighost", \%customhost);
@@ -852,6 +865,8 @@ if ($fwhostsettings{'ACTION'} eq 'delhost')
 }
 if ($fwhostsettings{'ACTION'} eq 'deletegrphost')
 {
+       my $grpremark;
+       my $grpname;
        &General::readhasharray("$configgrp", \%customgrp);
        foreach my $key (keys %customgrp){
                if($customgrp{$key}[0].",".$customgrp{$key}[1].",".$customgrp{$key}[2].",".$customgrp{$key}[3] eq $fwhostsettings{'delhost'}){
@@ -870,17 +885,23 @@ if ($fwhostsettings{'ACTION'} eq 'deletegrphost')
                                &General::readhasharray("$confighost", \%customhost);
                                foreach my $key1 (keys %customhost){
                                        if ($customhost{$key1}[0] eq $customgrp{$key}[2]){
-                                               $customhost{$key1}[3] = $customhost{$key1}[3]-1;
+                                               $customhost{$key1}[4] = $customhost{$key1}[4]-1;
                                                last;
                                        }
                                }
                                &General::writehasharray("$confighost", \%customhost);
                        }
+                       $grpname=$customgrp{$key}[0];
+                       $grpremark=$customgrp{$key}[1];
                        delete $customgrp{$key};
                }
        }
        &General::writehasharray("$configgrp", \%customgrp);
-       &rules;
+       if ($fwhostsettings{'grpcnt'} > 0){&rules;}
+       if ($fwhostsettings{'update'} eq 'on'){
+               $fwhostsettings{'remark'}= $grpremark;
+               $fwhostsettings{'grp_name'}=$grpname;
+       }
        &addgrp;
        &viewtablegrp;
 }
@@ -934,6 +955,8 @@ if ($fwhostsettings{'ACTION'} eq 'delservicegrp')
 }
 if ($fwhostsettings{'ACTION'} eq 'delgrpservice')
 {
+       my $grpname;
+       my $grpremark;
        &General::readhasharray("$configsrvgrp", \%customservicegrp);
        &General::readhasharray("$configsrv", \%customservice);
        foreach my $key (keys %customservicegrp){
@@ -947,11 +970,18 @@ if ($fwhostsettings{'ACTION'} eq 'delgrpservice')
                                }
                        }
                        &General::writehasharray("$configsrv", \%customservice);
-                       delete $customservicegrp{$key}
+                       $grpname=$customservicegrp{$key}[0];
+                       $grpremark=$customservicegrp{$key}[1];
+                       delete $customservicegrp{$key};
                }
        }
        &General::writehasharray("$configsrvgrp", \%customservicegrp);
        &rules;
+       if ($fwhostsettings{'updatesrvgrp'} eq 'on'){
+       #$fwhostsettings{'updatesrvgrp'}='on';
+               $fwhostsettings{'SRVGRP_NAME'}=$grpname;
+               $fwhostsettings{'SRVGRP_REMARK'}=$grpremark;
+       }
        &addservicegrp;
        &viewtableservicegrp;
        
@@ -983,7 +1013,7 @@ if ($fwhostsettings{'ACTION'} eq $Lang::tr{'fwhost newservicegrp'})
 if ($fwhostsettings{'ACTION'} eq 'changegrpremark')
 {
        &General::readhasharray("$configgrp", \%customgrp);
-       if ($fwhostsettings{'oldrem'} ne $fwhostsettings{'newrem'} && &validremark($fwhostsettings{'newrem'})){
+       if ($fwhostsettings{'oldrem'} ne $fwhostsettings{'newrem'} && (&validremark($fwhostsettings{'newrem'}) || $fwhostsettings{'newrem'} eq '')){
                foreach my $key (sort keys %customgrp)
                        {
                                #$customgrp{$key}[1]=~ s/\|/,/g;
@@ -1011,7 +1041,7 @@ if ($fwhostsettings{'ACTION'} eq 'changegrpremark')
 if ($fwhostsettings{'ACTION'} eq 'changesrvgrpremark')
 {
        &General::readhasharray("$configsrvgrp", \%customservicegrp );
-       if ($fwhostsettings{'oldsrvrem'} ne $fwhostsettings{'newsrvrem'} && &validremark($fwhostsettings{'newsrvrem'})){
+       if ($fwhostsettings{'oldsrvrem'} ne $fwhostsettings{'newsrvrem'} && (&validremark($fwhostsettings{'newsrvrem'}) || $fwhostsettings{'newsrvrem'} eq '')){
                foreach my $key (sort keys %customservicegrp)
                        {
                                #$customservicegrp{$key}[1]=~ s/\|/,/g;
@@ -1055,7 +1085,7 @@ END
        
                
        if (-f "${General::swroot}/fwhosts/reread"){
-               print "</tr><tr><td colspan='6'><input type='submit' name='ACTION' value='$Lang::tr{'fwdfw reread'}'>$Lang::tr{'fwhost reread'}</td>";
+               print "</tr><tr><td colspan='6'><input type='submit' name='ACTION' value='$Lang::tr{'fwdfw reread'}' style='font-face: Comic Sans MS; color: red; font-weight: bold;' >$Lang::tr{'fwhost reread'}</td>";
        }
                print"</tr></table></form>";    
 
@@ -1071,7 +1101,8 @@ sub addnet
        $fwhostsettings{'orgname'}=$fwhostsettings{'HOSTNAME'};
        print<<END;
        <table border='0' width='100%'><form method='post' style='display:inline'  >
-       <tr><td>$Lang::tr{'name'}:</td><td><input type='TEXT' name='HOSTNAME' id='textbox1' value='$fwhostsettings{'HOSTNAME'}' $fwhostsettings{'BLK_HOST'}><script>document.getElementById('textbox1').focus()</script></td><td>$Lang::tr{'fwhost netaddress'}</td><td><input type='TEXT' name='IP' value='$fwhostsettings{'IP'}' $fwhostsettings{'BLK_IP'} size='14'></td><td align='right'>$Lang::tr{'netmask'}:</td><td align='right'><input type='TEXT' name='SUBNET' value='$fwhostsettings{'SUBNET'}' $fwhostsettings{'BLK_IP'} size='14'></td></tr>
+       <tr><td>$Lang::tr{'name'}:</td><td><input type='TEXT' name='HOSTNAME' id='textbox1' value='$fwhostsettings{'HOSTNAME'}' $fwhostsettings{'BLK_HOST'}><script>document.getElementById('textbox1').focus()</script></td><td>$Lang::tr{'fwhost netaddress'}:</td><td><input type='TEXT' name='IP' value='$fwhostsettings{'IP'}' $fwhostsettings{'BLK_IP'} size='14'></td><td align='right'>$Lang::tr{'netmask'}:</td><td align='right'><input type='TEXT' name='SUBNET' value='$fwhostsettings{'SUBNET'}' $fwhostsettings{'BLK_IP'} size='14'></td></tr>
+       <tr><td>$Lang::tr{'remark'}:</td><td colspan='5'><input type='TEXT' name='NETREMARK' value='$fwhostsettings{'NETREMARK'}' size='64'></td></tr>
        <tr><td colspan='6'><hr></hr></td></tr><tr>
 END
        if ($fwhostsettings{'ACTION'} eq 'editnet' || $fwhostsettings{'error'} eq 'on')
@@ -1097,6 +1128,7 @@ END
        if ($fwhostsettings{'type'} eq 'mac'){print "<option value='mac' selected >MAC</option>";}else{print "<option value='mac' >MAC</option>";}
        print<<END;
        </option></select></td><td align='right' width='15%'>IP/MAC:</td><td align='right'><input type='TEXT' name='IP' value='$fwhostsettings{'IP'}' $fwhostsettings{'BLK_IP'} ></td></tr>
+       <tr><td>$Lang::tr{'remark'}:</td><td colspan='5'><input type='TEXT' name='HOSTREMARK' value='$fwhostsettings{'HOSTREMARK'}' size='64'></td></tr>
        <tr><td colspan='7'><br><br><b>$Lang::tr{'fwhost attention'}</b><br>$Lang::tr{'fwhost macwarn'}</td></tr>
        <tr><td colspan='7'><hr></hr></td></tr>
 END
@@ -1342,7 +1374,7 @@ sub viewtablenet
                }else{
                        print<<END;
                        <table border='0' width='100%'>
-                       <tr><td align='center'><b>$Lang::tr{'name'}</td><td align='center'><b>$Lang::tr{'fwhost netaddress'}</td><td align='center'><b>$Lang::tr{'netmask'}</td><td align='center'><b>$Lang::tr{'used'}</td><td></td><td width='3%'></td></tr>
+                       <tr><td align='center'><b>$Lang::tr{'name'}</td><td align='center'><b>$Lang::tr{'fwhost netaddress'}</td><td align='center'><b>$Lang::tr{'netmask'}</td><td align='center'><b>$Lang::tr{'remark'}</td><td align='center'><b>$Lang::tr{'used'}</td><td></td><td width='3%'></td></tr>
 END
                }
                my $count=0;
@@ -1357,15 +1389,16 @@ END
                                print" <tr bgcolor='$color{'color20'}'>";
                        }
                        print<<END;
-                       <td width='40%'><form method='post'>$customnetwork{$key}[0]</td><td width=25%'>$customnetwork{$key}[1]</td><td width='25%'>$customnetwork{$key}[2]</td><td align='center'>$customnetwork{$key}[3]x</td>
+                       <td width='20%'><form method='post'>$customnetwork{$key}[0]</td><td width=15%'>$customnetwork{$key}[1]</td><td width='15%'>$customnetwork{$key}[2]</td><td width='40%'>$customnetwork{$key}[3]</td><td align='center'>$customnetwork{$key}[4]x</td>
                        <td width='1%'><input type='image' src='/images/edit.gif' align='middle' alt=$Lang::tr{'edit'} title=$Lang::tr{'edit'} />
                        <input type='hidden' name='ACTION' value='editnet'>
                        <input type='hidden' name='HOSTNAME' value='$customnetwork{$key}[0]' />
                        <input type='hidden' name='IP' value='$customnetwork{$key}[1]' />
                        <input type='hidden' name='SUBNET' value='$customnetwork{$key}[2]' />
+                       <input type='hidden' name='NETREMARK' value='$customnetwork{$key}[3]' />
                        </td></form>
 END
-                       if($customnetwork{$key}[3] == '0')
+                       if($customnetwork{$key}[4] == '0')
                        {
                                print"<td width='1%'><form method='post'><input type='image' src='/images/delete.gif' align='middle' alt=$Lang::tr{'delete'} title=$Lang::tr{'delete'} /><input type='hidden' name='ACTION' value='delnet' /><input type='hidden' name='key' value='$customnetwork{$key}[0]' /></td></form></tr>";
                        }else{
@@ -1389,7 +1422,7 @@ sub viewtablehost
                }else{
                print<<END;
                <table border='0' width='100%'>
-               <tr><td align='center'><b>$Lang::tr{'name'}</td><td align='center'><b>$Lang::tr{'fwhost ip_mac'}</td><td align='center'><b>$Lang::tr{'used'}</td><td></td><td width='3%'></td></tr>
+               <tr><td align='center'><b>$Lang::tr{'name'}</td><td align='center'><b>$Lang::tr{'fwhost ip_mac'}</td><td align='center'><b>$Lang::tr{'remark'}</td><td align='center'><b>$Lang::tr{'used'}</td><td></td><td width='3%'></td></tr>
 END
        }
                my $count=0;
@@ -1399,17 +1432,18 @@ END
                        }elsif ($count % 2){ print" <tr bgcolor='$color{'color22'}'>";}
                        else{            print" <tr bgcolor='$color{'color20'}'>";}
                        my ($ip,$sub)=split(/\//,$customhost{$key}[2]);
-                       $customhost{$key}[3]=~s/\s+//g;
+                       $customhost{$key}[4]=~s/\s+//g;
                        print<<END;
-                       <td width='40%'><form method='post'>$customhost{$key}[0]</td><td width='50%'>$ip</td><td align='center'>$customhost{$key}[3]x</td>
+                       <td width='20%'><form method='post'>$customhost{$key}[0]</td><td width='20%'>$ip</td><td width='50%'>$customhost{$key}[3]</td><td align='center'>$customhost{$key}[4]x</td>
                        <td width='1%'><input type='image' src='/images/edit.gif' align='middle' alt=$Lang::tr{'edit'} title=$Lang::tr{'edit'} />
                        <input type='hidden' name='ACTION' value='edithost' />
                        <input type='hidden' name='HOSTNAME' value='$customhost{$key}[0]' />
                        <input type='hidden' name='IP' value='$ip' />
                        <input type='hidden' name='type' value='$customhost{$key}[1]' />
+                       <input type='hidden' name='HOSTREMARK' value='$customhost{$key}[3]' />
                        </td></form>
 END
-                       if($customhost{$key}[3] == '0')
+                       if($customhost{$key}[4] == '0')
                        {
                                print"<td width='1%'><form method='post'><input type='image' src='/images/delete.gif' align='middle' alt=$Lang::tr{'delete'} title=$Lang::tr{'delete'} /><input type='hidden' name='ACTION' value='delhost' /><input type='hidden' name='key' value='$customhost{$key}[0]' /></td></form></tr>";
                        }else{
@@ -1437,6 +1471,7 @@ sub viewtablegrp
        my $grpname;
        my $remark;
        my $number;
+       my $delflag;
        if (!keys %customgrp) 
        { 
                print "<center><b>$Lang::tr{'fwhost empty'}</b>"; 
@@ -1444,6 +1479,16 @@ sub viewtablegrp
                foreach my $key (sort { uc($customgrp{$a}[0]) cmp uc($customgrp{$b}[0]) } sort { uc($customgrp{$a}[2]) cmp uc($customgrp{$b}[2]) } keys %customgrp){
                        $count++;
                        if ($helper ne $customgrp{$key}[0]){
+                               $delflag='0';
+                               foreach my $key1 (sort { uc($customgrp{$a}[0]) cmp uc($customgrp{$b}[0]) } sort { uc($customgrp{$a}[2]) cmp uc($customgrp{$b}[2]) } keys %customgrp){
+                                       if ($customgrp{$key}[0] eq $customgrp{$key1}[0])
+                                       {
+                                               $delflag++;
+                                       }
+                                       if($delflag > 1){
+                                               last;
+                                       }
+                               }
                                $number=1;
                                if ($customgrp{$key}[2] eq "none"){$customgrp{$key}[2]=$Lang::tr{'fwhost empty'};}
                                $grpname=$customgrp{$key}[0];
@@ -1459,6 +1504,7 @@ sub viewtablegrp
                                print"<form method='post' style='display:inline'><input type='image' src='/images/edit.gif' alt=$Lang::tr{'edit'} title=$Lang::tr{'edit'} align='right' /><input type='hidden' name='grp_name' value='$grpname' ><input type='hidden' name='remark' value='$remark' ><input type='hidden' name='ACTION' value='editgrp'></form>";
                                print"<table width='100%' style='border: 1px solid  #000000;' rules='none' ><tr><td align='center'><b>Name</b></td><td align='center'><b>$Lang::tr{'ip address'}</b></td><td align='center' width='25%'><b>$Lang::tr{'fwhost type'}</td></tr>";
                        }
+                       
                        if ( ($fwhostsettings{'ACTION'} eq 'editgrp' || $fwhostsettings{'update'} ne '') && $fwhostsettings{'grp_name'} eq $customgrp{$key}[0]) {
                                print" <tr bgcolor='${Header::colouryellow}'>";
                        }elsif ($count %2 == 0){
@@ -1479,10 +1525,10 @@ sub viewtablegrp
                        }else{
                                print"<td>$ip</td><td>$customgrp{$key}[3]</td><td width='1%'><form method='post'>";
                        }
-                       if ($number > 1 && $ip ne ''){
+                       if ($delflag > '1' && $ip ne ''){
                                print"<input type='image' src='/images/delete.gif' align='middle' alt=$Lang::tr{'delete'} title=$Lang::tr{'delete'} />";
                        }
-                       print"<input type='hidden' name='ACTION' value='deletegrphost'><input type='hidden' name='delhost' value='$grpname,$remark,$customgrp{$key}[2],$customgrp{$key}[3]'></form></td></tr>";
+                       print"<input type='hidden' name='ACTION' value='deletegrphost'><input type='hidden' name='grpcnt' value='$customgrp{$key}[4]'><input type='hidden' name='update' value='$fwhostsettings{'update'}'><input type='hidden' name='delhost' value='$grpname,$remark,$customgrp{$key}[2],$customgrp{$key}[3]'></form></td></tr>";
                        
                        $helper=$customgrp{$key}[0];
                        $number++;
@@ -1542,6 +1588,7 @@ sub viewtableservicegrp
        my $helper;
        my $port;
        my $protocol;
+       my $delflag;
        if (! -z $configsrvgrp){
                &Header::openbox('100%', 'left', $Lang::tr{'fwhost cust srvgrp'});
                &General::readhasharray("$configsrvgrp", \%customservicegrp);
@@ -1550,9 +1597,21 @@ sub viewtableservicegrp
                foreach my $key (sort { uc($customservicegrp{$a}[0]) cmp uc($customservicegrp{$b}[0])||  $a <=> $b } keys %customservicegrp){
                        $count++;
                        if ($helper ne $customservicegrp{$key}[0]){
+                               $delflag=0;
+                               foreach my $key1 (sort { uc($customservicegrp{$a}[0]) cmp uc($customservicegrp{$b}[0]) } sort { uc($customservicegrp{$a}[2]) cmp uc($customservicegrp{$b}[2]) } keys %customservicegrp){
+                                       if ($customservicegrp{$key}[0] eq $customservicegrp{$key1}[0])
+                                       {
+                                               $delflag++;
+                                       }
+                                       if($delflag > 1){
+                                               last;
+                                       }
+                               }
                                $grpname=$customservicegrp{$key}[0];
                                if ($customservicegrp{$key}[2] eq "none"){
                                        $customservicegrp{$key}[2]=$Lang::tr{'fwhost empty'};
+                                       $port='';
+                                       $protocol='';
                                }
                                $remark="$customservicegrp{$key}[1]";
                                if($count >=2){print"</table>";}
@@ -1585,7 +1644,7 @@ sub viewtableservicegrp
                        if ($number gt '1'){
                                print"<input type='image' src='/images/delete.gif' align='middle' alt=$Lang::tr{'delete'} title=$Lang::tr{'delete'} />";
                        }
-                       print"<input type='hidden' name='ACTION' value='delgrpservice'><input type='hidden' name='delsrvfromgrp' value='$grpname,$remark,$customservicegrp{$key}[2],$customservicegrp{$key}[3]'></form></td></tr>";
+                       print"<input type='hidden' name='ACTION' value='delgrpservice'><input type='hidden' name='updatesrvgrp' value='$fwhostsettings{'updatesrvgrp'}'><input type='hidden' name='delsrvfromgrp' value='$grpname,$remark,$customservicegrp{$key}[2],$customservicegrp{$key}[3]'></form></td></tr>";
                        $helper=$customservicegrp{$key}[0];
                }
                print"</table>";
@@ -1708,10 +1767,9 @@ sub deletefromgrp
 }
 sub plausicheck
 {
-       
        my $edit=shift;
        #check hostname
-       if (!&General::validhostname($fwhostsettings{'HOSTNAME'}))
+       if (!&validhostname($fwhostsettings{'HOSTNAME'}))
        {
                $errormessage=$errormessage.$Lang::tr{'fwhost err name'};
                $fwhostsettings{'BLK_IP'}='readonly';
@@ -1719,7 +1777,6 @@ sub plausicheck
                if ($fwhostsettings{'update'} eq 'on'){$fwhostsettings{'ACTION'}=$edit;}
        }
        #check if name collides with CCD Netname
-
        &General::readhasharray("$configccdnet", \%ccdnet);
        foreach my $key (keys %ccdnet) {
                if($ccdnet{$key}[0] eq $fwhostsettings{'HOSTNAME'}){
@@ -1729,7 +1786,6 @@ sub plausicheck
                        last;
                }
        }
-
        #check if IP collides with CCD NetIP
        if ($fwhostsettings{'type'} ne 'mac'){
                &General::readhasharray("$configccdnet", \%ccdnet);
@@ -1744,9 +1800,6 @@ sub plausicheck
                        }
                }
        }
-       
-       
-       
        #check if name collides with CCD Hostname
        &General::readhasharray("$configccdhost", \%ccdhost);
        foreach my $key (keys %ccdhost) {
@@ -1796,8 +1849,6 @@ sub plausicheck
        {
                $errormessage=$errormessage."<br>".$Lang::tr{'fwhost err ipcheck'};
        }
-               
-       
        return;
 }
 sub getipforgroup
@@ -1915,6 +1966,7 @@ sub rules
 {
        if (!-f "${General::swroot}/fwhosts/reread"){
                system("touch ${General::swroot}/fwhosts/reread");
+               system("touch ${General::swroot}/forward/reread");
        }
 }
 sub reread_rules
@@ -1922,6 +1974,7 @@ sub reread_rules
        system ("/usr/local/bin/forwardfwctrl");
        if ( -f "${General::swroot}/fwhosts/reread"){
                system("rm ${General::swroot}/fwhosts/reread");
+               system("rm ${General::swroot}/forward/reread");
        }
        
 }
@@ -2020,7 +2073,7 @@ sub validhostname
        if (length ($hostname) < 1 || length ($hostname) > 63) {
                return 0;}
        # Only valid characters are a-z, A-Z, 0-9 and -
-       if ($hostname !~ /^[a-zA-ZäöüÖÄÜ0-9-_()\/\s]*$/) {
+       if ($hostname !~ /^[a-zA-ZäöüÖÄÜ0-9-_.;()\/\s]*$/) {
                return 0;}
        # First character can only be a letter or a digit
        if (substr ($hostname, 0, 1) !~ /^[a-zA-ZöäüÖÄÜ0-9]*$/) {
@@ -2039,13 +2092,13 @@ sub validremark
        if (length ($remark) < 1 || length ($remark) > 255) {
                return 0;}
        # Only valid characters are a-z, A-Z, 0-9 and -
-       if ($remark !~ /^[a-zäöüA-ZÖÄÜ0-9-.:;_\/\s]*$/) {
+       if ($remark !~ /^[a-zäöüA-ZÖÄÜ0-9-.:;\|_()\/\s]*$/) {
                return 0;}
        # First character can only be a letter or a digit
        if (substr ($remark, 0, 1) !~ /^[a-zäöüA-ZÖÄÜ0-9]*$/) {
                return 0;}
        # Last character can only be a letter or a digit
-       if (substr ($remark, -1, 1) !~ /^[a-zöäüA-ZÖÄÜ0-9.]*$/) {
+       if (substr ($remark, -1, 1) !~ /^[a-zöäüA-ZÖÄÜ0-9.:;_)]*$/) {
                return 0;}
        return 1;
 }