Merge branch 'master' into next

Conflicts:
	doc/language_issues.tr
This commit is contained in:
Michael Tremer
2014-04-11 15:18:50 +02:00
37 changed files with 12427 additions and 431 deletions

View File

@@ -34,6 +34,13 @@ require '/var/ipfire/general-functions.pl'; # replace /var/ipcop with /var/ipcop
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
my $configfwdfw = "${General::swroot}/firewall/config";
my $configinput = "${General::swroot}/firewall/input";
my $configoutgoing = "${General::swroot}/firewall/outgoing";
my %input=();
my %forward=();
my %output=();
#workaround to suppress a warning when a variable is used only once
my @dummy = ( ${Header::colouryellow} );
@dummy = ( ${Header::table1colour} );
@@ -90,7 +97,6 @@ if ($settings{'ACTION'} eq $Lang::tr{'save'}) {
#
#Validate static Settings1 here
#
unless ($errormessage) { # Everything is ok, save settings
#map (delete ($settings{$_}) ,(@nosaved,'ACTION','KEY1'));# Must never be saved
#&General::writehash($setting, \%settings); # Save good settings
@@ -146,6 +152,12 @@ if ($settings{'ACTION'} eq $Lang::tr{'add'}) {
$errormessage = $Lang::tr{'duplicate ip'} . ' (RED)';
$spacer=" & ";
}
#Check if we have an emtpy name
if (!$settings{'NAME'}){
$errormessage=$Lang::tr{'fwhost err name1'};
}elsif(! &General::validfqdn($settings{'NAME'}) && ! &General::validhostname($settings{'NAME'})){
$errormessage=$Lang::tr{'invalid hostname'};
}
my $idx=0;
foreach my $line (@current) {
chomp ($line);
@@ -162,6 +174,38 @@ if ($settings{'ACTION'} eq $Lang::tr{'add'}) {
}
$idx++;
}
#Update firewallrules if aliasname is changed
if ($settings{'OLDNAME'} ne $settings {'NAME'}){
&General::readhasharray("$configfwdfw", \%forward);
&General::readhasharray("$configinput", \%input);
&General::readhasharray("$configoutgoing", \%output);
#Check FORWARD
foreach my $forwardkey (sort keys %forward){
if ($forward{$forwardkey}[29] eq $settings{'OLDNAME'}){
$forward{$forwardkey}[29] = $settings {'NAME'};
}
}
&General::writehasharray($configfwdfw, \%forward);
#Check INPUT
foreach my $inputkey (sort keys %input){
if ($input{$inputkey}[6] eq $settings{'OLDNAME'}){
$input{$inputkey}[6] = $settings {'NAME'};
}
}
&General::writehasharray($configinput, \%input);
#Check OUTPUT
foreach my $outputkey (sort keys %output){
if ($output{$outputkey}[4] eq $settings{'OLDNAME'}){
$output{$outputkey}[4] = $settings {'NAME'};
}
}
&General::writehasharray($configoutgoing, \%output);
&General::firewall_config_changed;
}
#If Alias IP has changed, set firewall_config_changed
if($settings{'OLDIP'} ne $settings{'IP'} && $settings{'OLDIP'}){
&General::firewall_config_changed;
}
unless ($errormessage) {
if ($settings{'KEY1'} eq '') { #add or edit ?
unshift (@current, "$settings{'IP'},$settings{'ENABLED'},$settings{'NAME'}\n");
@@ -275,9 +319,11 @@ if ($settings{'KEY1'} ne '') {
print <<END
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='KEY1' value='$settings{'KEY1'}' />
<input type='hidden' name='OLDNAME' value='$settings{'NAME'}' />
<input type='hidden' name='OLDIP' value='$settings{'IP'}' />
<table style='width:100%;'>
<tr>
<td class='base' style='color:${Header::colourred};'>$Lang::tr{'name'}:&nbsp;<img src='/blob.gif' alt='*' /></td>
<td class='base' style='color:${Header::colourred};'>$Lang::tr{'name'}:</td>
<td><input type='text' name='NAME' value='$settings{'NAME'}' size='32' /></td>
<td class='base' style='text-align:right; color:${Header::colourred};'>$Lang::tr{'alias ip'}:&nbsp;</td>
<td><input type='text' name='IP' value='$settings{'IP'}' size='16' /></td>
@@ -289,7 +335,6 @@ print <<END
<hr />
<table style='width:100%;'>
<tr>
<td><img src='/blob.gif' alt='*' />&nbsp;$Lang::tr{'this field may be blank'}</td>
<td style='text-align:right;'><input type='hidden' name='ACTION' value='$Lang::tr{'add'}' /><input type='submit' name='SUBMIT' value='$buttontext' /></td>
</tr>
</table>

View File

@@ -311,10 +311,10 @@ print <<END
<tr><td width='15%' class='base'>$Lang::tr{'ConnSched action'}</td><td>
<input type='radio' value='CONNECT' name='ACTION_ACTION' $checked_connect />&nbsp;<select name='ACTION_CONNECT'>
<option value='reconnect' $selected{'reconnect'}>$Lang::tr{'ConnSched reconnect'}</option>
<option value='dial' $selected{'dial'}>$Lang::tr{'dial'}</option>
<option value='hangup' $selected{'hangup'}>$Lang::tr{'hangup'}</option>
<option value='reboot' $selected{'reboot'}>$Lang::tr{'reboot'}</option>
<option value='shutdown' $selected{'shutdown'}>$Lang::tr{'shutdown'}</option>
<option value='dial' $selected{'dial'}>$Lang::tr{'ConnSched dial'}</option>
<option value='hangup' $selected{'hangup'}>$Lang::tr{'ConnSched hangup'}</option>
<option value='reboot' $selected{'reboot'}>$Lang::tr{'ConnSched reboot'}</option>
<option value='shutdown' $selected{'shutdown'}>$Lang::tr{'ConnSched shutdown'}</option>
<option value='ipsecstart' $selected{'ipsecstart'}>$Lang::tr{'ConnSched ipsecstart'}</option>
<option value='ipsecstop' $selected{'ipsecstop'}>$Lang::tr{'ConnSched ipsecstop'}</option>
</select></td></tr>

View File

@@ -1260,10 +1260,8 @@ sub get_serviceports
my $name=shift;
&General::readhasharray("$configsrv", \%customservice);
&General::readhasharray("$configsrvgrp", \%customservicegrp);
my $tcp;
my $udp;
my $icmp;
@protocols=();
my @specprot=("IPIP","IPV6","IGMP","GRE","AH","ESP");
if($type eq 'service'){
foreach my $key (sort { ncmp($customservice{$a}[0],$customservice{$b}[0]) } keys %customservice){
if ($customservice{$key}[0] eq $name){
@@ -1273,33 +1271,19 @@ sub get_serviceports
}elsif($type eq 'group'){
foreach my $key (sort { ncmp($customservicegrp{$a}[0],$customservicegrp{$b}[0]) } keys %customservicegrp){
if ($customservicegrp{$key}[0] eq $name){
foreach my $key1 (sort { ncmp($customservice{$a}[0],$customservice{$b}[0]) } keys %customservice){
if ($customservice{$key1}[0] eq $customservicegrp{$key}[2]){
if($customservice{$key1}[2] eq 'TCP'){
$tcp='TCP';
}elsif($customservice{$key1}[2] eq 'ICMP'){
$icmp='ICMP';
}elsif($customservice{$key1}[2] eq 'UDP'){
$udp='UDP';
if ($customservicegrp{$key}[2] ~~ @specprot){
push (@protocols," ".$customservicegrp{$key}[2]);
}else{
foreach my $key1 (sort { ncmp($customservice{$a}[0],$customservice{$b}[0]) } keys %customservice){
if ($customservice{$key1}[0] eq $customservicegrp{$key}[2]){
if (!grep(/$customservice{$key1}[2]/, @protocols)){
push (@protocols,$customservice{$key1}[2]);}
}
}
}
}
}
}
if($tcp && $udp && $icmp){
push (@protocols,"TCP,UDP, <br>ICMP");
return @protocols;
}
if($tcp){
push (@protocols,"TCP");
}
if($udp){
push (@protocols,"UDP");
}
if($icmp){
push (@protocols,"ICMP");
}
return @protocols;
}
sub getcolor
@@ -1401,11 +1385,13 @@ sub getcolor
}
#Check if IP is part of a IPsec N2N network
foreach my $key (sort keys %ipsecconf){
my ($a,$b) = split("/",$ipsecconf{$key}[11]);
$b=&General::iporsubtodec($b);
if (&General::IpInSubnet($c,$a,$b)){
$tdcolor="style='background-color: $Header::colourvpn;color:white;'";
return;
if ($ipsecconf{$key}[11]){
my ($a,$b) = split("/",$ipsecconf{$key}[11]);
$b=&General::iporsubtodec($b);
if (&General::IpInSubnet($c,$a,$b)){
$tdcolor="style='background-color: $Header::colourvpn;color:white;'";
return;
}
}
}
}
@@ -1611,7 +1597,7 @@ END
if (! -z "${General::swroot}/ethernet/aliases"){
foreach my $alias (sort keys %aliases)
{
print "<option value='$alias' $selected{'ipfire'}{$alias}>$alias</option>";
print "<option value='$alias' $selected{'ipfire_src'}{$alias}>$alias</option>";
}
}
print<<END;
@@ -2484,7 +2470,7 @@ END
push (@protocols,$Lang::tr{'all'});
}
my $protz=join(",",@protocols);
my $protz=join(", ",@protocols);
if($protz eq 'ICMP' && $$hash{$key}[9] ne 'All ICMP-Types' && $$hash{$key}[14] ne 'cust_srvgrp'){
&General::readhasharray("${General::swroot}/fwhosts/icmp-types", \%icmptypes);
foreach my $keyicmp (sort { ncmp($icmptypes{$a}[0],$icmptypes{$b}[0]) }keys %icmptypes){
@@ -2493,6 +2479,8 @@ END
last;
}
}
}elsif($#protocols gt '3'){
print"<td align='center'><span title='$protz'>$Lang::tr{'fwdfw many'}</span></td>";
}else{
print"<td align='center'>$protz</td>";
}

View File

@@ -66,7 +66,6 @@ my $fwconfigfwd = "${General::swroot}/firewall/config";
my $fwconfiginp = "${General::swroot}/firewall/input";
my $fwconfigout = "${General::swroot}/firewall/outgoing";
my $configovpn = "${General::swroot}/ovpn/settings";
my $tdcolor='';
my $configipsecrw = "${General::swroot}/vpn/settings";
unless (-e $confignet) { system("touch $confignet"); }
@@ -1624,6 +1623,7 @@ sub getcolor
my $c=shift;
my $sip;
my $scidr;
my $tdcolor='';
#Check if MAC
if (&General::validmac($c)){ return $c;}
@@ -1688,10 +1688,13 @@ sub getcolor
#Check if IP is part of a IPsec N2N network
foreach my $key (sort keys %ipsecconf){
my ($a,$b) = split("/",$ipsecconf{$key}[11]);
if (&General::IpInSubnet($sip,$a,$b)){
$tdcolor="<font style='color: $Header::colourvpn;'>$c</font>";
return $tdcolor;
if ($ipsecconf{$key}[11]){
my ($a,$b) = split("/",$ipsecconf{$key}[11]);
$b=&General::iporsubtodec($b);
if (&General::IpInSubnet($sip,$a,$b)){
$tdcolor="<font style='color: $Header::colourvpn;'>$c</font>";
return $tdcolor;
}
}
}
return "$c";

View File

@@ -152,7 +152,7 @@ END
for(my $i = 1; $i <= $#iostat1; $i++){
if ( $i eq '1' ){
print "<tr><td align='center' class='boldbase'><b>$Lang::tr{'device'}</b></td><td align='center' class='boldbase'><b>$Lang::tr{'MB read'}</b></td><td align='center' class='boldbase'><b>$Lang::{'MB writen'}</b></td></tr>";
print "<tr><td align='center' class='boldbase'><b>$Lang::tr{'device'}</b></td><td align='center' class='boldbase'><b>$Lang::tr{'MB read'}</b></td><td align='center' class='boldbase'><b>$Lang::{'MB written'}</b></td></tr>";
}else{
print "<tr><td align='center'>$iostat1[$i]</td><td align='center'>$iostat2[$i]</td><td align='center'>$iostat3[$i]</td></tr>";
}