Fix error return from params screen

This commit is contained in:
2024-11-22 14:00:54 +00:00
parent 9e0b42a266
commit b9b939223b
13 changed files with 173 additions and 109 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-13 16:29:07
# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-17 14:48:52
#
#----------------------------------------------------------------------
# heading : Network
@@ -35,6 +35,7 @@ use SrvMngr qw(theme_list init_session);
use Data::Dumper;
use esmith::util;
use esmith::util::network;
use esmith::ConfigDB;
use esmith::AccountsDB;
use esmith::NetworksDB;
@@ -80,16 +81,15 @@ 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 = $c->get_data_for_panel_LIST();
# 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
$c->stash(DomainList=>$c->get_DomainList());
$c->stash(DomainList=>$c->get_DomainList());
$c->stash(
title => $title,
@@ -173,10 +173,10 @@ sub do_update {
$thispanel = 'CHECKALLENABLEDDOMAINS';
}
if ($trt eq 'CHECKONEDDOMAIN'){
#Validate form parameters for panel CHECKONEDDOMAIN
$ret = $c->validate_CHECKONEDDOMAIN(\%lets_data);
$thispanel = 'CHECKONEDDOMAIN';
if ($trt eq 'CHECKONEDOMAIN'){
#Validate form parameters for panel CHECKONEDOMAIN
$ret = $c->validate_CHECKONEDOMAIN(\%lets_data);
$thispanel = 'CHECKONEDOMAIN';
}
@@ -235,15 +235,15 @@ sub do_update {
}
}
if ($trt eq 'CHECKONEDDOMAIN'){
if ($trt eq 'CHECKONEDOMAIN'){
#do whatever is required ...
$ret = $c->perform_CHECKONEDDOMAIN(\%lets_data);
$ret = $c->perform_CHECKONEDOMAIN(\%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_CHECKONEDDOMAIN_panel_action_was_successful')); #A bit bland - edit it in the lex file
$c->stash( success => $c->l('lets_CHECKONEDOMAIN_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
@@ -323,9 +323,9 @@ sub do_display {
%selectedrow = $c->get_selected_CHECKALLENABLEDDOMAINS($lets_data{'Selected'},$is_new_record);
}
if ($trt eq 'CHECKONEDDOMAIN'){
#Validate form parameters for panel CHECKONEDDOMAIN
%selectedrow = $c->get_selected_CHECKONEDDOMAIN($lets_data{'Selected'},$is_new_record);
if ($trt eq 'CHECKONEDOMAIN'){
#Validate form parameters for panel CHECKONEDOMAIN
%selectedrow = $c->get_selected_CHECKONEDOMAIN($lets_data{'Selected'},$is_new_record);
}
@@ -342,7 +342,7 @@ sub do_display {
# 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 = $c->get_data_for_panel_LIST();
# 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;
@@ -353,7 +353,7 @@ sub do_display {
# 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_PARAMS();
%returned_hash = $c->get_data_for_panel_PARAMS();
# 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;
@@ -364,7 +364,7 @@ sub do_display {
# 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_CHECKALLDOMAINS();
%returned_hash = $c->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;
@@ -375,18 +375,18 @@ sub do_display {
# 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_CHECKALLENABLEDDOMAINS();
%returned_hash = $c->get_data_for_panel_CHECKALLENABLEDDOMAINS();
# 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;
}
}
if ($trt eq 'CHECKONEDDOMAIN'){
if ($trt eq 'CHECKONEDOMAIN'){
# 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_CHECKONEDDOMAIN();
%returned_hash = $c->get_data_for_panel_CHECKONEDOMAIN();
# 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;
@@ -395,9 +395,8 @@ sub do_display {
# and table control fields
$c->stash(DomainList=>$c->get_DomainList());
$c->stash(DomainList=>$c->get_DomainList());
# Data for panel
$c->stash(