* Mon Oct 06 2025 Brian Read <brianr@koozali.org> 11.0.0-3.sme

- Add UTF8 and avoid potential DB caching problems [SME: 13209]
This commit is contained in:
2025-10-06 12:06:29 +01:00
parent dfbe9e76ce
commit 9fb9d89ab9
4 changed files with 35 additions and 32 deletions

View File

@@ -7,11 +7,11 @@
#
use esmith::util;
use esmith::util::network;
use esmith::ConfigDB;
use esmith::HostsDB;
use esmith::AccountsDB;
use esmith::ConfigDB::UTF8;
use esmith::HostsDB::UTF8;
use esmith::AccountsDB::UTF8;
use esmith::NetworksDB;
use esmith::DomainsDB;
use esmith::DomainsDB::UTF8;
use constant FALSE => 0;
use constant TRUE => 1;
@@ -178,7 +178,7 @@ my $ddb;
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
my $name = $c->param('Selected');
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$adb = esmith::AccountsDB::UTF8->open() || die("Couldn't open Accounts db");
my $rec = $adb->get($name) || die("Share $name is not in DB ");
my %ret = (
'Data1'=>'Data for MODIFY', #Example
@@ -203,7 +203,7 @@ my $ddb;
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
my $name = $c->param('Selected');
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$adb = esmith::AccountsDB::UTF8->open() || die("Couldn't open Accounts db");
my $rec = $adb->get($name) || die("Share $name is not in DB ");
my %ret = (
'Data1'=>'Data for MODIFY', #Example
@@ -218,7 +218,7 @@ my $ddb;
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
my $name = $c->param('Selected');
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$adb = esmith::AccountsDB::UTF8->open() || die("Couldn't open Accounts db");
my $rec = $adb->get($name) || die("Share $name is not in DB ");
my %ret = (
'Data1'=>'Data for MODIFY', #Example
@@ -246,7 +246,7 @@ sub actual_Table1 {
my $c = shift;
my @ret = ();
# Actual code for extracting Table1
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$adb = esmith::AccountsDB::UTF8->open() || die("Couldn't open Accounts db");
my @shares = $adb->get_all_by_prop(type => 'share');
foreach my $share (@shares) {
my $sharename = $share->key();
@@ -494,7 +494,7 @@ sub save_share {
#
my $c = shift;
my $name = $c->param('name');
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$adb = esmith::AccountsDB::UTF8->open() || die("Couldn't open Accounts db");
my $acct = $adb->get($name);
my $is_create = !$acct;
@@ -594,7 +594,7 @@ sub save_share {
sub modify_perm {
my $c = shift;
my $name = $c->param('name');
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$adb = esmith::AccountsDB::UTF8->open() || die("Couldn't open Accounts db");
my $acct = $adb->get($name);
return $c->l('sf_CANT_FIND_SHARE') unless($acct && $acct->prop('type') eq 'share');
@@ -652,7 +652,7 @@ sub modify_perm {
# Remove a share
sub remove_share {
my $c = shift;
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$adb = esmith::AccountsDB::UTF8->open() || die("Couldn't open Accounts db");
my $name = $c->param('Selected');
my $acct = $adb->get($name);
return $c->l('sf_CANCELED','First') if ($c->param('cancel'));
@@ -686,7 +686,7 @@ sub remove_share {
sub conflict_check {
my ($c, $name) = @_;
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$adb = esmith::AccountsDB::UTF8->open() || die("Couldn't open Accounts db");
my $rec = $adb->get($name);
my $type;
@@ -757,7 +757,7 @@ sub confirm_password {
sub max_share_name_length {
my ($c, $data) = @_;
$cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
my $rec = $cdb->get('maxShareNameLength');
my $max = (defined $rec ? $rec->value : '12');
@@ -776,7 +776,7 @@ sub max_share_name_length {
sub acl_list {
my ($c, $which) = @_;
my $sharename = $c->param('Selected');
my $adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
my $adb = esmith::AccountsDB::UTF8->open() || die("Couldn't open Accounts db");
my $share = $adb->get($sharename);
return $c->l('sf_SHARE_NOT_FOUND') unless ($share);

View File

@@ -38,11 +38,11 @@ use Data::Dumper;
use esmith::util;
use esmith::util::network;
use esmith::ConfigDB;
use esmith::AccountsDB;
use esmith::ConfigDB::UTF8;
use esmith::AccountsDB::UTF8;
use esmith::NetworksDB;
use esmith::HostsDB;
use esmith::DomainsDB;
use esmith::HostsDB::UTF8;
use esmith::DomainsDB::UTF8;
my $cdb;
my $adb;
@@ -70,11 +70,11 @@ sub main {
$c->app->log->info( $c->log_req );
#The most common ones
$cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB::UTF8->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
%sf_data = ();
my $title = $c->l('sf_Shared_Folders');
@@ -122,11 +122,11 @@ sub do_update {
my $modul = '';
#The most common ones - you might want to comment out any not used.
$cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB::UTF8->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
my $title = $c->l('sf_Shared_Folders');
@@ -275,11 +275,11 @@ sub do_display {
$c->app->log->info($c->log_req);
#The most common ones - you might want to comment out any not used.
$cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB::UTF8->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
my $title = $c->l('sf_Shared_Folders');
my $modul = "";

View File

@@ -76,7 +76,7 @@
</tr>
</thead>
<tbody class='tabl2'>
% my $control_data = $c->stash('Table3');
% $control_data = $c->stash('Table3');
% foreach my $row (@$control_data) {
<tr class='table-row'>
<td class='sme-border table-col table-col-Table3_Groups'><%=$c->render_to_string(inline=>$row->{'Table3_Users'})%></td>

View File

@@ -6,7 +6,7 @@ Summary: sme server shared folders module
%define name smeserver-shared-folders
Name: %{name}
%define version 11.0.0
%define release 2
%define release 3
Version: %{version}
Release: %{release}%{?dist}
License: GPL
@@ -30,6 +30,9 @@ This module allows you to create network shares
with more flexibility than ibays as it supports ACLs
%changelog
* Mon Oct 06 2025 Brian Read <brianr@koozali.org> 11.0.0-3.sme
- Add UTF8 and avoid potential DB caching problems [SME: 13209]
* Sat Oct 04 2025 Brian Read <brianr@koozali.org> 11.0.0-2.sme
- Delete en.pm and create .lex file if needed [SME: 13214]