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',