From 252ea1167e6f1086e0da2fc8eb9d01eaf5916dc7 Mon Sep 17 00:00:00 2001 From: Brian Read Date: Fri, 3 Oct 2025 15:52:35 +0100 Subject: [PATCH] * Fri Oct 03 2025 Brian Read 1.4-16.sme - Apply UTF8 to DomainDB and ConfigDB and fix potential caching problem [SME: 13209] --- .../lib/SrvMngr/Controller/Awstats.pm | 21 +++++++++++++------ smeserver-awstats.spec | 5 ++++- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/root/usr/share/smanager/lib/SrvMngr/Controller/Awstats.pm b/root/usr/share/smanager/lib/SrvMngr/Controller/Awstats.pm index 3c00f4c..4b6c551 100644 --- a/root/usr/share/smanager/lib/SrvMngr/Controller/Awstats.pm +++ b/root/usr/share/smanager/lib/SrvMngr/Controller/Awstats.pm @@ -26,12 +26,12 @@ use SrvMngr qw(theme_list init_session); use POSIX qw(strftime); -use esmith::DomainsDB; -use esmith::ConfigDB; +use esmith::DomainsDB::UTF8; +use esmith::ConfigDB::UTF8; -our $ddb = esmith::DomainsDB->open || die "Couldn't open domains db"; -our $cdb = esmith::ConfigDB->open || die "Couldn't open configuration db"; +my $ddb; +my $cdb; our $awsdirdata="/home/e-smith/files/users/admin/home/awstats"; our $REGEXP_DOMAIN = qq([a-zA-Z0-9\-\.]+); @@ -44,6 +44,9 @@ sub main { my %aws_datas = (); my $title = $c->l('aws_FORM_TITLE'); + $ddb = esmith::DomainsDB::UTF8->open || die "Couldn't open domains db"; + $cdb = esmith::ConfigDB::UTF8->open || die "Couldn't open configuration db"; + $aws_datas{trt} = 'LST'; my $rec = $cdb->get('AWStats'); @@ -100,6 +103,9 @@ sub do_display { my $title = $c->l('aws_FORM_TITLE'); my $result; + $ddb = esmith::DomainsDB::UTF8->open || die "Couldn't open domains db"; + $cdb = esmith::ConfigDB::UTF8->open || die "Couldn't open configuration db"; + my $trt = $c->param('trt') || 'LST'; my $domain = $c->param('Domain'); @@ -161,6 +167,9 @@ sub do_update { $aws_datas{trt} = $trt; my ($res, $result) = ''; + $ddb = esmith::DomainsDB::UTF8->open || die "Couldn't open domains db"; + $cdb = esmith::ConfigDB::UTF8->open || die "Couldn't open configuration db"; + if ( $trt eq 'UPD' ) { my $status = $c->param('Status'); @@ -279,7 +288,7 @@ sub do_update { return $c->render( 'awstats' ); } -# $cdb = esmith::ConfigDB->open(); +# $cdb = esmith::ConfigDB::UTF8->open(); my $message = "'AWStats configuration' update ($trt) DONE"; $c->app->log->info($message); @@ -352,4 +361,4 @@ sub language_options_list { } -1 +1 \ No newline at end of file diff --git a/smeserver-awstats.spec b/smeserver-awstats.spec index 9cb65dc..30148a8 100644 --- a/smeserver-awstats.spec +++ b/smeserver-awstats.spec @@ -4,7 +4,7 @@ %define realname smeserver-awstats %define version 1.4 -%define release 15 +%define release 16 Summary: SME Server integration rpm for awstats Name: %{realname} @@ -26,6 +26,9 @@ AutoReqProv: no SME Server integration rpm for awstats. %changelog +* Fri Oct 03 2025 Brian Read 1.4-16.sme +- Apply UTF8 to DomainDB and ConfigDB and fix potential caching problem [SME: 13209] + * Fri Oct 03 2025 Brian Read 1.4-15.sme - Remove smanager-refresh from spec file [SME: 13212]