fix language-strings; disallow direct removing of certificates if issuer=lets encrypt; fix sql query in updater; porting nginx regex for vhost-merging

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2023-09-12 15:25:47 +02:00
parent 6ad1ca2ba9
commit 3fc18f9903
6 changed files with 12 additions and 10 deletions

View File

@@ -132,7 +132,7 @@ if (Froxlor::isDatabaseVersion('202304260')) {
Update::lastStepStatus(0);
Update::showUpdateStep("Adjusting system for data-export function");
Database::query("UPDATE `" . TABLE_PANEL_SETTINGS . "`SET `varname` = 'exportenabled' WHERE `settinggroup`= 'system' AND `varname`= 'backupenabled");
Database::query("UPDATE `" . TABLE_PANEL_SETTINGS . "`SET `varname` = 'exportenabled' WHERE `settinggroup`= 'system' AND `varname`= 'backupenabled'");
Database::query("UPDATE `" . TABLE_PANEL_SETTINGS . "`SET `value` = REPLACE(`value`, 'extras.backup', 'extras.export') WHERE `settinggroup` = 'panel' AND `varname` = 'customer_hide_options'");
Database::query("DELETE FROM `" . TABLE_PANEL_USERCOLUMNS . "` WHERE `section` = 'backup_list'");
Database::query("DELETE FROM `" . TABLE_PANEL_TASKS . "` WHERE `type` = '20'");

View File

@@ -863,13 +863,7 @@ class Nginx extends HttpConfigBase
// remove comments
$vhost = implode("\n", preg_replace('/^(\s+)?#(.*)$/', '', explode("\n", $vhost)));
// Break blocks into lines
$vhost = str_replace([
"{",
"}"
], [
" {\n",
"\n}"
], $vhost);
$vhost = preg_replace("/^(\s+)?location(.+)\{(.+)\}$/misU", "location $2 {\n $3 \n}", $vhost);
// Break into array items
$vhost = explode("\n", preg_replace('/[ \t]+/', ' ', trim(preg_replace('/\t+/', '', $vhost))));
// Remove empty lines

View File

@@ -47,4 +47,9 @@ class SSLCertificate
}
return false;
}
public static function isNotLetsEncrypt(array $attributes): bool
{
return (int)$attributes['fields']['letsencrypt'] == 0;
}
}

View File

@@ -89,6 +89,9 @@ return [
'action' => 'delete',
'id' => ':id'
],
// Let's Encrypt certificates can be removed 'correctly'
// by disabling let's encrypt for the domain
'visible' => [SSLCertificate::class, 'isNotLetsEncrypt']
],
]
]

View File

@@ -2210,7 +2210,7 @@ Yours sincerely, your administrator',
'toolselect' => 'Traffic analyzer',
'webalizer' => 'Webalizer',
'awstats' => 'AWStats',
'goaccess' => 'goacccess'
'goaccess' => 'goaccess'
],
'requires_reconfiguration' => 'Changing this settings might require a reconfiguration of the following services:<br><strong>%s</strong>',
'req_limit_per_interval' => [

View File

@@ -2176,7 +2176,7 @@ Atentamente, su administrador'
'toolselect' => 'Analizador de tráfico',
'webalizer' => 'Webalizer',
'awstats' => 'AWStats',
'goaccess' => 'goacccess'
'goaccess' => 'goaccess'
],
'requires_reconfiguration' => 'El cambio de esta configuración podría requerir una reconfiguración de los siguientes servicios:<br/><strong>%s</strong>'
],