--- /home/rwb/IPFire/ipfire-2.x/build/srv/web/ipfire/cgi-bin/geoip-block.cgi 2019-01-31 19:17:48.948676928 +0000 +++ /home/rwb/IPFire/ipfire-2.x/build/srv/web/ipfire/cgi-bin/geoip-block.cgi.dev 2019-02-10 15:24:57.191920078 +0000 @@ -59,6 +59,13 @@ } else { $settings{'GEOIPBLOCK_ENABLED'} = "off"; } + + # check if logging is required + if (exists $cgiparams{'LOG_ENABLED'}) { + $settings{'LOG_ENABLED'} = "on"; + } else { + $settings{'LOG_ENABLED'} = "off"; + } # Loop through our locations array to prevent from # non existing countries or code. @@ -91,22 +98,41 @@ } # Checkbox pre-selection. -my $checked; +my (%checked,%selected); if ($settings{'GEOIPBLOCK_ENABLED'} eq "on") { - $checked = "checked='checked'"; -} + $checked{'GEOIPBLOCK_ENABLED'}{$settings{'GEOIPBLOCK_ENABLE'}} = "checked='checked'"; + } + +if ($settings{'LOG_ENABLED'} eq "on") { + $checked{'LOG_ENABLED'}{$settings{'LOG_ENABLE'}} = "checked='checked'"; + } + +$checked{'GEOIPBLOCK_ENABLED'}{'off'} = ''; +$checked{'GEOIPBLOCK_ENABLED'}{'on'} = ''; +$checked{'GEOIPBLOCK_ENABLED'}{$settings{'GEOIPBLOCK_ENABLED'}} = "checked='checked'"; + + +$checked{'LOG_ENABLED'}{'off'} = ''; +$checked{'LOG_ENABLED'}{'on'} = ''; +$checked{'LOG_ENABLED'}{$settings{'LOG_ENABLED'}} = "checked='checked'"; # Print box to enable/disable geoipblock. print"