Skip to content

Commit

Permalink
fix language-strings; disallow direct removing of certificates if iss…
Browse files Browse the repository at this point in the history
…uer=lets encrypt; fix sql query in updater; porting nginx regex for vhost-merging

Signed-off-by: Michael Kaufmann <[email protected]>
  • Loading branch information
d00p committed Sep 12, 2023
1 parent 6ad1ca2 commit 3fc18f9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion install/updates/froxlor/update_2.1.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
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'");
Expand Down
8 changes: 1 addition & 7 deletions lib/Froxlor/Cron/Http/Nginx.php
Original file line number Diff line number Diff line change
Expand Up @@ -863,13 +863,7 @@ private function cleanVhostStruct($vhost = null)
// 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
Expand Down
5 changes: 5 additions & 0 deletions lib/Froxlor/UI/Callbacks/SSLCertificate.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,9 @@ public static function canEditSSL(array $attributes): bool
}
return false;
}

public static function isNotLetsEncrypt(array $attributes): bool
{
return (int)$attributes['fields']['letsencrypt'] == 0;
}
}
3 changes: 3 additions & 0 deletions lib/tablelisting/tablelisting.sslcertificates.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
'action' => 'delete',
'id' => ':id'
],
// Let's Encrypt certificates can be removed 'correctly'
// by disabling let's encrypt for the domain
'visible' => [SSLCertificate::class, 'isNotLetsEncrypt']
],
]
]
Expand Down
2 changes: 1 addition & 1 deletion lng/en.lng.php
Original file line number Diff line number Diff line change
Expand Up @@ -2210,7 +2210,7 @@
'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' => [
Expand Down
2 changes: 1 addition & 1 deletion lng/es.lng.php
Original file line number Diff line number Diff line change
Expand Up @@ -2176,7 +2176,7 @@
'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>'
],
Expand Down

0 comments on commit 3fc18f9

Please sign in to comment.