From: Stefan Schantl Date: Fri, 12 Jun 2020 17:31:41 +0000 (+0200) Subject: firewall.cgi: Rework to use location-functions.pl X-Git-Tag: v2.25-core148~39 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=10ef824bb7e9040d8e5e773785237b90de7dcd4c firewall.cgi: Rework to use location-functions.pl Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi index f54bf6f6c7..1483e779ff 100644 --- a/html/cgi-bin/firewall.cgi +++ b/html/cgi-bin/firewall.cgi @@ -35,7 +35,7 @@ require '/var/ipfire/general-functions.pl'; require '/var/ipfire/network-functions.pl'; require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; -require "${General::swroot}/geoip-functions.pl"; +require "${General::swroot}/location-functions.pl"; require "/usr/lib/firewall/firewall-lib.pl"; unless (-d "${General::swroot}/firewall") { system("mkdir ${General::swroot}/firewall"); } @@ -50,7 +50,7 @@ my %defaultNetworks=(); my %netsettings=(); my %customhost=(); my %customgrp=(); -my %customgeoipgrp=(); +my %customlocationgrp=(); my %customnetworks=(); my %customservice=(); my %customservicegrp=(); @@ -78,7 +78,7 @@ my $color; my $confignet = "${General::swroot}/fwhosts/customnetworks"; my $confighost = "${General::swroot}/fwhosts/customhosts"; my $configgrp = "${General::swroot}/fwhosts/customgroups"; -my $configgeoipgrp = "${General::swroot}/fwhosts/customgeoipgrp"; +my $configlocationgrp = "${General::swroot}/fwhosts/customlocationgrp"; my $configsrv = "${General::swroot}/fwhosts/customservices"; my $configsrvgrp = "${General::swroot}/fwhosts/customservicegrp"; my $configccdnet = "${General::swroot}/ovpn/ccd.conf"; @@ -1071,41 +1071,41 @@ END } print""; } - # geoip locations / groups. - my @geoip_locations = &fwlib::get_geoip_locations(); + # Locations / groups. + my @locations = &fwlib::get_locations(); print "\n"; - print "\n"; - print "$Lang::tr{'geoip'}\n"; - print "\n"; + print "$Lang::tr{'location'}\n"; + print "\n"; #End left table. start right table (vpn) @@ -1476,7 +1476,7 @@ sub newrule &General::readhasharray("$confighost", \%customhost); &General::readhasharray("$configccdhost", \%ccdhost); &General::readhasharray("$configgrp", \%customgrp); - &General::readhasharray("$configgeoipgrp", \%customgeoipgrp); + &General::readhasharray("$configlocationgrp", \%customlocationgrp); &General::readhasharray("$configipsec", \%ipsecconf); &General::get_aliases(\%aliases); my %checked=(); @@ -2611,12 +2611,12 @@ END }else{ print $$hash{$key}[4]; } - }elsif ($$hash{$key}[3] eq 'cust_geoip_src') { + }elsif ($$hash{$key}[3] eq 'cust_location_src') { my ($split1,$split2) = split(":", $$hash{$key}[4]); if ($split2) { print "$split2\n"; }else{ - print "$Lang::tr{'geoip'}: $$hash{$key}[4]\n"; + print "$Lang::tr{'location'}: $$hash{$key}[4]\n"; } }elsif ($$hash{$key}[4] eq 'RED1'){ print "$ipfireiface $Lang::tr{'fwdfw red'}"; @@ -2699,12 +2699,12 @@ END }else{ print $$hash{$key}[6]; } - }elsif ($$hash{$key}[5] eq 'cust_geoip_tgt') { + }elsif ($$hash{$key}[5] eq 'cust_location_tgt') { my ($split1,$split2) = split(":", $$hash{$key}[6]); if ($split2) { print "$split2\n"; }else{ - print "$Lang::tr{'geoip'}: $$hash{$key}[6]\n"; + print "$Lang::tr{'location'}: $$hash{$key}[6]\n"; } }elsif ($$hash{$key}[5] eq 'tgt_addr'){ my ($split1,$split2) = split("/",$$hash{$key}[6]);