diff -urN smeserver-xt_geoip-1.3.1.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/xt_geoip smeserver-xt_geoip-1.3.1/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/xt_geoip --- smeserver-xt_geoip-1.3.1.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/xt_geoip 2023-01-11 20:36:20.000000000 +0400 +++ smeserver-xt_geoip-1.3.1/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/xt_geoip 2023-01-11 22:35:41.280000000 +0400 @@ -50,11 +50,6 @@ - ERROR_STATUS_GEOIP - GEOIP filtering is inactive (iptables) ]]> - - - LABEL_BADCOUNTRIES_STATUS Current list of banished country codes : @@ -302,4 +297,19 @@ GEOIP license key unavailable. Downloading is inactive ]]> + + ERROR_MISSING_MODULE + Module xt_geoip is missing. GeoIP based filtering is inactive ]]> + + + + ERROR_UNLOADED_MODULE + Module xt_geoip not loaded. GeoIP based filtering is inactive ]]> + + + + ERROR_FILTER_CHAIN_MISSING + Filtering chain XTGeoIP is not in use. GeoIP based filtering is inactive ]]> + + diff -urN smeserver-xt_geoip-1.3.1.old/root/etc/e-smith/web/functions/xt_geoip smeserver-xt_geoip-1.3.1/root/etc/e-smith/web/functions/xt_geoip --- smeserver-xt_geoip-1.3.1.old/root/etc/e-smith/web/functions/xt_geoip 2023-01-11 20:36:20.000000000 +0400 +++ smeserver-xt_geoip-1.3.1/root/etc/e-smith/web/functions/xt_geoip 2023-01-11 20:50:41.936000000 +0400 @@ -106,7 +106,6 @@ - COUNTRY_LIST_DESCRIPTION diff -urN smeserver-xt_geoip-1.3.1.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/xt_geoip.pm smeserver-xt_geoip-1.3.1/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/xt_geoip.pm --- smeserver-xt_geoip-1.3.1.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/xt_geoip.pm 2023-01-11 20:36:20.000000000 +0400 +++ smeserver-xt_geoip-1.3.1/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/xt_geoip.pm 2023-01-11 20:20:08.000000000 +0400 @@ -175,21 +175,27 @@ return $db->get_prop("$item", "$prop") || "disabled"; } + =head2 get_stat_geoip -method to retrieve the status of geoip for the form +method to retrieve the status of geoip (module and filtering) for the form =cut sub get_stat_geoip { my $fm = shift; - if ( get_geoip() eq 'enabled' && system ( "/sbin/iptables -L -n | grep 'GeoIP' > /dev/null") != 0 ) { - return $fm->localise('ERROR_STATUS_GEOIP'); + if ( system ( "/bin/test -f /lib/modules/`/bin/uname -r`/weak-updates/xtables-addons/xt_geoip.ko") != 0 ) { + return $fm->localise('ERROR_MISSING_MODULE'); + } elsif ( system ( "/sbin/lsmod | grep 'xt_geoip' > /dev/null") != 0 ) { + return $fm->localise('ERROR_UNLOADED_MODULE'); + } elsif ( get_geoip() eq 'enabled' && system ( "/sbin/iptables -L -n | grep 'XTGeoIP' > /dev/null") != 0 ) { + return $fm->localise('ERROR_FILTER_CHAIN_MISSING'); } else { return ''; } } + =head2 get_stat_license_key method to retrieve the status of geoip license_key for the site @@ -207,6 +213,7 @@ } + =head2 get_date_update =cut diff -urN smeserver-xt_geoip-1.3.1.old/root/usr/share/smanager/lib/SrvMngr/Controller/Xt_geoip.pm smeserver-xt_geoip-1.3.1/root/usr/share/smanager/lib/SrvMngr/Controller/Xt_geoip.pm --- smeserver-xt_geoip-1.3.1.old/root/usr/share/smanager/lib/SrvMngr/Controller/Xt_geoip.pm 2023-01-11 20:36:20.000000000 +0400 +++ smeserver-xt_geoip-1.3.1/root/usr/share/smanager/lib/SrvMngr/Controller/Xt_geoip.pm 2023-01-11 19:50:19.000000000 +0400 @@ -256,9 +256,14 @@ sub get_stat_geoip { + my $c = shift; - if ( get_geoip() eq 'enabled' && system ( "/sbin/iptables -L -n | grep 'GeoIP' > /dev/null") != 0 ) { - return $c->l('xtg_ERROR_STATUS_GEOIP'); + if ( system ( "/bin/test -f /lib/modules/`/bin/uname -r`/weak-updates/xtables-addons/xt_geoip.ko") != 0 ) { + return $c->l('xtg_ERROR_MISSING_MODULE'); + } elsif ( system ( "/sbin/lsmod | grep 'xt_geoip' > /dev/null") != 0 ) { + return $c->l('xtg_ERROR_UNLOADED_MODULE'); + } elsif ( get_geoip() eq 'enabled' && system ( "/sbin/iptables -L -n | grep 'XTGeoIP' > /dev/null") != 0 ) { + return $c->l('xtg_ERROR_FILTER_CHAIN_MISSING'); } else { return ''; } @@ -312,7 +317,6 @@ return \@serv_rec; } - sub get_srv_badcountries { my ( $c, $name, $full ) = @_; diff -urN smeserver-xt_geoip-1.3.1.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Xt_geoip/xt_geoip_en.lex smeserver-xt_geoip-1.3.1/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Xt_geoip/xt_geoip_en.lex --- smeserver-xt_geoip-1.3.1.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Xt_geoip/xt_geoip_en.lex 2023-01-11 20:36:20.000000000 +0400 +++ smeserver-xt_geoip-1.3.1/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Xt_geoip/xt_geoip_en.lex 2023-01-11 22:42:22.754000000 +0400 @@ -63,4 +63,7 @@ ', 'xtg_LABEL_AVAILABLE_SERVICES' => 'Available Services', -'xtg_ERROR_LICENSE_KEY' => ' GEOIP license key unavailable. Downloading is inactive ', +'xtg_ERROR_LICENSE_KEY' => 'GEOIP license key unavailable. Downloading is inactive', +'xtg_ERROR_MISSING_MODULE' => 'Module xt_geoip is missing. GeoIP based filtering is inactive', +'xtg_ERROR_UNLOADED_MODULE' => 'Module xt_geoip not loaded. GeoIP based filtering is inactive', +'xtg_ERROR_FILTER_CHAIN_MISSING' => 'Filtering chain XTGeoIP is not in use. GeoIP based filtering is inactive',