diff --git a/root/usr/share/smanager/lib/SrvMngr/Controller/Letsencrypt-Custom.pm b/root/usr/share/smanager/lib/SrvMngr/Controller/Letsencrypt-Custom.pm index ca68016..a7adaa5 100644 --- a/root/usr/share/smanager/lib/SrvMngr/Controller/Letsencrypt-Custom.pm +++ b/root/usr/share/smanager/lib/SrvMngr/Controller/Letsencrypt-Custom.pm @@ -16,11 +16,11 @@ use constant FALSE => 0; use constant TRUE => 1; #The most common ones -our $cdb = esmith::ConfigDB->open() || die("Couldn't open config db"); -our $adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db"); -our $ndb = esmith::NetworksDB->open() || die("Couldn't open Network db"); -our $hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db"); -our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db"); +#our $cdb = esmith::ConfigDB->open() || die("Couldn't open config db"); +#our $adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db"); +#our $ndb = esmith::NetworksDB->open() || die("Couldn't open Network db"); +#our $hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db"); +#our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db"); # Validation routines - parameters for each panel sub validate_LIST { @@ -161,6 +161,7 @@ sub validate_CHECKONEDOMAIN { # Get singleton data for each panel sub get_data_for_panel_LIST { + my $cdb = esmith::ConfigDB->open() || die("Couldn't open config db"); # Return a hash with the fields required which will be loaded into the shared data my $c = shift; @@ -185,6 +186,7 @@ sub get_data_for_panel_PARAMS { # Return a hash with the fields required which will be loaded into the shared data my $c = shift; + my $cdb = esmith::ConfigDB->open() || die("Couldn't open config db"); my %ret = ( 'Data1' => 'Data for PARAMS', #Example # fields from Inputs in PARAMS $fields['PARAMS'] @@ -272,6 +274,8 @@ sub actual_DomainList { # #print $element . "\n"; # push @list, $element; # } + my $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db"); + my $hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db"); my @data = (); my $check = $c->l('Check Domain'); @@ -440,6 +444,7 @@ sub perform_PARAMS { my $c = shift; my $prefix_data = shift; #Data hash as parameter my $ret = ""; + my $cdb = esmith::ConfigDB->open() || die("Couldn't open config db"); my $db = $cdb; #maybe one of the others my $dbkey = 'letsencrypt'; @@ -480,6 +485,7 @@ sub perform_CHECKALLDOMAINS { my $c = shift; my $prefix_data = shift; #Data hash as parameter my $ret = ""; + my $cdb = esmith::ConfigDB->open() || die("Couldn't open config db"); my $db = $cdb; #maybe one of the others my $dbkey = 'ChangeThis'; @@ -496,6 +502,7 @@ sub perform_CHECKALLENABLEDDOMAINS { my $c = shift; my $prefix_data = shift; #Data hash as parameter my $ret = ""; + my $cdb = esmith::ConfigDB->open() || die("Couldn't open config db"); my $db = $cdb; #maybe one of the others my $dbkey = 'ChangeThis'; @@ -563,4 +570,4 @@ sub update_enabled_domains { my $output = `/etc/e-smith/events/actions/letsencrypt-setdomains "" "" enabled `; return $output || "-empty-"; } ## end sub update_enabled_domains -1; \ No newline at end of file +1; diff --git a/root/usr/share/smanager/themes/default/templates/partials/_lets_PARAMS.html.ep b/root/usr/share/smanager/themes/default/templates/partials/_lets_PARAMS.html.ep index 7950547..dc23a72 100644 --- a/root/usr/share/smanager/themes/default/templates/partials/_lets_PARAMS.html.ep +++ b/root/usr/share/smanager/themes/default/templates/partials/_lets_PARAMS.html.ep @@ -27,8 +27,9 @@

%=l('lets_SERVICE_STATUS') - % my @status_options = [['Disabled' => 'disabled'], ['Enabled' => 'enabled'], ['TEST' => 'test']]; - % param 'status' => $lets_data->{status} unless param 'status'; + %# my @status_options = [['Disabled' => 'disabled'], ['Enabled' => 'enabled'], ['TEST' => 'test']]; + % my @status_options = selected_field([['Disabled' => 'disabled'], ['Enabled' => 'enabled'], ['TEST' => 'test']], $lets_data->{status}); + %# param 'status' => $lets_data->{status} unless param 'status'; %= select_field 'status' => @status_options, class => 'input'

@@ -94,4 +95,4 @@ %# Probably finally by a submit. %end - \ No newline at end of file + diff --git a/smeserver-certificates.spec b/smeserver-certificates.spec index 016610c..0059382 100644 --- a/smeserver-certificates.spec +++ b/smeserver-certificates.spec @@ -1,6 +1,6 @@ %define name smeserver-certificates %define version 11.0 -%define release 2 +%define release 3 Summary: This is what smeserver-certificates does. Name: %{name} Version: %{version} @@ -25,6 +25,10 @@ AutoReqProv: no %changelog +* Mon Feb 17 2025 Brian Read 11.0-3.sme +- Change status in template to use helper script to pre-set dropdown value [SME: 12923] +- Update Custom routines to openb DB when required, not relying on global open [SME: 12695] + * Wed Feb 12 2025 Jean-Philippe Pialasse 11.0-2.sme - move smanager panel in package [SME: 12916] - add Requires