minor fixes to fpm/php resources-forms and language-strings

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-10-13 16:53:36 +02:00
parent 52857c208a
commit 6953d0f883
7 changed files with 36 additions and 14 deletions

View File

@@ -203,6 +203,11 @@ class FpmDaemons extends ApiCommand implements ResourceEntity
// validation
$description = Validate::validate($description, 'description', Validate::REGEX_DESC_TEXT, '', [], true);
$reload_cmd = Validate::validate($reload_cmd, 'reload_cmd', '', '', [], true);
$sel_stmt = Database::prepare("SELECT `id` FROM `".TABLE_PANEL_FPMDAEMONS."` WHERE `reload_cmd` = :rc");
$dupcheck = Database::pexecute_first($sel_stmt, ['rc' => $reload_cmd]);
if ($dupcheck && $dupcheck['id']) {
throw new Exception("PHP-FPM version with the given restart command already exists", 406);
}
$config_dir = Validate::validate($config_dir, 'config_dir', Validate::REGEX_DIR, '', [], true);
if (!in_array($pmanager, [
'static',
@@ -323,6 +328,11 @@ class FpmDaemons extends ApiCommand implements ResourceEntity
// validation
$description = Validate::validate($description, 'description', Validate::REGEX_DESC_TEXT, '', [], true);
$reload_cmd = Validate::validate($reload_cmd, 'reload_cmd', '', '', [], true);
$sel_stmt = Database::prepare("SELECT `id` FROM `".TABLE_PANEL_FPMDAEMONS."` WHERE `reload_cmd` = :rc");
$dupcheck = Database::pexecute_first($sel_stmt, ['rc' => $reload_cmd]);
if ($dupcheck && $dupcheck['id'] != $id) {
throw new Exception("PHP-FPM version with the given restart command already exists", 406);
}
$config_dir = Validate::validate($config_dir, 'config_dir', Validate::REGEX_DIR, '', [], true);
if (!in_array($pmanager, [
'static',

View File

@@ -25,30 +25,33 @@
return [
'fpmconfig_add' => [
'title' => lng('admin.phpsettings.addsettings'),
'title' => lng('admin.fpmsettings.addnew'),
'image' => 'fa-solid fa-plus',
'self_overview' => ['section' => 'phpsettings', 'page' => 'fpmdaemons'],
'sections' => [
'section_a' => [
'title' => lng('admin.phpsettings.addsettings'),
'title' => lng('admin.fpmsettings.addnew'),
'image' => 'icons/phpsettings_add.png',
'fields' => [
'description' => [
'label' => lng('admin.phpsettings.description'),
'type' => 'text',
'maxlength' => 50
'maxlength' => 50,
'mandatory' => true
],
'reload_cmd' => [
'label' => lng('serversettings.phpfpm_settings.reload'),
'type' => 'text',
'maxlength' => 255,
'value' => 'service php7.4-fpm restart'
'value' => 'service php7.4-fpm restart',
'mandatory' => true
],
'config_dir' => [
'label' => lng('serversettings.phpfpm_settings.configdir'),
'type' => 'text',
'maxlength' => 255,
'value' => '/etc/php/7.4/fpm/pool.d/'
'value' => '/etc/php/7.4/fpm/pool.d/',
'mandatory' => true
],
'pm' => [
'label' => lng('serversettings.phpfpm_settings.pm'),

View File

@@ -25,31 +25,34 @@
return [
'fpmconfig_edit' => [
'title' => lng('admin.phpsettings.editsettings'),
'title' => lng('admin.fpmsettings.edit'),
'image' => 'fa-solid fa-pen',
'self_overview' => ['section' => 'phpsettings', 'page' => 'fpmdaemons'],
'sections' => [
'section_a' => [
'title' => lng('admin.phpsettings.editsettings'),
'title' => lng('admin.fpmsettings.edit'),
'image' => 'icons/phpsettings_edit.png',
'fields' => [
'description' => [
'label' => lng('admin.phpsettings.description'),
'type' => 'text',
'maxlength' => 50,
'value' => $result['description']
'value' => $result['description'],
'mandatory' => true
],
'reload_cmd' => [
'label' => lng('serversettings.phpfpm_settings.reload'),
'type' => 'text',
'maxlength' => 255,
'value' => $result['reload_cmd']
'value' => $result['reload_cmd'],
'mandatory' => true
],
'config_dir' => [
'label' => lng('serversettings.phpfpm_settings.configdir'),
'type' => 'text',
'maxlength' => 255,
'value' => $result['config_dir']
'value' => $result['config_dir'],
'mandatory' => true
],
'pm' => [
'label' => lng('serversettings.phpfpm_settings.pm'),

View File

@@ -38,7 +38,8 @@ return [
'description' => [
'label' => lng('admin.phpsettings.description'),
'type' => 'text',
'maxlength' => 50
'maxlength' => 50,
'mandatory' => true
],
'binary' => [
'visible' => Settings::Get('system.mod_fcgid') == 1,
@@ -179,7 +180,8 @@ return [
'type' => 'textarea',
'cols' => 80,
'rows' => 20,
'value' => $result['phpsettings']
'value' => $result['phpsettings'],
'mandatory' => true
],
'allow_all_customers' => [
'label' => lng('serversettings.phpfpm_settings.allow_all_customers.title'),

View File

@@ -39,7 +39,8 @@ return [
'label' => lng('admin.phpsettings.description'),
'type' => 'text',
'maxlength' => 50,
'value' => $result['description']
'value' => $result['description'],
'mandatory' => true
],
'binary' => [
'visible' => Settings::Get('system.mod_fcgid') == 1,
@@ -182,7 +183,8 @@ return [
'type' => 'textarea',
'cols' => 80,
'rows' => 20,
'value' => $result['phpsettings']
'value' => $result['phpsettings'],
'mandatory' => true
],
'allow_all_customers' => [
'label' => lng('serversettings.phpfpm_settings.allow_all_customers.title'),

View File

@@ -301,6 +301,7 @@ return [
'misc' => 'Sonstiges',
'fpmsettings' => [
'addnew' => 'Neue PHP Version erstellen',
'edit' => 'PHP version bearbeiten',
],
'phpconfig' => [
'template_replace_vars' => 'Variablen, die in den Konfigurationen ersetzt werden',

View File

@@ -306,6 +306,7 @@ return [
'misc' => 'Miscellaneous',
'fpmsettings' => [
'addnew' => 'Create new PHP version',
'edit' => 'Change PHP version'
],
'phpconfig' => [
'template_replace_vars' => 'Variables that will be replaced in the configs',