From 13853ba844af28e1fb5f7cc2eaf65e8b2a8ea6bc Mon Sep 17 00:00:00 2001 From: Brian Read Date: Sun, 5 Oct 2025 15:42:41 +0100 Subject: [PATCH] * Sun Oct 05 2025 Brian Read 2.0.4-27.sme - Add UTF8 and avoid potential DB caching problems [SME: 13209] --- .../smanager/lib/SrvMngr/Controller/Dhcpd.pm | 19 +++++++++++-------- smeserver-dhcpmanager.spec | 5 ++++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm b/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm index 5c9ffb1..798caaa 100644 --- a/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm +++ b/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm @@ -35,14 +35,14 @@ use SrvMngr qw(theme_list init_session); use Data::Dumper; use esmith::util; -use esmith::HostsDB; -use esmith::AccountsDB; +use esmith::HostsDB::UTF8; +use esmith::AccountsDB::UTF8; use Net::Ping; use esmith::util::network qw(:all); use Socket qw( inet_aton ); -#our $adb = esmith::AccountsDB->open() or die("Unable to open accounts DB"); +#our $adb = esmith::AccountsDB::UTF8->open() or die("Unable to open accounts DB"); my %dhcp_data = (); @@ -56,6 +56,9 @@ sub main { do_display($c); } +my $db; + + sub do_display { # # Front parameters page @@ -65,7 +68,7 @@ sub do_display { my $title = $c->l("dhcpd_DHCP manager"); my $modul = ''; my $trt = "SETTINGS"; - our $db = esmith::ConfigDB->open() or die("Unable to open Configuration DB"); + $db = esmith::ConfigDB::UTF8->open() or die("Unable to open Configuration DB"); our %sme_conf = $db->get('dhcpd')->props; our %smb_conf = $db->get('smb')->props; $dhcp_data{trt} = $trt; @@ -175,7 +178,7 @@ sub do_update_check { my $c = shift; my $dhcpd_check = $c->param ('dhcp_check'); ###Update SME configuration dbase - my $dbh_sme = esmith::ConfigDB->open('/home/e-smith/db/configuration'); + my $dbh_sme = esmith::ConfigDB::UTF8->open('/home/e-smith/db/configuration'); ##Initiate get method --> create record object my $sme_record = $dbh_sme->get('dhcpd'); $sme_record->set_prop('check' , $dhcpd_check); @@ -205,7 +208,7 @@ sub Main_Save ($){ my $dhcpd_gateway = $q->param ('dhcp_gateway'); ###Update SME configuration dbase - my $dbh_sme = esmith::ConfigDB->open('/home/e-smith/db/configuration'); + my $dbh_sme = esmith::ConfigDB::UTF8->open('/home/e-smith/db/configuration'); ##Initiate get method --> create record object my $sme_record = $dbh_sme->get('dhcpd'); @@ -536,7 +539,7 @@ sub get_mac_address_by_ping { sub Scan_Local_Network ($) { - my $nmap_sme = esmith::ConfigDB->open('/home/e-smith/db/configuration'); + my $nmap_sme = esmith::ConfigDB::UTF8->open('/home/e-smith/db/configuration'); my $mask = $nmap_sme->get_value('LocalNetmask'); my $network = $nmap_sme->get_prop('InternalInterface','Network'); @@ -580,7 +583,7 @@ sub Load_leases ($){ @detail $work_line $header /; my $name_file = '/var/lib/dhcpd/dhcpd.leases' ; our @liste_computer = '' ; - our $db = esmith::ConfigDB->open() or die("Unable to open Configuration DB"); + our $db = esmith::ConfigDB::UTF8->open() or die("Unable to open Configuration DB"); our %sme_conf = $db->get('dhcpd')->props; #Ouverture du fichier en lecture seule open(FILE,"<$name_file") || die "Read error $name_file, Error: $!" ; diff --git a/smeserver-dhcpmanager.spec b/smeserver-dhcpmanager.spec index 34d82f6..9888610 100644 --- a/smeserver-dhcpmanager.spec +++ b/smeserver-dhcpmanager.spec @@ -1,6 +1,6 @@ %define name smeserver-dhcpmanager %define version 2.0.4 -%define release 26 +%define release 27 Summary: provide a dhcp panel in the server-manager for The SME Server Name: %{name} @@ -25,6 +25,9 @@ AutoReqProv: no Implementation of some feature arround dhcp clients like : wol, cleaning dhcpd.leases, Scan of your network etc// %changelog +* Sun Oct 05 2025 Brian Read 2.0.4-27.sme +- Add UTF8 and avoid potential DB caching problems [SME: 13209] + * Sat Oct 04 2025 Brian Read 2.0.4-26.sme - Delete en.pm and create .lex file if needed [SME: 13214]