Letsencrypt - Add in email field in params

This commit is contained in:
2024-11-06 15:16:27 +00:00
parent d0a84da130
commit e49bea28c5
10 changed files with 128 additions and 55 deletions

View File

@@ -1,6 +1,6 @@
package SrvMngr::Controller::Letsencrypt;
#
# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-05 13:20:33
# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-06 11:09:38
#
#----------------------------------------------------------------------
# heading : Network
@@ -70,7 +70,7 @@ sub main {
my $title = $c->l('lets_Letsencrypt_certificate');
my $modul = '';
$lets_data{'trt'} = 'LIST';
$lets_data{'trt'} = 'CHECKALLDOMAINS';
#Load any DB entries into the <prefix>_data area so as they are preset in the form
# which DB - this only really works if the initial panel is a PARAMS type panel and not a TABLE
@@ -80,7 +80,7 @@ sub main {
#pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = get_data_for_panel_LIST();
%returned_hash = get_data_for_panel_CHECKALLDOMAINS();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$lets_data{$key} = $value;
@@ -143,7 +143,7 @@ sub do_update {
}
# the value of trt will tell you which panel has returned
my $trt = $c->param('trt') || 'LIST'; #hidden control on every form.
my $trt = $c->param('trt') || 'CHECKALLDOMAINS'; #hidden control on every form.
my $ret = 'ok';
#Validate the parameters in a custom sub one for each panel (although only one of these will be executed)
@@ -173,6 +173,12 @@ sub do_update {
$thispanel = 'CHECKALLENABLEDDOMAINS';
}
if ($trt eq 'CHECKONEDDOMAINS'){
#Validate form parameters for panel CHECKONEDDOMAINS
$ret = $c->validate_CHECKONEDDOMAINS(\%lets_data);
$thispanel = 'CHECKONEDDOMAINS';
}
if ($ret ne "ok") {
# return to the panel with error message
@@ -229,6 +235,18 @@ sub do_update {
}
}
if ($trt eq 'CHECKONEDDOMAINS'){
#do whatever is required ...
$ret = $c->perform_CHECKONEDDOMAINS(\%lets_data);
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->render("letsencrypt");
} else {
$c->stash( success => $c->l('lets_CHECKONEDDOMAINS_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
# and call any signal-events needed
@@ -238,7 +256,7 @@ sub do_update {
lets_data => \%lets_data
);
if ('none' eq 'none') {
$lets_data{'trt'} = 'LIST';
$lets_data{'trt'} = 'CHECKALLDOMAINS';
} else {
$lets_data{'trt'} = 'none';
}
@@ -279,7 +297,7 @@ sub do_display {
}
# the value of trt will tell you which panel has returned
my $trt = $c->param('trt') || 'LIST'; #Indicates where to go now
my $trt = $c->param('trt') || 'CHECKALLDOMAINS'; #Indicates where to go now
# Now add in the params from the selected row from the table
@@ -305,6 +323,11 @@ sub do_display {
%selectedrow = $c->get_selected_CHECKALLENABLEDDOMAINS($lets_data{'Selected'},$is_new_record);
}
if ($trt eq 'CHECKONEDDOMAINS'){
#Validate form parameters for panel CHECKONEDDOMAINS
%selectedrow = $c->get_selected_CHECKONEDDOMAINS($lets_data{'Selected'},$is_new_record);
}
#Copy in the selected row params to the prefix_data hash to pass to the panel
while (my ($key, $value) = each %selectedrow){
@@ -359,6 +382,17 @@ sub do_display {
}
}
if ($trt eq 'CHECKONEDDOMAINS'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = get_data_for_panel_CHECKONEDDOMAINS();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$lets_data{$key} = $value;
}
}
# and table control fields