add option to update php-configs for all subdomains when editing a domain as admin (default: yes)
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -1363,6 +1363,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
|
||||
$phpenabled = isset($_POST['phpenabled']) ? intval($_POST['phpenabled']) : 0;
|
||||
$openbasedir = isset($_POST['openbasedir']) ? intval($_POST['openbasedir']) : 0;
|
||||
$phpfs = (isset($_POST['phpsettingsforsubdomains']) && intval($_POST['phpsettingsforsubdomains']) == 1) ? 1 : 0;
|
||||
|
||||
if ((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) {
|
||||
$phpsettingid = (int) $_POST['phpsettingid'];
|
||||
@@ -1392,6 +1393,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
}
|
||||
} else {
|
||||
$phpsettingid = $result['phpsettingid'];
|
||||
$phpfs = 1;
|
||||
$mod_fcgid_starter = $result['mod_fcgid_starter'];
|
||||
$mod_fcgid_maxrequests = $result['mod_fcgid_maxrequests'];
|
||||
}
|
||||
@@ -1399,6 +1401,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$phpenabled = $result['phpenabled'];
|
||||
$openbasedir = $result['openbasedir'];
|
||||
$phpsettingid = $result['phpsettingid'];
|
||||
$phpfs = 1;
|
||||
$mod_fcgid_starter = $result['mod_fcgid_starter'];
|
||||
$mod_fcgid_maxrequests = $result['mod_fcgid_maxrequests'];
|
||||
}
|
||||
@@ -1637,6 +1640,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
'phpenabled' => $phpenabled,
|
||||
'openbasedir' => $openbasedir,
|
||||
'phpsettingid' => $phpsettingid,
|
||||
'phpsettingsforsubdomains' => $phpfs,
|
||||
'mod_fcgid_starter' => $mod_fcgid_starter,
|
||||
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
|
||||
'specialsettings' => $specialsettings,
|
||||
@@ -1892,11 +1896,18 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$_update_data['adminid'] = $adminid;
|
||||
$_update_data['phpenabled'] = $phpenabled;
|
||||
$_update_data['openbasedir'] = $openbasedir;
|
||||
$_update_data['phpsettingid'] = $phpsettingid;
|
||||
$_update_data['mod_fcgid_starter'] = $mod_fcgid_starter;
|
||||
$_update_data['mod_fcgid_maxrequests'] = $mod_fcgid_maxrequests;
|
||||
$_update_data['parentdomainid'] = $id;
|
||||
|
||||
// if php config is to be set for all subdomains, check here
|
||||
$update_phpconfig = '';
|
||||
$phpfs = isset($_POST['phpsettingsforsubdomains']) ? 1 : 0;
|
||||
if ($phpfs == 1) {
|
||||
$_update_data['phpsettingid'] = $phpsettingid;
|
||||
$update_phpconfig = ", `phpsettingid` = :phpsettingid";
|
||||
}
|
||||
|
||||
// if we have no more ssl-ip's for this domain,
|
||||
// all its subdomains must have "ssl-redirect = 0"
|
||||
// and disable let's encrypt
|
||||
@@ -1911,10 +1922,9 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
`adminid` = :adminid,
|
||||
`phpenabled` = :phpenabled,
|
||||
`openbasedir` = :openbasedir,
|
||||
`phpsettingid` = :phpsettingid,
|
||||
`mod_fcgid_starter` = :mod_fcgid_starter,
|
||||
`mod_fcgid_maxrequests` = :mod_fcgid_maxrequests
|
||||
" . $upd_specialsettings . $updatechildren . $update_sslredirect . "
|
||||
" . $update_phpconfig . $upd_specialsettings . $updatechildren . $update_sslredirect . "
|
||||
WHERE `parentdomainid` = :parentdomainid
|
||||
");
|
||||
Database::pexecute($_update_stmt, $_update_data);
|
||||
|
||||
@@ -325,6 +325,21 @@ return array(
|
||||
'type' => 'select',
|
||||
'select_var' => $phpconfigs
|
||||
),
|
||||
'phpsettingsforsubdomains' => array(
|
||||
'visible' => ($userinfo['change_serversettings'] == '1' ? true : false),
|
||||
'label' => $lng['admin']['phpsettingsforsubdomains'],
|
||||
'desc' => $lng['serversettings']['phpsettingsforsubdomains']['description'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array(
|
||||
'1'
|
||||
)
|
||||
),
|
||||
'mod_fcgid_starter' => array(
|
||||
'visible' => ((int) Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'label' => $lng['admin']['mod_fcgid_starter']['title'],
|
||||
|
||||
@@ -2086,3 +2086,5 @@ $lng['serversettings']['disable_le_selfcheck']['title'] = "Disable Let's Encrypt
|
||||
$lng['serversettings']['disable_le_selfcheck']['description'] = "If activated, froxlor will <strong>not</strong> perform its self-check for token accessability. Needed for NATed IP's or similar.";
|
||||
$lng['menue']['phpsettings']['fpmdaemons'] = 'PHP-FPM versions';
|
||||
$lng['admin']['phpsettings']['activephpconfigs'] = 'In use for php-config(s)';
|
||||
$lng['admin']['phpsettingsforsubdomains'] = 'Apply php-config to all subdomains:';
|
||||
$lng['serversettings']['phpsettingsforsubdomains']['description'] = 'If yes the chosen php-config will be updated to all subdomains';
|
||||
|
||||
@@ -1737,3 +1737,5 @@ $lng['serversettings']['disable_le_selfcheck']['title'] = "Deaktiviere Let's Enc
|
||||
$lng['serversettings']['disable_le_selfcheck']['description'] = "Wenn aktiviert wird Froxlor <strong>keine</strong> Erreichbarkeitsprüfung des Tokens vornehmen. Nötig bei ge-NAT-eten IP's oder Ähnlichem";
|
||||
$lng['menue']['phpsettings']['fpmdaemons'] = 'PHP-FPM Versionen';
|
||||
$lng['admin']['phpsettings']['activephpconfigs'] = 'In Verwendung für PHP-Konfiguration(en)';
|
||||
$lng['admin']['phpsettingsforsubdomains'] = 'PHP-Config für alle Subdomains übernehmen:';
|
||||
$lng['serversettings']['phpsettingsforsubdomains']['description'] = 'Wenn ja, wird die gewählte PHP-Config für alle Subdomains übernommen';
|
||||
|
||||
Reference in New Issue
Block a user