From 78495b648707c488cc81dc09ceb4b4c3e4572360 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Wed, 30 Dec 2020 16:41:26 +0100 Subject: [PATCH] update link to perl-fastcgi wiki on nginx.com; added setting to hide incompatible settings (depending on webserver) Signed-off-by: Michael Kaufmann --- actions/admin/settings/120.system.php | 8 +++++ composer.json | 2 +- composer.lock | 4 +-- install/froxlor.sql | 3 +- install/scripts/update-cli.php | 32 +++++++++++++++++++ .../updates/froxlor/0.10/update_0.10.inc.php | 13 ++++++-- lib/Froxlor/Froxlor.php | 2 +- lib/Froxlor/UI/Form.php | 15 +++++---- lng/dutch.lng.php | 2 -- lng/english.lng.php | 5 +-- lng/german.lng.php | 5 +-- lng/italian.lng.php | 3 -- 12 files changed, 71 insertions(+), 23 deletions(-) create mode 100755 install/scripts/update-cli.php diff --git a/actions/admin/settings/120.system.php b/actions/admin/settings/120.system.php index c76774b7..fb2f04b1 100644 --- a/actions/admin/settings/120.system.php +++ b/actions/admin/settings/120.system.php @@ -270,6 +270,14 @@ return array( 'default' => true, 'save_method' => 'storeSettingField' ), + 'hide_incompatible_settings' => array( + 'label' => $lng['serversettings']['hide_incompatible_settings'], + 'settinggroup' => 'system', + 'varname' => 'hide_incompatible_settings', + 'type' => 'bool', + 'default' => false, + 'save_method' => 'storeSettingField' + ), ) ) ) diff --git a/composer.json b/composer.json index 064be64c..f05f9c02 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "docs": "https://github.com/Froxlor/Froxlor/wiki" }, "require": { - "php": ">=7.0", + "php": ">=7.1", "ext-session": "*", "ext-ctype": "*", "ext-pdo": "*", diff --git a/composer.lock b/composer.lock index ef48b2d6..6d5c739e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3a662afec2507126181e0f3bbf37dd6a", + "content-hash": "6b4d603703c6ace66f732d1abff8e2f3", "packages": [ { "name": "froxlor/idna-convert-legacy", @@ -4218,7 +4218,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.0", + "php": ">=7.1", "ext-session": "*", "ext-ctype": "*", "ext-pdo": "*", diff --git a/install/froxlor.sql b/install/froxlor.sql index d049c708..9426e3e6 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -671,6 +671,7 @@ opcache.interned_strings_buffer'), ('system', 'froxloraliases', ''), ('system', 'apply_specialsettings_default', '1'), ('system', 'apply_phpconfigs_default', '1'), + ('system', 'hide_incompatible_settings', '0'), ('api', 'enabled', '0'), ('2fa', 'enabled', '1'), ('panel', 'decimal_places', '4'), @@ -706,7 +707,7 @@ opcache.interned_strings_buffer'), ('panel', 'customer_hide_options', ''), ('panel', 'is_configured', '0'), ('panel', 'version', '0.10.23.1'), - ('panel', 'db_version', '202009070'); + ('panel', 'db_version', '202012300'); DROP TABLE IF EXISTS `panel_tasks`; diff --git a/install/scripts/update-cli.php b/install/scripts/update-cli.php new file mode 100755 index 00000000..1afd5d71 --- /dev/null +++ b/install/scripts/update-cli.php @@ -0,0 +1,32 @@ +#!/usr/bin/php + (2016-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Cron + * + */ + +// Check if we're in the CLI +if (@php_sapi_name() !== 'cli') { + die('This script will only work in the shell.'); +} + +require dirname(dirname(__DIR__)) . '/vendor/autoload.php'; + +// give control to command line handler +try { + $argv[] = '--run'; + \Froxlor\Cli\UpdateCliCmd::processParameters($argc, $argv); +} catch (Exception $e) { + \Froxlor\Cli\UpdateCliCmd::printerr($e->getMessage()); +} diff --git a/install/updates/froxlor/0.10/update_0.10.inc.php b/install/updates/froxlor/0.10/update_0.10.inc.php index a53557ea..7c5c57d1 100644 --- a/install/updates/froxlor/0.10/update_0.10.inc.php +++ b/install/updates/froxlor/0.10/update_0.10.inc.php @@ -699,6 +699,15 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.22')) { } if (\Froxlor\Froxlor::isFroxlorVersion('0.10.23')) { - showUpdateStep("Updating from 0.10.23 to 0.10.23.1", false); - \Froxlor\Froxlor::updateToVersion('0.10.23.1'); + showUpdateStep("Updating from 0.10.23 to 0.10.23.1", false); + \Froxlor\Froxlor::updateToVersion('0.10.23.1'); +} + +if (\Froxlor\Froxlor::isDatabaseVersion('202009070')) { + + showUpdateStep("Adding setting to hide imcompatible settings", true); + Settings::AddNew("system.hide_incompatible_settings", '0'); + lastStepStatus(0); + + \Froxlor\Froxlor::updateToDbVersion('202012300'); } diff --git a/lib/Froxlor/Froxlor.php b/lib/Froxlor/Froxlor.php index 3ad595a1..c5d94e7d 100644 --- a/lib/Froxlor/Froxlor.php +++ b/lib/Froxlor/Froxlor.php @@ -10,7 +10,7 @@ final class Froxlor const VERSION = '0.10.23.1'; // Database version (YYYYMMDDC where C is a daily counter) - const DBVERSION = '202009070'; + const DBVERSION = '202012300'; // Distribution branding-tag (used for Debian etc.) const BRANDING = ''; diff --git a/lib/Froxlor/UI/Form.php b/lib/Froxlor/UI/Form.php index 639c7104..f91cadc5 100644 --- a/lib/Froxlor/UI/Form.php +++ b/lib/Froxlor/UI/Form.php @@ -428,7 +428,7 @@ class Form if (isset($fielddata['websrv_avail']) && is_array($fielddata['websrv_avail'])) { $websrv = Settings::Get('system.webserver'); if (! in_array($websrv, $fielddata['websrv_avail'])) { - $do_show = false; + $do_show = Settings::Get('system.hide_incompatible_settings') == '1' ? false : true; $fielddata['label'] .= sprintf($lng['serversettings']['option_unavailable_websrv'], implode(", ", $fielddata['websrv_avail'])); } } @@ -439,16 +439,17 @@ class Form if (isset($fielddata['visible']) && $do_show) { $do_show = $fielddata['visible']; if (! $do_show) { + $do_show = Settings::Get('system.hide_incompatible_settings') == '1' ? false : true; $fielddata['label'] .= $lng['serversettings']['option_unavailable']; } } - // if ($do_show) { - $returnvalue = call_user_func(array( - '\\Froxlor\\UI\\Fields', - 'getFormFieldOutput' . ucfirst($fielddata['type']) - ), $fieldname, $fielddata, $do_show); - // } + if ($do_show) { + $returnvalue = call_user_func(array( + '\\Froxlor\\UI\\Fields', + 'getFormFieldOutput' . ucfirst($fielddata['type']) + ), $fieldname, $fielddata, $do_show); + } } return $returnvalue; } diff --git a/lng/dutch.lng.php b/lng/dutch.lng.php index 6cefcf4b..87b4dc5b 100644 --- a/lng/dutch.lng.php +++ b/lng/dutch.lng.php @@ -1080,8 +1080,6 @@ $lng['panel']['unlock'] = 'ontgrendelen'; $lng['question']['customer_reallyunlock'] = 'Weet u zeker dat u klant %s? wilt ontgrendelen'; // ADDED IN FROXLOR 0.9.15-svn1 -$lng['serversettings']['perl_server']['title'] = 'Server locatie Perl'; -$lng['serversettings']['perl_server']['description'] = 'Standaard is ingesteld op de gids: http://wiki.nginx.org/SimpleCGI'; $lng['serversettings']['nginx_php_backend']['title'] = 'Nginx PHP backend'; $lng['serversettings']['nginx_php_backend']['description'] = 'dit is waar het PHP-proces luistert naar verzoeken van nginx, kan een unix socket van ip:poort combinatie zijn'; $lng['serversettings']['phpreload_command']['title'] = 'Commando voor het herladen van PHP'; diff --git a/lng/english.lng.php b/lng/english.lng.php index 245b787e..a9d21b7a 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -1173,8 +1173,8 @@ $lng['panel']['unlock'] = 'Unlock'; $lng['question']['customer_reallyunlock'] = 'Do you really want to unlock customer %s?'; // ADDED IN FROXLOR 0.9.15 -$lng['serversettings']['perl_server']['title'] = 'Perl server location'; -$lng['serversettings']['perl_server']['description'] = 'Default is set for using the guide found at: http://wiki.nginx.org/SimpleCGI'; +$lng['serversettings']['perl_server']['title'] = 'Perl server socket location'; +$lng['serversettings']['perl_server']['description'] = 'A simple guide can be found at: nginx.com'; $lng['serversettings']['nginx_php_backend']['title'] = 'Nginx PHP backend'; $lng['serversettings']['nginx_php_backend']['description'] = 'this is where the PHP process is listening for requests from nginx, can be a unix socket of ip:port combination
*NOT used with php-fpm'; $lng['serversettings']['phpreload_command']['title'] = 'PHP reload command'; @@ -2100,3 +2100,4 @@ $lng['serversettings']['awstats']['logformat']['title'] = 'LogFormat setting'; $lng['serversettings']['awstats']['logformat']['description'] = 'If you use customized logformat for your webserver, you need change the awstats LogFormat too.
Default is 1. For more information check documentation here.'; $lng['error']['cannotdeletesuperadmin'] = 'The first admin cannot be deleted.'; $lng['error']['no_wwwcnamae_ifwwwalias'] = 'Cannot set CNAME record for "www" as domain is set to generate a www-alias. Please change settings to either "No alias" or "Wildcard alias"'; +$lng['serversettings']['hide_incompatible_settings'] = 'Hide incompatible settings'; diff --git a/lng/german.lng.php b/lng/german.lng.php index 3a5be2b6..0bb94b85 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1150,8 +1150,8 @@ $lng['panel']['unlock'] = 'entsperren'; $lng['question']['customer_reallyunlock'] = 'Wollen Sie den Kunden "%s" wirklich entsperren?'; // ADDED IN FROXLOR 0.9.15 -$lng['serversettings']['perl_server']['title'] = 'Perl-Server-Ort'; -$lng['serversettings']['perl_server']['description'] = 'Der Standardwert ist diesem Guide entnommen: http://wiki.nginx.org/SimpleCGI'; +$lng['serversettings']['perl_server']['title'] = 'Perl Server-Socket'; +$lng['serversettings']['perl_server']['description'] = 'Eine einfache Anleitung hier zu findet man unter nginx.com'; $lng['serversettings']['nginx_php_backend']['title'] = 'Nginx-PHP-Backend'; $lng['serversettings']['nginx_php_backend']['description'] = 'Dies ist das Backend, auf dem PHP auf Anfragen von Nginx hört. Kann ein UNIX Socket oder eine IP:Port Kombination sein
*NICHT relevant bei php-fpm'; $lng['serversettings']['phpreload_command']['title'] = 'PHP-Reload-Befehl'; @@ -1747,3 +1747,4 @@ $lng['serversettings']['awstats']['logformat']['title'] = 'LogFormat Einstellung $lng['serversettings']['awstats']['logformat']['description'] = 'Wenn ein benutzerdefiniertes LogFormat beim Webserver verwendet wird, muss LogFormat von awstats ebenso angepasst werden.
Standard ist 1. Für weitere Informationen siehe Dokumentation unter hier.'; $lng['error']['cannotdeletesuperadmin'] = 'Der erste Administrator kann nicht gelöscht werden.'; $lng['error']['no_wwwcnamae_ifwwwalias'] = 'Es kann kein CNAME Eintrag für "www" angelegt werden, da die Domain einen www-Alias aktiviert hat. Ändere diese Einstellung auf "Kein Alias" oder "Wildcard Alias"'; +$lng['serversettings']['hide_incompatible_settings'] = 'Inkompatible Einstellungen ausblenden'; diff --git a/lng/italian.lng.php b/lng/italian.lng.php index 6489824f..851e6d87 100644 --- a/lng/italian.lng.php +++ b/lng/italian.lng.php @@ -1107,9 +1107,6 @@ $lng['panel']['unlock'] = 'unlock'; $lng['question']['customer_reallyunlock'] = 'Sei sicuro di voler sbloccare il cliente %s?'; // ADDED IN FROXLOR 0.9.15-svn1 -$lng['serversettings']['perl_server']['title'] = 'Localizzazione del server Perl'; -$lng['serversettings']['perl_server']['description'] = 'Di default è impostato per utilizzare la guida disponibile sul sito: http://wiki.nginx.org/SimpleCGI'; - $lng['serversettings']['nginx_php_backend']['title'] = 'Nginx PHP backend'; $lng['serversettings']['nginx_php_backend']['description'] = 'questo è dove in ascolto il processo PHP per le richieste da nginx, può essere un socket unix combinazione IP:Porta'; $lng['serversettings']['phpreload_command']['title'] = 'Comando riavvio PHP';