don't allow activation of FCGID and PHP-FPM at the same time
This commit is contained in:
@@ -28,6 +28,7 @@ return array(
|
|||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
|
'plausibility_check_method' => 'checkFcgidPhpFpm',
|
||||||
'overview_option' => true
|
'overview_option' => true
|
||||||
),
|
),
|
||||||
'system_mod_fcgid_configdir' => array(
|
'system_mod_fcgid_configdir' => array(
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ return array(
|
|||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
|
'plausibility_check_method' => 'checkFcgidPhpFpm',
|
||||||
'overview_option' => true
|
'overview_option' => true
|
||||||
),
|
),
|
||||||
'system_phpfpm_configdir' => array(
|
'system_phpfpm_configdir' => array(
|
||||||
|
|||||||
44
lib/functions/validate/function.checkFcgidPhpFpm.php
Normal file
44
lib/functions/validate/function.checkFcgidPhpFpm.php
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the Froxlor project.
|
||||||
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the COPYING
|
||||||
|
* file that was distributed with this source code. You can also view the
|
||||||
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
|
*
|
||||||
|
* @copyright (c) the authors
|
||||||
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
|
* @package Functions
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
function checkFcgidPhpFpm($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues)
|
||||||
|
{
|
||||||
|
global $settings;
|
||||||
|
|
||||||
|
$returnvalue = array(FORMFIELDS_PLAUSIBILITY_CHECK_OK);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* check whether fcgid should be enabled but php-fpm is
|
||||||
|
*/
|
||||||
|
if($fieldname == 'system_mod_fcgid_enabled'
|
||||||
|
&& (int)$newfieldvalue == 1
|
||||||
|
&& (int)$settings['phpfpm']['enabled'] == 1
|
||||||
|
) {
|
||||||
|
$returnvalue = array(FORMFIELDS_PLAUSIBILITY_CHECK_ERROR, 'phpfpmstillenabled');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* check whether php-fpm should be enabled but fcgid is
|
||||||
|
*/
|
||||||
|
elseif($fieldname == 'system_phpfpm_enabled'
|
||||||
|
&& (int)$newfieldvalue == 1
|
||||||
|
&& (int)$settings['system']['mod_fcgid'] == 1
|
||||||
|
) {
|
||||||
|
$returnvalue = array(FORMFIELDS_PLAUSIBILITY_CHECK_ERROR, 'fcgidstillenabled');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $returnvalue;
|
||||||
|
}
|
||||||
@@ -1541,3 +1541,5 @@ $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'] = 'The d
|
|||||||
$lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'] = 'Note: Used only when pm is set to \'dynamic\'<br />Note: Mandatory when pm is set to \'dynamic\'';
|
$lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'] = 'Note: Used only when pm is set to \'dynamic\'<br />Note: Mandatory when pm is set to \'dynamic\'';
|
||||||
$lng['serversettings']['phpfpm_settings']['max_requests']['title'] = 'Requests per child before respawning';
|
$lng['serversettings']['phpfpm_settings']['max_requests']['title'] = 'Requests per child before respawning';
|
||||||
$lng['serversettings']['phpfpm_settings']['max_requests']['description'] = 'For endless request processing specify \'0\'. Equivalent to PHP_FCGI_MAX_REQUESTS.';
|
$lng['serversettings']['phpfpm_settings']['max_requests']['description'] = 'For endless request processing specify \'0\'. Equivalent to PHP_FCGI_MAX_REQUESTS.';
|
||||||
|
$lng['error']['phpfpmstillenabled'] = 'PHP-FPM is currently active. Please deactivate it before activating FCGID';
|
||||||
|
$lng['error']['fcgidstillenabled'] = 'FCGID is currently active. Please deactivate it before activating PHP-FPM';
|
||||||
|
|||||||
@@ -1523,3 +1523,5 @@ $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'] = 'Maxim
|
|||||||
$lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'] = 'Hinweis: Nur wenn PM auf \'dynamic\' steht<br />Wichtig: Pflichtangabe wenn PM auf \'dynamic\' steht';
|
$lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'] = 'Hinweis: Nur wenn PM auf \'dynamic\' steht<br />Wichtig: Pflichtangabe wenn PM auf \'dynamic\' steht';
|
||||||
$lng['serversettings']['phpfpm_settings']['max_requests']['title'] = 'Requests pro Kindprozess bevor Neuerstellung (respawning)';
|
$lng['serversettings']['phpfpm_settings']['max_requests']['title'] = 'Requests pro Kindprozess bevor Neuerstellung (respawning)';
|
||||||
$lng['serversettings']['phpfpm_settings']['max_requests']['description'] = 'Für keine Begrenzung \'0\' angeben. Equivalent zu PHP_FCGI_MAX_REQUESTS.';
|
$lng['serversettings']['phpfpm_settings']['max_requests']['description'] = 'Für keine Begrenzung \'0\' angeben. Equivalent zu PHP_FCGI_MAX_REQUESTS.';
|
||||||
|
$lng['error']['phpfpmstillenabled'] = 'PHP-FPM ist derzeit aktiviert. Bitte deaktiviere es, um FCGID zu aktivieren';
|
||||||
|
$lng['error']['fcgidstillenabled'] = 'FCGID ist derzeit aktiviert. Bitte deaktiviere es, um PHP-FPM zu aktivieren';
|
||||||
|
|||||||
Reference in New Issue
Block a user