From 5ccae3f9bb8545ca6c08168779f8639e76598bce Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Tue, 14 Dec 2021 11:23:36 +0100 Subject: [PATCH] do not check for allowed-phpconfigs if fpm/fcgid is not activated (no possibility to select a config anyway) Signed-off-by: Michael Kaufmann --- lib/Froxlor/Api/Commands/SubDomains.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/Froxlor/Api/Commands/SubDomains.php b/lib/Froxlor/Api/Commands/SubDomains.php index 3bc1efb5..c3a0a322 100644 --- a/lib/Froxlor/Api/Commands/SubDomains.php +++ b/lib/Froxlor/Api/Commands/SubDomains.php @@ -268,8 +268,11 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc } else { $allowed_phpconfigs = []; } - if (! in_array($phpsid_result['phpsettingid'], $allowed_phpconfigs)) { - \Froxlor\UI\Response::standard_error('notallowedphpconfigused', '', true); + // only with fcgid/fpm enabled will it be possible to select a php-setting + if ((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) { + if (! in_array($phpsid_result['phpsettingid'], $allowed_phpconfigs)) { + \Froxlor\UI\Response::standard_error('notallowedphpconfigused', '', true); + } } // actually insert domain @@ -654,8 +657,11 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc } else { $allowed_phpconfigs = []; } - if (! in_array($phpsettingid, $allowed_phpconfigs)) { - \Froxlor\UI\Response::standard_error('notallowedphpconfigused', '', true); + // only with fcgid/fpm enabled will it be possible to select a php-setting + if ((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) { + if (! in_array($phpsettingid, $allowed_phpconfigs)) { + \Froxlor\UI\Response::standard_error('notallowedphpconfigused', '', true); + } } // handle redirect