diff -urN smeserver-xt_geoip-1.0.1.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/xt_geoip smeserver-xt_geoip-1.0.1/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/xt_geoip
--- smeserver-xt_geoip-1.0.1.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/xt_geoip 2019-04-10 18:04:05.000000000 +0400
+++ smeserver-xt_geoip-1.0.1/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/xt_geoip 2019-04-21 21:19:38.819847189 +0400
@@ -65,6 +65,11 @@
+ ERR_COUNTRY_MAX: {$ctr}
+ Country code(s) maximum reached: {$ctr}
+
+
+
LABEL_BADCOUNTRIES
New country codes to be used :
@@ -89,4 +94,39 @@
GeoIP table is updated every week, but you can ...
+
+ IPT_LIST
+ Geoip ban
+
+
+
+ SSH_LIST
+ Ssh errors
+
+
+
+ STATS_GENERATED
+ Statistics generated
+
+
+
+ END_OF_STATS
+ End of Statistics
+
+
+
+ INVALID_STATS_TYPE
+ Invalid type of statistics
+
+
+
+ STATS_DESCRIPTION
+ Statistics for Xt_GeoIP
+ - For 3 periods : Day, Week and Month
+ - Banned Ips by country sorted by number
+ - Ssh errors by country sorted by number
+
XX means Country not found !
]]>
+
+
+
diff -urN smeserver-xt_geoip-1.0.1.old/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/xt_geoip smeserver-xt_geoip-1.0.1/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/xt_geoip
--- smeserver-xt_geoip-1.0.1.old/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/xt_geoip 2019-04-10 18:04:05.000000000 +0400
+++ smeserver-xt_geoip-1.0.1/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/xt_geoip 2019-04-21 21:19:38.819847189 +0400
@@ -60,6 +60,12 @@
+ ERR_COUNTRY_MAX: {$ctr}
+ Code pays, maximum atteint: {$ctr}
+
+
+
+
LABEL_BADCOUNTRIES
Nouveaux codes pays à utiliser :
@@ -89,5 +95,40 @@
Aucun changement... pas de mise à jour !
+
+
+ IPT_LIST
+ Geoip stop
+
+
+
+ SSH_LIST
+ Ssh erreurs
+
+
+
+ STATS_GENERATED
+ Statistiques générées
+
+
+
+ END_OF_STATS
+ Fin des Statistiques
+
+
+
+ INVALID_STATS_TYPE
+ Type de statistiques invalide
+
+
+
+ STATS_DESCRIPTION
+ Statistiques pour Xtables GeoIP
+ - Pour 3 périodes : Jour, Semaine et Mois
+ - Ips bloqués par pays triés par score
+ - Erreurs Ssh par pays triées par score
+
XX signifie Pays non trouvé !
]]>
+
+
diff -urN smeserver-xt_geoip-1.0.1.old/root/etc/e-smith/web/functions/xt_geoip smeserver-xt_geoip-1.0.1/root/etc/e-smith/web/functions/xt_geoip
--- smeserver-xt_geoip-1.0.1.old/root/etc/e-smith/web/functions/xt_geoip 2019-04-10 18:04:05.000000000 +0400
+++ smeserver-xt_geoip-1.0.1/root/etc/e-smith/web/functions/xt_geoip 2019-04-21 21:19:38.819847189 +0400
@@ -68,9 +68,10 @@
footer="/etc/e-smith/web/common/foot.tmpl">
+ pre-event="print_status_message()">
+ # post-event="wherenext('Second')" >
+ # Ssh Ipt Second
XT_GEOIP_STATUS_DESCRIPTION
-
+
+
+ STATS_DESCRIPTION
+
+
+
+
-
+
+
+
+
+
+
+
diff -urN smeserver-xt_geoip-1.0.1.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/xt_geoip.pm smeserver-xt_geoip-1.0.1/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/xt_geoip.pm
--- smeserver-xt_geoip-1.0.1.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/xt_geoip.pm 2019-04-10 18:04:05.000000000 +0400
+++ smeserver-xt_geoip-1.0.1/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/xt_geoip.pm 2019-04-21 21:22:29.486625737 +0400
@@ -81,7 +81,7 @@
my $self = esmith::FormMagick->new();
$self->{calling_package} = (caller)[0];
bless $self;
- #$self->debug(1);
+# $self->debug(1);
return $self;
}
@@ -213,12 +213,65 @@
my $listerr = "";
my @mq_bcs = split /[,:]/, $q->param("masq_badcountries");
if (@mq_bcs) {
+ my $ctr = @mq_bcs;
+ return $self->localise('ERR_COUNTRY_MAX: {$ctr}', {ctr=> "$ctr"}) if ($ctr > 50);
+
foreach my $bcs (@mq_bcs) {
- my $file = "/usr/share/xt_geoip/LE/" . $bcs . ".iv4";
- if (! -f $file) { $listerr .= $bcs . ","; }
+ my $file = "/usr/share/xt_geoip/LE/" . $bcs . ".iv4";
+ if (! -f $file) { $listerr .= $bcs . ","; }
}
return $self->localise('ERR_COUNTRY_NOT_EXIST: {$listerr}', {listerr=> "$listerr"}) if $listerr;
}
return 'OK';
}
+
+#Subroutine to display buttons
+sub print_custom_button
+{
+ my ($fm,$desc,$url,$type) = @_;
+ my $q = $fm->{cgi};
+ $url="xt_geoip?page=0&page_stack=&Next=Next&type=".$type."&wherenext=".$url;
+ print "
\n \n";
+ print $q->p($q->a({href => $url, -class => "button-like"},$fm->localise($desc)));
+ print qq( |
\n);
+ return undef;
+}
+
+#Subroutine to list statistics
+sub generateStats
+{
+ my $self = shift;
+ my $q = $self->{cgi};
+
+ # Untaint $name before use in system()
+ my $stats_type = $q->param ('type');
+ $stats_type =~ /(.+)/; $stats_type = $1;
+ if ($stats_type ne "ipt" && $stats_type ne "ssh")
+ {
+ print $q->p($q->b($self->localise('INVALID_STATS_TYPE').
+ $stats_type));
+ return '';
+ } else {
+ # my $now_string = $self->gen_locale_date_string();
+ my $file = "/var/lib/xt_geoip/extA_" . $stats_type . "_country.lst";
+ my $filetime = ( -e $file ) ? (stat($file))[9] : 0;
+ my $date_string = strftime("%Y/%m/%d %H:%M", localtime( $filetime )) || '';
+ print $q->h3($self->localise('STATS_GENERATED'), "[", $stats_type, "]", $date_string);
+
+ open( XTGEOIPSTATS, $file );
+ print "\n";
+
+ while ()
+ {
+ print;
+ }
+
+ close XTGEOIPSTATS;
+ print "
\n";
+
+ print $q->h3($self->localise('END_OF_STATS'));
+ return '';
+ }
+}
+
1;