mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
Merge remote-tracking branch 'amarx/fw-checksubnet' into next
This commit is contained in:
@@ -291,42 +291,13 @@ if ($fwhostsettings{'ACTION'} eq 'savenet' )
|
||||
$errormessage=$errormessage.$Lang::tr{'fwhost err sub32'};
|
||||
}
|
||||
if($fwhostsettings{'error'} ne 'on'){
|
||||
#check if we use one of ipfire's networks (green,orange,blue)
|
||||
if (($ownnet{'GREEN_NETADDRESS'} ne '' && $ownnet{'GREEN_NETADDRESS'} ne '0.0.0.0') && ($fwhostsettings{'IP'} eq $ownnet{'GREEN_NETADDRESS'} && $fwhostsettings{'SUBNET'} eq $ownnet{'GREEN_NETMASK'}))
|
||||
{
|
||||
$errormessage=$errormessage.$Lang::tr{'ccd err green'}."<br>";
|
||||
$fwhostsettings{'HOSTNAME'} = $fwhostsettings{'orgname'};
|
||||
if ($fwhostsettings{'update'} eq 'on'){$fwhostsettings{'ACTION'}='editnet';}
|
||||
}
|
||||
if (($ownnet{'ORANGE_NETADDRESS'} ne '' && $ownnet{'ORANGE_NETADDRESS'} ne '0.0.0.0') && ($fwhostsettings{'IP'} eq $ownnet{'ORANGE_NETADDRESS'} && $fwhostsettings{'SUBNET'} eq $ownnet{'ORANGE_NETMASK'}))
|
||||
{
|
||||
$errormessage=$errormessage.$Lang::tr{'ccd err orange'}."<br>";
|
||||
$fwhostsettings{'HOSTNAME'} = $fwhostsettings{'orgname'};
|
||||
if ($fwhostsettings{'update'} eq 'on'){$fwhostsettings{'ACTION'}='editnet';}
|
||||
}
|
||||
if (($ownnet{'BLUE_NETADDRESS'} ne '' && $ownnet{'BLUE_NETADDRESS'} ne '0.0.0.0') && ($fwhostsettings{'IP'} eq $ownnet{'BLUE_NETADDRESS'} && $fwhostsettings{'SUBNET'} eq $ownnet{'BLUE_NETMASK'}))
|
||||
{
|
||||
$errormessage=$errormessage.$Lang::tr{'ccd err blue'}."<br>";
|
||||
$fwhostsettings{'HOSTNAME'} = $fwhostsettings{'orgname'};
|
||||
if ($fwhostsettings{'update'} eq 'on'){$fwhostsettings{'ACTION'}='editnet';}
|
||||
}
|
||||
if (($ownnet{'RED_NETADDRESS'} ne '' && $ownnet{'RED_NETADDRESS'} ne '0.0.0.0') && ($fwhostsettings{'IP'} eq $ownnet{'RED_NETADDRESS'} && $fwhostsettings{'SUBNET'} eq $ownnet{'RED_NETMASK'}))
|
||||
{
|
||||
$errormessage=$errormessage.$Lang::tr{'ccd err red'}."<br>";
|
||||
$fwhostsettings{'HOSTNAME'} = $fwhostsettings{'orgname'};
|
||||
if ($fwhostsettings{'update'} eq 'on'){$fwhostsettings{'ACTION'}='editnet';}
|
||||
}
|
||||
my $fullip="$fwhostsettings{'IP'}/".&General::iporsubtocidr($fwhostsettings{'SUBNET'});
|
||||
$errormessage=$errormessage.&General::checksubnets($fwhostsettings{'HOSTNAME'},$fullip,"");
|
||||
}
|
||||
#only check plausi when no error till now
|
||||
if (!$errormessage){
|
||||
&plausicheck("editnet");
|
||||
}
|
||||
#check if network ip is part of an already used one
|
||||
if(&checksubnet(\%customnetwork))
|
||||
{
|
||||
$errormessage=$errormessage.$Lang::tr{'fwhost err partofnet'};
|
||||
$fwhostsettings{'HOSTNAME'} = $fwhostsettings{'orgname'};
|
||||
}
|
||||
if($fwhostsettings{'actualize'} eq 'on' && $fwhostsettings{'newnet'} ne 'on' && $errormessage)
|
||||
{
|
||||
$fwhostsettings{'actualize'} = '';
|
||||
@@ -338,9 +309,8 @@ if ($fwhostsettings{'ACTION'} eq 'savenet' )
|
||||
$customnetwork{$key}[3] = $fwhostsettings{'orgnetremark'};
|
||||
&General::writehasharray("$confignet", \%customnetwork);
|
||||
undef %customnetwork;
|
||||
}
|
||||
}
|
||||
if (!$errormessage){
|
||||
|
||||
&General::readhasharray("$confignet", \%customnetwork);
|
||||
if ($fwhostsettings{'ACTION'} eq 'updatenet'){
|
||||
if ($fwhostsettings{'update'} == '0'){
|
||||
@@ -392,7 +362,7 @@ if ($fwhostsettings{'ACTION'} eq 'savenet' )
|
||||
&General::writehasharray("$fwconfiginp", \%fwinp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
my $key = &General::findhasharraykey (\%customnetwork);
|
||||
foreach my $i (0 .. 3) { $customnetwork{$key}[$i] = "";}
|
||||
$fwhostsettings{'SUBNET'} = &General::iporsubtocidr($fwhostsettings{'SUBNET'});
|
||||
@@ -416,7 +386,8 @@ if ($fwhostsettings{'ACTION'} eq 'savenet' )
|
||||
}
|
||||
&addnet;
|
||||
&viewtablenet;
|
||||
}else {
|
||||
}else{
|
||||
$fwhostsettings{'HOSTNAME'} = $fwhostsettings{'orgname'};
|
||||
&addnet;
|
||||
&viewtablenet;
|
||||
}
|
||||
|
||||
@@ -1111,7 +1111,7 @@
|
||||
'fwhost err remark' => 'Ungültige Bemerkung. Erlaubte Zeichen: Klein- und Großbuchstaben, Bindestrich, Unterstrich, Runde Klammern, Semikolon, Punkt.',
|
||||
'fwhost err srv exists' => 'Ein Service mit diesem Namen existiert bereits',
|
||||
'fwhost err srvexist' => 'Dieser Dienst ist bereits in der Gruppe',
|
||||
'fwhost err sub32' => 'Bitte einen einzelnen Host hinzufügen, keine Netzwerke',
|
||||
'fwhost err sub32' => 'Bitte Netzwerke hinzufügen, keinen einzelnen Host',
|
||||
'fwhost green' => 'Grün',
|
||||
'fwhost hint' => 'Hinweis',
|
||||
'fwhost hosts' => 'Firewall-Hosts',
|
||||
|
||||
@@ -1138,7 +1138,7 @@
|
||||
'fwhost err remark' => 'Invalid remark. Allowed characters: Upper- and lowercase letters, digits, space, dash, braces, semicolon, pipe and dot.',
|
||||
'fwhost err srv exists' => 'A service with the same name already exists',
|
||||
'fwhost err srvexist' => 'This service already exists in the group',
|
||||
'fwhost err sub32' => 'Please add a single host, not a network.',
|
||||
'fwhost err sub32' => 'Please add a network, not a single host',
|
||||
'fwhost green' => 'Green',
|
||||
'fwhost hint' => 'Note',
|
||||
'fwhost hosts' => 'Firewall Hosts',
|
||||
|
||||
Reference in New Issue
Block a user