From 2bb5c31a0f3ca7fdde0f46f19f234c070c35faff Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 3 Apr 2022 20:04:55 +0200 Subject: [PATCH 1/8] use correct method to get CurrentUser data-field Signed-off-by: Michael Kaufmann --- lib/Froxlor/UI/Listing.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Froxlor/UI/Listing.php b/lib/Froxlor/UI/Listing.php index 3257d9a5..41cdab71 100644 --- a/lib/Froxlor/UI/Listing.php +++ b/lib/Froxlor/UI/Listing.php @@ -216,7 +216,7 @@ class Listing $del_stmt = Database::prepare(" DELETE FROM `" . TABLE_PANEL_USERCOLUMNS . "` WHERE `" . $userid . "` = :uid AND `section` = :section "); - Database::pexecute($del_stmt, ['uid' => CurrentUser::getData($userid), 'section' => $section]); + Database::pexecute($del_stmt, ['uid' => CurrentUser::getField($userid), 'section' => $section]); // add new entry $ins_stmt = Database::prepare(" INSERT INTO `" . TABLE_PANEL_USERCOLUMNS . "` SET @@ -225,7 +225,7 @@ class Listing `columns` = :cols "); Database::pexecute($ins_stmt, [ - 'uid' => CurrentUser::getData($userid), + 'uid' => CurrentUser::getField($userid), 'section' => $section, 'cols' => json_encode($tabellisting[$section]) ]); @@ -241,7 +241,7 @@ class Listing $sel_stmt = Database::prepare(" SELECT `columns` FROM `" . TABLE_PANEL_USERCOLUMNS . "` WHERE `" . $userid . "` = :uid AND `section` = :section "); - $columns_json = Database::pexecute_first($sel_stmt, ['uid' => CurrentUser::getData($userid), 'section' => $listing]); + $columns_json = Database::pexecute_first($sel_stmt, ['uid' => CurrentUser::getField($userid), 'section' => $listing]); if ($columns_json && isset($columns_json['columns'])) { return json_decode($columns_json['columns'], true); } From 01c6096998564cae2609a0074145771e9bfd9104 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 3 Apr 2022 23:00:14 +0200 Subject: [PATCH 2/8] use correct (new) class to call getThemes() Signed-off-by: Michael Kaufmann --- actions/admin/settings/100.panel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/admin/settings/100.panel.php b/actions/admin/settings/100.panel.php index 1b580046..338e620a 100644 --- a/actions/admin/settings/100.panel.php +++ b/actions/admin/settings/100.panel.php @@ -47,7 +47,7 @@ return array( 'type' => 'select', 'default' => 'Froxlor', 'option_options_method' => array( - '\\Froxlor\\UI\\Template', + '\\Froxlor\\UI\\Panel\\UI', 'getThemes' ), 'save_method' => 'storeSettingDefaultTheme' From 578b2811a5f116d7b1c16ddab20894f63e2f00f1 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Fri, 8 Apr 2022 15:53:20 +0200 Subject: [PATCH 3/8] add new settings_mode setting to switch between basic and advanced view Signed-off-by: Michael Kaufmann --- admin_settings.php | 6 +++ install/froxlor.sql | 1 + .../updates/froxlor/0.11/update_0.11.inc.php | 8 ++- install/updates/preconfig.php | 14 +++++- .../preconfig/0.10/preconfig_0.10.inc.php | 2 +- install/updates/preconfig/0.11/index.html | 0 .../preconfig/0.11/preconfig_0.11.inc.php | 49 +++++++++++++++++++ .../preconfig/0.9/preconfig_0.9.inc.php | 4 +- lng/english.lng.php | 4 ++ lng/german.lng.php | 4 ++ .../Froxlor/settings/detailpart.html.twig | 11 +++++ templates/Froxlor/settings/index.html.twig | 11 +++-- 12 files changed, 105 insertions(+), 9 deletions(-) create mode 100644 install/updates/preconfig/0.11/index.html create mode 100644 install/updates/preconfig/0.11/preconfig_0.11.inc.php diff --git a/admin_settings.php b/admin_settings.php index 86c69eeb..7995d7eb 100644 --- a/admin_settings.php +++ b/admin_settings.php @@ -396,4 +396,10 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') { 'type' => $note_type, 'alert_msg' => $note_msg ]); +} elseif ($page == 'toggleSettingsMode') { + if ($userinfo['change_serversettings'] == '1') { + $cmode = Settings::Get('panel.settings_mode'); + Settings::Set('panel.settings_mode', (int)(!(bool)$cmode)); + } + \Froxlor\UI\Response::redirectTo($filename); } diff --git a/install/froxlor.sql b/install/froxlor.sql index 59ecdf65..ff3f5e04 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -723,6 +723,7 @@ opcache.validate_timestamps'), ('panel', 'logo_image_login', ''), ('panel', 'logo_overridetheme', '0'), ('panel', 'logo_overridecustom', '0'), + ('panel', 'settings_mode', '0'), ('panel', 'version', '0.11.0-dev1'), ('panel', 'db_version', '202112310'); diff --git a/install/updates/froxlor/0.11/update_0.11.inc.php b/install/updates/froxlor/0.11/update_0.11.inc.php index 0abcd805..51534228 100644 --- a/install/updates/froxlor/0.11/update_0.11.inc.php +++ b/install/updates/froxlor/0.11/update_0.11.inc.php @@ -56,9 +56,10 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.99')) { showUpdateStep("Cleaning up old files"); $to_clean = array( "templates/Sparkle", + "lib/version.inc.php" ); $disabled = explode(',', ini_get('disable_functions')); - $exec_allowed = ! in_array('exec', $disabled); + $exec_allowed = !in_array('exec', $disabled); $del_list = ""; foreach ($to_clean as $filedir) { $complete_filedir = \Froxlor\Froxlor::getInstallDir() . $filedir; @@ -81,6 +82,11 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.99')) { } } + showUpdateStep("Adding new settings"); + $panel_settings_mode = isset($_POST['panel_settings_mode']) ? (int) $_POST['panel_settings_mode'] : 0; + Settings::AddNew("panel.settings_mode", $panel_settings_mode); + lastStepStatus(0); + if (\Froxlor\Froxlor::isFroxlorVersion('0.10.99')) { showUpdateStep("Updating from 0.10.99 to 0.11.0-dev1", false); \Froxlor\Froxlor::updateToVersion('0.11.0-dev1'); diff --git a/install/updates/preconfig.php b/install/updates/preconfig.php index ad2c748e..688983fc 100644 --- a/install/updates/preconfig.php +++ b/install/updates/preconfig.php @@ -35,14 +35,21 @@ function getPreConfig($current_version, $current_db_version): array 'title' => '0.9.x updates', 'fields' => [] ]; - parseAndOutputPreconfig($has_preconfig, $return['section_09']['fields'], $current_version, $current_db_version); + parseAndOutputPreconfig09($has_preconfig, $return['section_09']['fields'], $current_version, $current_db_version); include_once \Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/preconfig/0.10/preconfig_0.10.inc.php'); $return['section_010'] = [ 'title' => '0.10.x updates', 'fields' => [] ]; - parseAndOutputPreconfig2($has_preconfig, $return['section_010']['fields'], $current_version, $current_db_version); + parseAndOutputPreconfig010($has_preconfig, $return['section_010']['fields'], $current_version, $current_db_version); + + include_once \Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/preconfig/0.11/preconfig_0.11.inc.php'); + $return['section_011'] = [ + 'title' => '0.11.x updates', + 'fields' => [] + ]; + parseAndOutputPreconfig011($has_preconfig, $return['section_011']['fields'], $current_version, $current_db_version); if (empty($return['section_09']['fields'])) { unset($return['section_09']); @@ -50,6 +57,9 @@ function getPreConfig($current_version, $current_db_version): array if (empty($return['section_010']['fields'])) { unset($return['section_010']); } + if (empty($return['section_011']['fields'])) { + unset($return['section_011']); + } if (!empty($return)) { $has_preconfig = true; diff --git a/install/updates/preconfig/0.10/preconfig_0.10.inc.php b/install/updates/preconfig/0.10/preconfig_0.10.inc.php index bdb9b4c1..ede8bb38 100644 --- a/install/updates/preconfig/0.10/preconfig_0.10.inc.php +++ b/install/updates/preconfig/0.10/preconfig_0.10.inc.php @@ -27,7 +27,7 @@ * * @return void */ -function parseAndOutputPreconfig2(&$has_preconfig, &$return, $current_version, $current_db_version) +function parseAndOutputPreconfig010(&$has_preconfig, &$return, $current_version, $current_db_version) { global $lng; diff --git a/install/updates/preconfig/0.11/index.html b/install/updates/preconfig/0.11/index.html new file mode 100644 index 00000000..e69de29b diff --git a/install/updates/preconfig/0.11/preconfig_0.11.inc.php b/install/updates/preconfig/0.11/preconfig_0.11.inc.php new file mode 100644 index 00000000..8266abee --- /dev/null +++ b/install/updates/preconfig/0.11/preconfig_0.11.inc.php @@ -0,0 +1,49 @@ + (2010-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Updater + * + */ + +/** + * checks if the new-version has some updating to do + * + * @param boolean $has_preconfig + * pointer to check if any preconfig has to be output + * @param string $return + * pointer to output string + * @param string $current_version + * current froxlor version + * + * @return void + */ +function parseAndOutputPreconfig011(&$has_preconfig, &$return, $current_version, $current_db_version) +{ + global $lng; + + if (versionInUpdate($current_version, '0.10.99')) { + $has_preconfig = true; + $description = 'We have rearranged the settings and split them into basic and advanced categories. This makes it easier for users who do not need all the detailed or very specific settings and options and gives a better overview of the basic/mostly used settings.'; + $return['panel_settings_mode_note'] = ['type' => 'infotext', 'value' => $description]; + $question = 'Chose settings mode (you can change that at any time)'; + $return['panel_settings_mode'] = [ + 'type' => 'select', + 'select_var' => [ + 0 => 'Basic', + 1 => 'Advanced' + ], + 'selected' => 1, + 'label' => $question + ]; + } +} diff --git a/install/updates/preconfig/0.9/preconfig_0.9.inc.php b/install/updates/preconfig/0.9/preconfig_0.9.inc.php index aa40f5a3..310d8217 100644 --- a/install/updates/preconfig/0.9/preconfig_0.9.inc.php +++ b/install/updates/preconfig/0.9/preconfig_0.9.inc.php @@ -17,8 +17,8 @@ use Froxlor\Database\Database; use Froxlor\Settings; -use PHPMailer\PHPMailer; use Froxlor\UI\Panel\UI; +use PHPMailer\PHPMailer\PHPMailer; /** * checks if the new-version has some updating to do @@ -32,7 +32,7 @@ use Froxlor\UI\Panel\UI; * * @return void */ -function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $current_db_version) +function parseAndOutputPreconfig09(&$has_preconfig, &$return, $current_version, $current_db_version) { global $lng; diff --git a/lng/english.lng.php b/lng/english.lng.php index d488a541..228af112 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -2161,3 +2161,7 @@ $lng['panel']['unspecified'] = 'unspecified'; $lng['admin']['smtptestaddr'] = 'Send test-mail to'; $lng['admin']['smtptestnote'] = 'Note that the values below reflect your current settings and can only be adjusted there (see link in top right corner)'; $lng['panel']['backtooverview'] = 'Back to overview'; +$lng['panel']['settingsmode'] = 'Mode'; +$lng['panel']['settingsmodebasic'] = 'Basic'; +$lng['panel']['settingsmodeadvanced'] = 'Advanced'; +$lng['panel']['settingsmodetoggle'] = 'Click to toggle mode'; \ No newline at end of file diff --git a/lng/german.lng.php b/lng/german.lng.php index c1af74d8..fb9961e9 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1799,3 +1799,7 @@ $lng['panel']['unspecified'] = 'keine Angabe'; $lng['admin']['smtptestaddr'] = 'Test-Email senden an'; $lng['admin']['smtptestnote'] = 'Bitte beachten: Die untenstehenden Werte reflektieren die aktuellen Einstellungen und können auch nur dort angepasst werden (siehe Link in der oberen rechten Ecke)'; $lng['panel']['backtooverview'] = 'Zurück zur Übersicht'; +$lng['panel']['settingsmode'] = 'Modus'; +$lng['panel']['settingsmodebasic'] = 'Einfach'; +$lng['panel']['settingsmodeadvanced'] = 'Erweitert'; +$lng['panel']['settingsmodetoggle'] = 'Modus umschalten'; diff --git a/templates/Froxlor/settings/detailpart.html.twig b/templates/Froxlor/settings/detailpart.html.twig index 0f43060a..97188832 100644 --- a/templates/Froxlor/settings/detailpart.html.twig +++ b/templates/Froxlor/settings/detailpart.html.twig @@ -1,5 +1,16 @@ {% extends "Froxlor/settings/index.html.twig" %} +{% block actions %} + + + {{ lng('admin.configfiles.overview') }} + + + + {{ lng('admin.configfiles.importexport') }} + +{% endblock %} + {% block settings %} {% import "Froxlor/form/formfields.html.twig" as formfields %} diff --git a/templates/Froxlor/settings/index.html.twig b/templates/Froxlor/settings/index.html.twig index 6f3983c0..70b6ecf3 100644 --- a/templates/Froxlor/settings/index.html.twig +++ b/templates/Froxlor/settings/index.html.twig @@ -11,9 +11,14 @@ {% endblock %} {% block actions %} - - - {{ lng('admin.configfiles.overview') }} + + {% if get_setting('panel.settings_mode') == 0 %} + + {{ lng('panel.settingsmode') }}: {{ lng('panel.settingsmodebasic') }} + {% else %} + + {{ lng('panel.settingsmode') }}: {{ lng('panel.settingsmodeadvanced') }} + {% endif %} From 9272c15706a6ac8518517e813797868991747ae0 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Fri, 8 Apr 2022 18:41:28 +0200 Subject: [PATCH 4/8] add advanced_mode flag to various settings; exclude from output and global-search when settings-mode is 'basic' Signed-off-by: Michael Kaufmann --- actions/admin/settings/100.panel.php | 24 +++++++---- actions/admin/settings/110.accounts.php | 3 +- actions/admin/settings/120.system.php | 18 +++++---- actions/admin/settings/122.froxlorvhost.php | 20 +++++---- actions/admin/settings/125.cronjob.php | 1 + actions/admin/settings/130.webserver.php | 45 ++++++++++++++------- actions/admin/settings/131.ssl.php | 24 +++++++---- actions/admin/settings/135.fcgid.php | 15 ++++--- actions/admin/settings/136.phpfpm.php | 24 +++++++---- actions/admin/settings/140.statistics.php | 3 +- actions/admin/settings/150.mail.php | 24 +++++++---- actions/admin/settings/160.nameserver.php | 9 +++-- actions/admin/settings/180.dkim.php | 12 ++++-- actions/admin/settings/210.security.php | 15 ++++--- actions/admin/settings/220.quota.php | 1 + install/froxlor.sql | 4 +- lib/Froxlor/Ajax/GlobalSearch.php | 7 ++++ lib/Froxlor/UI/Form.php | 8 ++++ 18 files changed, 175 insertions(+), 82 deletions(-) diff --git a/actions/admin/settings/100.panel.php b/actions/admin/settings/100.panel.php index 338e620a..8d2739af 100644 --- a/actions/admin/settings/100.panel.php +++ b/actions/admin/settings/100.panel.php @@ -74,7 +74,8 @@ return array( 'varname' => 'natsorting', 'type' => 'checkbox', 'default' => false, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'panel_paging' => array( 'label' => $lng['serversettings']['paging'], @@ -121,7 +122,8 @@ return array( 'type' => 'email', 'string_emptyallowed' => true, 'default' => '', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'panel_decimal_places' => array( 'label' => $lng['serversettings']['decimal_places'], @@ -131,7 +133,8 @@ return array( 'min' => 0, 'max' => 15, 'default' => 4, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'panel_phpmyadmin_url' => array( 'label' => $lng['serversettings']['phpmyadmin_url'], @@ -166,7 +169,8 @@ return array( 'varname' => 'show_version_login', 'type' => 'checkbox', 'default' => false, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'admin_show_version_footer' => array( 'label' => $lng['admin']['show_version_footer'], @@ -207,7 +211,8 @@ return array( 'varname' => 'allow_domain_change_admin', 'type' => 'checkbox', 'default' => false, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'panel_allow_domain_change_customer' => array( 'label' => $lng['serversettings']['panel_allow_domain_change_customer'], @@ -215,7 +220,8 @@ return array( 'varname' => 'allow_domain_change_customer', 'type' => 'checkbox', 'default' => false, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'panel_phpconfigs_hidestdsubdomain' => array( 'label' => $lng['serversettings']['panel_phpconfigs_hidestdsubdomain'], @@ -223,7 +229,8 @@ return array( 'varname' => 'phpconfigs_hidestdsubdomain', 'type' => 'checkbox', 'default' => false, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'panel_customer_hide_options' => array( 'label' => $lng['serversettings']['panel_customer_hide_options'], @@ -248,7 +255,8 @@ return array( 'traffic.ftp' => $lng['menue']['traffic']['traffic'] . " / FTP", 'traffic.mail' => $lng['menue']['traffic']['traffic'] . " / Mail" ], - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'panel_imprint_url' => array( 'label' => $lng['serversettings']['imprint_url'], diff --git a/actions/admin/settings/110.accounts.php b/actions/admin/settings/110.accounts.php index 87df7138..e6d381e2 100644 --- a/actions/admin/settings/110.accounts.php +++ b/actions/admin/settings/110.accounts.php @@ -128,7 +128,8 @@ return array( 'varname' => 'password_regex', 'type' => 'text', 'default' => '', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'customer_accountprefix' => array( 'label' => $lng['serversettings']['accountprefix'], diff --git a/actions/admin/settings/120.system.php b/actions/admin/settings/120.system.php index 3661ad3e..afc676dc 100644 --- a/actions/admin/settings/120.system.php +++ b/actions/admin/settings/120.system.php @@ -144,7 +144,8 @@ return array( 'type' => 'text', 'string_regexp' => '/^[a-zA-Z0-9]{1,6}$/', 'default' => 'html', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_store_index_file_subs' => array( 'label' => $lng['serversettings']['system_store_index_file_subs'], @@ -195,7 +196,6 @@ return array( 'default' => 90, 'save_method' => 'storeSettingField' ), - 'system_mail_use_smtp' => array( 'label' => $lng['serversettings']['mail_use_smtp'], 'settinggroup' => 'system', @@ -260,7 +260,8 @@ return array( 'varname' => 'apply_specialsettings_default', 'type' => 'checkbox', 'default' => true, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_apply_phpconfigs_default' => array( 'label' => $lng['serversettings']['apply_phpconfigs_default'], @@ -268,7 +269,8 @@ return array( 'varname' => 'apply_phpconfigs_default', 'type' => 'checkbox', 'default' => true, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_domaindefaultalias' => array( 'label' => $lng['admin']['domaindefaultalias'], @@ -281,15 +283,17 @@ return array( '1' => $lng['domains']['serveraliasoption_www'], '2' => $lng['domains']['serveraliasoption_none'] ), - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'hide_incompatible_settings' => array( 'label' => $lng['serversettings']['hide_incompatible_settings'], 'settinggroup' => 'system', 'varname' => 'hide_incompatible_settings', 'type' => 'checkbox', - 'default' => false, - 'save_method' => 'storeSettingField' + 'default' => true, + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), ) ) diff --git a/actions/admin/settings/122.froxlorvhost.php b/actions/admin/settings/122.froxlorvhost.php index 8453a918..be6f6d98 100644 --- a/actions/admin/settings/122.froxlorvhost.php +++ b/actions/admin/settings/122.froxlorvhost.php @@ -39,7 +39,8 @@ return array( 'string_regexp' => '/^(([a-z0-9\-\._]+, ?)*[a-z0-9\-\._]+)?$/i', 'string_emptyallowed' => true, 'default' => '', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), /** * SSL / Let's Encrypt @@ -75,12 +76,13 @@ return array( 'type' => 'number', 'min' => 0, 'max' => 94608000, // 3-years - 'default' => 0, + 'default' => 10368000, 'save_method' => 'storeSettingField', 'visible' => \Froxlor\Settings::Get('system.use_ssl') && call_user_func(array( '\Froxlor\Settings\FroxlorVhostSettings', 'hasVhostContainerEnabled' - ), true) + ), true), + 'advanced_mode' => true ), 'system_hsts_incsub' => array( 'label' => $lng['admin']['domain_hsts_incsub'], @@ -92,7 +94,8 @@ return array( 'visible' => \Froxlor\Settings::Get('system.use_ssl') && call_user_func(array( '\Froxlor\Settings\FroxlorVhostSettings', 'hasVhostContainerEnabled' - ), true) + ), true), + 'advanced_mode' => true ), 'system_hsts_preload' => array( 'label' => $lng['admin']['domain_hsts_preload'], @@ -104,7 +107,8 @@ return array( 'visible' => \Froxlor\Settings::Get('system.use_ssl') && call_user_func(array( '\Froxlor\Settings\FroxlorVhostSettings', 'hasVhostContainerEnabled' - ), true) + ), true), + 'advanced_mode' => true ), 'system_honorcipherorder' => array( 'label' => $lng['admin']['domain_honorcipherorder'], @@ -116,7 +120,8 @@ return array( 'visible' => \Froxlor\Settings::Get('system.use_ssl') && call_user_func(array( '\Froxlor\Settings\FroxlorVhostSettings', 'hasVhostContainerEnabled' - ), true) + ), true), + 'advanced_mode' => true ), 'system_sessiontickets' => array( 'label' => $lng['admin']['domain_sessiontickets'], @@ -128,7 +133,8 @@ return array( 'visible' => \Froxlor\Settings::Get('system.use_ssl') && call_user_func(array( '\Froxlor\Settings\FroxlorVhostSettings', 'hasVhostContainerEnabled' - ), true) + ), true), + 'advanced_mode' => true ), /** * FCGID diff --git a/actions/admin/settings/125.cronjob.php b/actions/admin/settings/125.cronjob.php index 8b0b731f..9217f1c4 100644 --- a/actions/admin/settings/125.cronjob.php +++ b/actions/admin/settings/125.cronjob.php @@ -19,6 +19,7 @@ return array( 'crond' => array( 'title' => $lng['admin']['cronsettings'], 'icon' => 'fa-solid fa-clock-rotate-left', + 'advanced_mode' => true, 'fields' => array( 'system_cronconfig' => array( 'label' => $lng['serversettings']['system_cronconfig'], diff --git a/actions/admin/settings/130.webserver.php b/actions/admin/settings/130.webserver.php index 57c74a30..265519b2 100644 --- a/actions/admin/settings/130.webserver.php +++ b/actions/admin/settings/130.webserver.php @@ -60,7 +60,8 @@ return array( 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 0 && \Froxlor\Settings::Get('phpfpm.enabled') == 0), 'websrv_avail' => array( 'apache2' - ) + ), + 'advanced_mode' => true ), 'system_http2_support' => array( 'label' => $lng['serversettings']['http2_support'], @@ -84,7 +85,8 @@ return array( 'string_emptyallowed' => true, 'default' => '', 'save_method' => 'storeSettingField', - 'visible' => \Froxlor\Settings::Get('system.use_ssl') + 'visible' => \Froxlor\Settings::Get('system.use_ssl'), + 'advanced_mode' => true ), 'system_httpuser' => array( 'label' => $lng['admin']['webserver_user'], @@ -147,7 +149,8 @@ return array( 'save_method' => 'storeSettingField', 'websrv_avail' => array( 'apache2' - ) + ), + 'advanced_mode' => true ), 'system_logfiles_piped' => array( 'label' => $lng['serversettings']['logfiles_piped'], @@ -158,7 +161,8 @@ return array( 'save_method' => 'storeSettingField', 'websrv_avail' => array( 'apache2' - ) + ), + 'advanced_mode' => true ), 'system_logfiles_format' => array( 'label' => $lng['serversettings']['logfiles_format'], @@ -172,7 +176,8 @@ return array( 'apache2', 'nginx' ), - 'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1 + 'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1, + 'advanced_mode' => true ), 'system_logfiles_type' => array( 'label' => $lng['serversettings']['logfiles_type'], @@ -227,7 +232,8 @@ return array( 'type' => 'text', 'string_emptyallowed' => true, 'default' => '', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_deactivateddocroot' => array( 'label' => $lng['serversettings']['deactivateddocroot'], @@ -245,7 +251,8 @@ return array( 'varname' => 'default_vhostconf', 'type' => 'textarea', 'default' => '', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_default_sslvhostconf' => array( 'label' => $lng['serversettings']['default_sslvhostconf'], @@ -254,7 +261,8 @@ return array( 'type' => 'textarea', 'default' => '', 'save_method' => 'storeSettingField', - 'visible' => \Froxlor\Settings::Get('system.use_ssl') == 1 + 'visible' => \Froxlor\Settings::Get('system.use_ssl') == 1, + 'advanced_mode' => true ), 'system_include_default_vhostconf' => array( 'label' => $lng['serversettings']['includedefault_sslvhostconf'], @@ -262,7 +270,8 @@ return array( 'varname' => 'include_default_vhostconf', 'type' => 'checkbox', 'default' => false, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_apache_globaldiropt' => array( 'label' => $lng['serversettings']['apache_globaldiropt'], @@ -274,7 +283,8 @@ return array( 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 0 && \Froxlor\Settings::Get('phpfpm.enabled') == 0), 'websrv_avail' => array( 'apache2' - ) + ), + 'advanced_mode' => true ), 'system_apachereload_command' => array( 'label' => $lng['serversettings']['apachereload_command'], @@ -324,7 +334,8 @@ return array( 'varname' => 'enabled', 'type' => 'checkbox', 'default' => false, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'defaultwebsrverrhandler_err401' => array( 'label' => $lng['serversettings']['defaultwebsrverrhandler_err401'], @@ -336,7 +347,8 @@ return array( 'websrv_avail' => array( 'apache2', 'nginx' - ) + ), + 'advanced_mode' => true ), 'defaultwebsrverrhandler_err403' => array( 'label' => $lng['serversettings']['defaultwebsrverrhandler_err403'], @@ -348,7 +360,8 @@ return array( 'websrv_avail' => array( 'apache2', 'nginx' - ) + ), + 'advanced_mode' => true ), 'defaultwebsrverrhandler_err404' => array( 'label' => $lng['serversettings']['defaultwebsrverrhandler_err404'], @@ -356,7 +369,8 @@ return array( 'varname' => 'err404', 'type' => 'text', 'default' => '', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'defaultwebsrverrhandler_err500' => array( 'label' => $lng['serversettings']['defaultwebsrverrhandler_err500'], @@ -368,7 +382,8 @@ return array( 'websrv_avail' => array( 'apache2', 'nginx' - ) + ), + 'advanced_mode' => true ), 'customredirect_enabled' => array( 'label' => $lng['serversettings']['customredirect_enabled'], diff --git a/actions/admin/settings/131.ssl.php b/actions/admin/settings/131.ssl.php index 22f3719f..eee8d887 100644 --- a/actions/admin/settings/131.ssl.php +++ b/actions/admin/settings/131.ssl.php @@ -53,7 +53,8 @@ return array( 'type' => 'text', 'string_emptyallowed' => false, 'default' => 'ECDH+AESGCM:ECDH+AES256:!aNULL:!MD5:!DSS:!DH:!AES128', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_tlsv13_cipher_list' => array( 'label' => $lng['serversettings']['ssl']['tlsv13_cipher_list'], @@ -63,7 +64,8 @@ return array( 'string_emptyallowed' => true, 'default' => '', 'visible' => \Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_ssl_cert_file' => array( 'label' => $lng['serversettings']['ssl']['ssl_cert_file'], @@ -113,7 +115,8 @@ return array( 'string_emptyallowed' => false, 'default' => 'shmcb:/var/run/apache2/ocsp-stapling.cache(131072)', 'visible' => \Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_sessionticketsenabled' => array( 'label' => $lng['admin']['domain_sessionticketsenabled'], @@ -122,7 +125,8 @@ return array( 'type' => 'checkbox', 'default' => true, 'save_method' => 'storeSettingField', - 'visible' => \Froxlor\Settings::Get('system.use_ssl') && (\Froxlor\Settings::Get('system.webserver') == "nginx" || (\Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1)) + 'visible' => \Froxlor\Settings::Get('system.use_ssl') && (\Froxlor\Settings::Get('system.webserver') == "nginx" || (\Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1)), + 'advanced_mode' => true ), 'system_leenabled' => array( 'label' => $lng['serversettings']['leenabled'], @@ -140,7 +144,8 @@ return array( 'type' => 'text', 'string_type' => 'file', 'default' => '/root/.acme.sh/acme.sh', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_letsencryptacmeconf' => array( 'label' => $lng['serversettings']['letsencryptacmeconf'], @@ -188,7 +193,8 @@ return array( 'type' => 'text', 'string_emptyallowed' => false, 'default' => \Froxlor\Froxlor::getInstallDir(), - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_letsencryptkeysize' => array( 'label' => $lng['serversettings']['letsencryptkeysize'], @@ -215,7 +221,8 @@ return array( '256' => 'ec-256', '384' => 'ec-384' ), - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_letsencryptreuseold' => array( 'label' => $lng['serversettings']['letsencryptreuseold'], @@ -223,7 +230,8 @@ return array( 'varname' => 'letsencryptreuseold', 'type' => 'checkbox', 'default' => true, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_disable_le_selfcheck' => array( 'label' => $lng['serversettings']['le_domain_dnscheck'], diff --git a/actions/admin/settings/135.fcgid.php b/actions/admin/settings/135.fcgid.php index 541774bf..fc4a9dd3 100644 --- a/actions/admin/settings/135.fcgid.php +++ b/actions/admin/settings/135.fcgid.php @@ -68,7 +68,8 @@ return array( 'string_delimiter' => ':', 'string_emptyallowed' => true, 'default' => '/usr/share/php/:/usr/share/php5/', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_mod_fcgid_wrapper' => array( 'label' => $lng['serversettings']['mod_fcgid']['wrapper'], @@ -83,7 +84,8 @@ return array( 'save_method' => 'storeSettingField', 'websrv_avail' => array( 'apache2' - ) + ), + 'advanced_mode' => true ), 'system_mod_fcgid_starter' => array( 'label' => $lng['serversettings']['mod_fcgid']['starter'], @@ -92,7 +94,8 @@ return array( 'type' => 'number', 'min' => 0, 'default' => 0, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_mod_fcgid_maxrequests' => array( 'label' => $lng['serversettings']['mod_fcgid']['maxrequests'], @@ -100,7 +103,8 @@ return array( 'varname' => 'mod_fcgid_maxrequests', 'type' => 'number', 'default' => 250, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_mod_fcgid_defaultini' => array( 'label' => $lng['serversettings']['mod_fcgid']['defaultini'], @@ -119,7 +123,8 @@ return array( 'varname' => 'mod_fcgid_idle_timeout', 'type' => 'number', 'default' => 30, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ) ) ) diff --git a/actions/admin/settings/136.phpfpm.php b/actions/admin/settings/136.phpfpm.php index 903afaf4..a575ca53 100644 --- a/actions/admin/settings/136.phpfpm.php +++ b/actions/admin/settings/136.phpfpm.php @@ -52,7 +52,8 @@ return array( 'type' => 'text', 'string_type' => 'confdir', 'default' => '/var/www/php-fpm/', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_phpfpm_tmpdir' => array( 'label' => $lng['serversettings']['mod_fcgid']['tmpdir'], @@ -72,7 +73,8 @@ return array( 'string_delimiter' => ':', 'string_emptyallowed' => true, 'default' => '/usr/share/php/:/usr/share/php5/', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_phpfpm_envpath' => array( 'label' => $lng['serversettings']['phpfpm_settings']['envpath'], @@ -83,7 +85,8 @@ return array( 'string_delimiter' => ':', 'string_emptyallowed' => true, 'default' => '/usr/local/bin:/usr/bin:/bin', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_phpfpm_fastcgi_ipcdir' => array( 'label' => $lng['serversettings']['phpfpm_settings']['ipcdir'], @@ -92,7 +95,8 @@ return array( 'type' => 'text', 'string_type' => 'dir', 'default' => '/var/lib/apache2/fastcgi/', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_phpfpm_use_mod_proxy' => array( 'label' => $lng['phpfpm']['use_mod_proxy'], @@ -109,7 +113,8 @@ return array( 'varname' => 'ini_flags', 'type' => 'textarea', 'default' => '', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_phpfpm_ini_values' => array( 'label' => $lng['phpfpm']['ini_values'], @@ -117,7 +122,8 @@ return array( 'varname' => 'ini_values', 'type' => 'textarea', 'default' => '', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_phpfpm_ini_admin_flags' => array( 'label' => $lng['phpfpm']['ini_admin_flags'], @@ -125,7 +131,8 @@ return array( 'varname' => 'ini_admin_flags', 'type' => 'textarea', 'default' => '', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_phpfpm_ini_admin_values' => array( 'label' => $lng['phpfpm']['ini_admin_values'], @@ -133,7 +140,8 @@ return array( 'varname' => 'ini_admin_values', 'type' => 'textarea', 'default' => '', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ) ) ) diff --git a/actions/admin/settings/140.statistics.php b/actions/admin/settings/140.statistics.php index 2a074263..dc305362 100644 --- a/actions/admin/settings/140.statistics.php +++ b/actions/admin/settings/140.statistics.php @@ -91,7 +91,8 @@ return array( 'type' => 'text', 'default' => '1', 'save_method' => 'storeSettingField', - 'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1 + 'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1, + 'advanced_mode' => true ) ) ) diff --git a/actions/admin/settings/150.mail.php b/actions/admin/settings/150.mail.php index 029eaf64..2f13b111 100644 --- a/actions/admin/settings/150.mail.php +++ b/actions/admin/settings/150.mail.php @@ -30,7 +30,8 @@ return array( 'default' => 2000, 'min' => 2, 'max' => 65535, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_vmail_gid' => array( 'label' => $lng['serversettings']['vmail_gid'], @@ -40,7 +41,8 @@ return array( 'default' => 2000, 'min' => 2, 'max' => 65535, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_vmail_homedir' => array( 'label' => $lng['serversettings']['vmail_homedir'], @@ -59,7 +61,8 @@ return array( 'string_type' => 'dir', 'default' => 'Maildir', 'string_emptyallowed' => true, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'panel_sendalternativemail' => array( 'label' => $lng['serversettings']['sendalternativemail'], @@ -99,7 +102,8 @@ return array( 'varname' => 'mailtraffic_enabled', 'type' => 'checkbox', 'default' => true, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_mdaserver' => array( 'label' => $lng['serversettings']['mdaserver'], @@ -111,7 +115,8 @@ return array( 'courier' => 'Courier', 'dovecot' => 'Dovecot' ), - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_mdalog' => array( 'label' => $lng['serversettings']['mdalog'], @@ -121,7 +126,8 @@ return array( 'string_type' => 'file', 'default' => '/var/log/mail.log', 'string_emptyallowed' => true, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_mtaserver' => array( 'label' => $lng['serversettings']['mtaserver'], @@ -133,7 +139,8 @@ return array( 'exim4' => 'Exim4', 'postfix' => 'Postfix' ), - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_mtalog' => array( 'label' => $lng['serversettings']['mtalog'], @@ -143,7 +150,8 @@ return array( 'string_type' => 'file', 'default' => '/var/log/mail.log', 'string_emptyallowed' => true, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ) ) ) diff --git a/actions/admin/settings/160.nameserver.php b/actions/admin/settings/160.nameserver.php index dbbd83f8..bccbd278 100644 --- a/actions/admin/settings/160.nameserver.php +++ b/actions/admin/settings/160.nameserver.php @@ -109,7 +109,8 @@ return array( 'Native' => 'Native', 'Master' => 'Master' ), - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_dns_createmailentry' => array( 'label' => $lng['serversettings']['mail_also_with_mxservers'], @@ -125,7 +126,8 @@ return array( 'varname' => 'dns_createcaaentry', 'type' => 'checkbox', 'default' => true, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'caa_caa_entry' => array( 'label' => $lng['serversettings']['caa_entry_custom'], @@ -133,7 +135,8 @@ return array( 'varname' => 'caa_entry', 'type' => 'textarea', 'default' => '', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_defaultttl' => array( 'label' => $lng['serversettings']['defaultttl'], diff --git a/actions/admin/settings/180.dkim.php b/actions/admin/settings/180.dkim.php index ccb5775b..15ba6909 100644 --- a/actions/admin/settings/180.dkim.php +++ b/actions/admin/settings/180.dkim.php @@ -47,7 +47,8 @@ return array( 'type' => 'text', 'string_regexp' => '/^[a-z0-9\._]+$/i', 'default' => '.priv', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'dkim_domains' => array( 'label' => $lng['dkim']['dkim_domains'], @@ -79,7 +80,8 @@ return array( 'sha1' => 'SHA1', 'sha256' => 'SHA256' ), - 'save_method' => 'storeSettingFieldInsertBindTask' + 'save_method' => 'storeSettingFieldInsertBindTask', + 'advanced_mode' => true ), 'dkim_servicetype' => array( 'label' => $lng['dkim']['dkim_servicetype'], @@ -91,7 +93,8 @@ return array( '0' => 'All', '1' => 'E-Mail' ), - 'save_method' => 'storeSettingFieldInsertBindTask' + 'save_method' => 'storeSettingFieldInsertBindTask', + 'advanced_mode' => true ), 'dkim_keylength' => array( 'label' => array( @@ -115,7 +118,8 @@ return array( 'type' => 'text', 'string_regexp' => '/^[a-z0-9\._]+$/i', 'default' => '', - 'save_method' => 'storeSettingFieldInsertBindTask' + 'save_method' => 'storeSettingFieldInsertBindTask', + 'advanced_mode' => true ), 'dkimrestart_command' => array( 'label' => $lng['dkim']['dkimrestart_command'], diff --git a/actions/admin/settings/210.security.php b/actions/admin/settings/210.security.php index e11f7c89..051c5d69 100644 --- a/actions/admin/settings/210.security.php +++ b/actions/admin/settings/210.security.php @@ -36,7 +36,8 @@ return array( 'varname' => 'mailpwcleartext', 'type' => 'checkbox', 'default' => false, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_passwordcryptfunc' => array( 'label' => $lng['serversettings']['passwordcryptfunc'], @@ -48,7 +49,8 @@ return array( '\\Froxlor\\System\\Crypt', 'getAvailablePasswordHashes' ), - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_allow_error_report_admin' => array( 'label' => $lng['serversettings']['allow_error_report_admin'], @@ -72,7 +74,8 @@ return array( 'varname' => 'allow_customer_shell', 'type' => 'checkbox', 'default' => false, - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_available_shells' => array( 'label' => $lng['serversettings']['available_shells'], @@ -81,7 +84,8 @@ return array( 'type' => 'text', 'string_emptyallowed' => true, 'default' => '', - 'save_method' => 'storeSettingField' + 'save_method' => 'storeSettingField', + 'advanced_mode' => true ), 'system_froxlorusergroup' => array( 'label' => $lng['serversettings']['froxlorusergroup'], @@ -94,7 +98,8 @@ return array( '\\Froxlor\\Validate\\Check', 'checkLocalGroup' ), - 'visible' => \Froxlor\Settings::Get('system.nssextrausers') + 'visible' => \Froxlor\Settings::Get('system.nssextrausers'), + 'advanced_mode' => true ), ) ) diff --git a/actions/admin/settings/220.quota.php b/actions/admin/settings/220.quota.php index 949343b3..f03b324b 100644 --- a/actions/admin/settings/220.quota.php +++ b/actions/admin/settings/220.quota.php @@ -18,6 +18,7 @@ return array( 'diskquota' => array( 'title' => $lng['diskquota'], 'icon' => 'fa-solid fa-sliders', + 'advanced_mode' => true, 'fields' => array( 'diskquota_enabled' => array( 'label' => $lng['serversettings']['diskquota_enabled'], diff --git a/install/froxlor.sql b/install/froxlor.sql index ff3f5e04..53a9673b 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -653,7 +653,7 @@ opcache.validate_timestamps'), ('system', 'mail_smtp_auth', '1'), ('system', 'mail_smtp_user', ''), ('system', 'mail_smtp_passwd', ''), - ('system', 'hsts_maxage', '0'), + ('system', 'hsts_maxage', '10368000'), ('system', 'hsts_incsub', '0'), ('system', 'hsts_preload', '0'), ('system', 'leregistered', '0'), @@ -675,7 +675,7 @@ opcache.validate_timestamps'), ('system', 'froxloraliases', ''), ('system', 'apply_specialsettings_default', '1'), ('system', 'apply_phpconfigs_default', '1'), - ('system', 'hide_incompatible_settings', '0'), + ('system', 'hide_incompatible_settings', '1'), ('system', 'include_default_vhostconf', '0'), ('system', 'soaemail', ''), ('system', 'domaindefaultalias', '0'), diff --git a/lib/Froxlor/Ajax/GlobalSearch.php b/lib/Froxlor/Ajax/GlobalSearch.php index c57bf059..6e466a6d 100644 --- a/lib/Froxlor/Ajax/GlobalSearch.php +++ b/lib/Froxlor/Ajax/GlobalSearch.php @@ -4,6 +4,7 @@ namespace Froxlor\Ajax; use Froxlor\Froxlor; use Froxlor\PhpHelper; +use Froxlor\Settings; use Froxlor\UI\Collection; /** @@ -50,9 +51,15 @@ class GlobalSearch $pk = explode(".", $pathkey); if (count($pk) > 4) { $settingkey = $pk[0] . '.' . $pk[1] . '.' . $pk[2] . '.' . $pk[3]; + if (isset($settings_data[$pk[0]][$pk[1]]['advanced_mode']) && $settings_data[$pk[0]][$pk[1]]['advanced_mode'] && (int) Settings::Get('panel.settings_mode') == 0) { + continue; + } if (is_array($processed['settings']) && !array_key_exists($settingkey, $processed['settings'])) { $processed['settings'][$settingkey] = true; $sresult = $settings_data[$pk[0]][$pk[1]][$pk[2]][$pk[3]]; + if (isset($sresult['advanced_mode']) && $sresult['advanced_mode'] && (int) Settings::Get('panel.settings_mode') == 0) { + continue; + } if ($sresult['type'] != 'hidden') { if (!isset($result['settings'])) { $result['settings'] = []; diff --git a/lib/Froxlor/UI/Form.php b/lib/Froxlor/UI/Form.php index f56c1033..d56ec2a7 100644 --- a/lib/Froxlor/UI/Form.php +++ b/lib/Froxlor/UI/Form.php @@ -12,6 +12,10 @@ class Form if (\Froxlor\Validate\Form::validateFormDefinition($form)) { foreach ($form['groups'] as $groupname => $groupdetails) { + // check for advanced mode sections + if (isset($groupdetails['advanced_mode']) && $groupdetails['advanced_mode'] && (int) Settings::Get('panel.settings_mode') == 0) { + continue; + } // show overview if ($part == '' || $part == 'all') { if (isset($groupdetails['title']) && $groupdetails['title'] != '') { @@ -48,6 +52,10 @@ class Form if (\Froxlor\Validate\Form::validateFieldDefinition($groupdetails)) { // Collect form field output foreach ($groupdetails['fields'] as $fieldname => $fielddetails) { + // check for advanced mode sections + if (isset($fielddetails['advanced_mode']) && $fielddetails['advanced_mode'] && (int) Settings::Get('panel.settings_mode') == 0) { + continue; + } $fields[$fieldname] = self::getFormFieldOutput($fieldname, $fielddetails); $fields[$fieldname] = array_merge($fields[$fieldname], self::prefetchFormFieldData($fieldname, $fielddetails)); } From 7f0eb97f9b10b862f819a52e856a5932fbb8a109 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sat, 9 Apr 2022 13:32:08 +0200 Subject: [PATCH 5/8] show apikey details in modal-overlay; todo: edit allowed_from and valid_until Signed-off-by: Michael Kaufmann --- api_keys.php | 1 - install/froxlor.sql | 2 +- lib/Froxlor/UI/Callbacks/Text.php | 19 +++++++ lib/Froxlor/UI/Listing.php | 5 ++ lib/formfields/formfield.api_key.php | 57 ++++++++++++++++++++ lib/tablelisting/tablelisting.apikeys.php | 7 +-- lng/english.lng.php | 3 +- lng/german.lng.php | 1 + templates/Froxlor/form/form.html.twig | 40 +++++++------- templates/Froxlor/table/macros.html.twig | 50 +++++++++++------ templates/Froxlor/user/inline-form.html.twig | 2 + 11 files changed, 143 insertions(+), 44 deletions(-) create mode 100644 lib/formfields/formfield.api_key.php create mode 100644 templates/Froxlor/user/inline-form.html.twig diff --git a/api_keys.php b/api_keys.php index 710a70c6..d57fa51b 100644 --- a/api_keys.php +++ b/api_keys.php @@ -30,7 +30,6 @@ use Froxlor\UI\Request; $del_stmt = Database::prepare("DELETE FROM `" . TABLE_API_KEYS . "` WHERE id = :id"); $success_message = ""; $id = (int) Request::get('id'); -$area = AREA; // do the delete and then just show a success-message and the apikeys list again if ($action == 'delete') { diff --git a/install/froxlor.sql b/install/froxlor.sql index 53a9673b..ef49e250 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -864,7 +864,7 @@ CREATE TABLE `panel_fpmdaemons` ( INSERT INTO `panel_fpmdaemons` (`id`, `description`, `reload_cmd`, `config_dir`) VALUES -(1, 'System default', 'service php7.3-fpm restart', '/etc/php/7.3/fpm/pool.d/'); +(1, 'System default', 'service php7.4-fpm restart', '/etc/php/7.4/fpm/pool.d/'); diff --git a/lib/Froxlor/UI/Callbacks/Text.php b/lib/Froxlor/UI/Callbacks/Text.php index 7e98fab1..12e6ead0 100644 --- a/lib/Froxlor/UI/Callbacks/Text.php +++ b/lib/Froxlor/UI/Callbacks/Text.php @@ -4,6 +4,7 @@ namespace Froxlor\UI\Callbacks; use Froxlor\PhpHelper; use Froxlor\UI\Panel\UI; +use Froxlor\Froxlor; use Froxlor\User; /** @@ -65,4 +66,22 @@ class Text { return wordwrap($attributes['data'], 100, '
', true); } + + public static function apikeyDetailModal(array $attributes): array + { + $linker = UI::getLinker(); + $result = $attributes['fields']; + $apikey_data = include Froxlor::getInstallDir() . '/lib/formfields/formfield.api_key.php'; + + $body = UI::twig()->render(UI::getTheme().'/user/inline-form.html.twig', [ + 'formaction' => $linker->getLink(array('section' => 'index', 'page' => 'apikeys')), + 'formdata' => $apikey_data['apikey'], + 'editid' => $attributes['fields']['id'] + ]); + return [ + 'id' => 'akModal' . $attributes['fields']['id'], + 'title' => 'API-key ' . ($attributes['fields']['loginname'] ?? $attributes['fields']['adminname']), + 'body' => $body + ]; + } } diff --git a/lib/Froxlor/UI/Listing.php b/lib/Froxlor/UI/Listing.php index 41cdab71..4d55dc3f 100644 --- a/lib/Froxlor/UI/Listing.php +++ b/lib/Froxlor/UI/Listing.php @@ -171,6 +171,11 @@ class Listing // Set actual link from linker $actions[$key]['href'] = $linker->getLink($action['href']); } + + // modal trigger - always require a valid callback + if (isset($action['modal']) && !empty($action['modal'])) { + $actions[$key]['modal'] = call_user_func($action['modal'], ['fields' => $item]); + } } return $actions; diff --git a/lib/formfields/formfield.api_key.php b/lib/formfields/formfield.api_key.php new file mode 100644 index 00000000..2bff23a4 --- /dev/null +++ b/lib/formfields/formfield.api_key.php @@ -0,0 +1,57 @@ + (2010-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Formfields + * + */ +return [ + 'apikey' => [ + 'title' => UI::getLng('menue.main.apikeys'), + 'sections' => [ + 'section_a' => [ + 'fields' => [ + 'loginname' => [ + 'label' => UI::getLng('login.username'), + 'type' => 'label', + 'value' => $result['loginname'] ?? $result['adminname'] + ], + 'apikey' => [ + 'label' => 'API key', + 'type' => 'text', + 'readonly' => true, + 'value' => $result['apikey'] + ], + 'secret' => [ + 'label' => 'Secret', + 'type' => 'text', + 'readonly' => true, + 'value' => $result['secret'] + ], + 'allowed_from' => [ + 'label' => UI::getLng('apikeys.allowed_from'), + 'type' => 'text', + 'value' => $result['allowed_from'], + ], + 'valid_until' => [ + 'label' => UI::getLng('apikeys.valid_until'), + 'type' => 'text', + 'value' => $result['valid_until'], + 'format_callback' => [Text::class, 'timestampUntil'], + ] + ] + ] + ] + ] +]; diff --git a/lib/tablelisting/tablelisting.apikeys.php b/lib/tablelisting/tablelisting.apikeys.php index a87fd0ac..87698817 100644 --- a/lib/tablelisting/tablelisting.apikeys.php +++ b/lib/tablelisting/tablelisting.apikeys.php @@ -61,12 +61,7 @@ return [ 'show' => [ 'icon' => 'fa fa-eye', 'title' => $lng['apikeys']['clicktoview'], - 'href' => [ - 'section' => 'index', - 'page' => 'apikeys', - 'action' => '#', - 'id' => ':id' - ], + 'modal' => [Text::class, 'apikeyDetailModal'], ], 'delete' => [ 'icon' => 'fa fa-trash', diff --git a/lng/english.lng.php b/lng/english.lng.php index 228af112..6e36e933 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -2164,4 +2164,5 @@ $lng['panel']['backtooverview'] = 'Back to overview'; $lng['panel']['settingsmode'] = 'Mode'; $lng['panel']['settingsmodebasic'] = 'Basic'; $lng['panel']['settingsmodeadvanced'] = 'Advanced'; -$lng['panel']['settingsmodetoggle'] = 'Click to toggle mode'; \ No newline at end of file +$lng['panel']['settingsmodetoggle'] = 'Click to toggle mode'; +$lng['panel']['modalclose'] = 'Close'; diff --git a/lng/german.lng.php b/lng/german.lng.php index fb9961e9..bed2dfeb 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1803,3 +1803,4 @@ $lng['panel']['settingsmode'] = 'Modus'; $lng['panel']['settingsmodebasic'] = 'Einfach'; $lng['panel']['settingsmodeadvanced'] = 'Erweitert'; $lng['panel']['settingsmodetoggle'] = 'Modus umschalten'; +$lng['panel']['modalclose'] = 'Schließen'; diff --git a/templates/Froxlor/form/form.html.twig b/templates/Froxlor/form/form.html.twig index 46738174..629daff0 100644 --- a/templates/Froxlor/form/form.html.twig +++ b/templates/Froxlor/form/form.html.twig @@ -1,4 +1,4 @@ -{% macro form(form_data, formaction, title = "", hiddenid = "") %} +{% macro form(form_data, formaction, title = "", hiddenid = "", nosubmit = false) %} {% import "Froxlor/form/formfields.html.twig" as formfields %} @@ -21,25 +21,27 @@ {% endfor %} - -
- {% if hiddenid is not empty %} - - {% endif %} - - - - -
- {% if form_data.buttons is defined and form_data.buttons is iterable %} - {% for btn in form_data.buttons %} - - {% endfor %} - {% else %} - - + {% if nosubmit == false %} + +
+ {% if hiddenid is not empty %} + {% endif %} + + + + +
+ {% if form_data.buttons is defined and form_data.buttons is iterable %} + {% for btn in form_data.buttons %} + + {% endfor %} + {% else %} + + + {% endif %} +
-
+ {% endif %} {% endmacro %} diff --git a/templates/Froxlor/table/macros.html.twig b/templates/Froxlor/table/macros.html.twig index d82189f8..3944e548 100644 --- a/templates/Froxlor/table/macros.html.twig +++ b/templates/Froxlor/table/macros.html.twig @@ -31,27 +31,45 @@ {% macro link(data) %} {% apply spaceless %} -
- {% if data.icon is defined %} - - {% endif %} - {% if data.text is defined %} - {{ data.text }} - {% endif %} - + + {% if data.icon is defined %} + + {% endif %} + {% if data.text is defined %} + {{ data.text }} + {% endif %} + {% endapply %} {% endmacro %} {% macro button(data) %} {% apply spaceless %} - - {% if data.icon is defined %} - - {% endif %} - {% if data.text is defined %} - {{ data.text }} - {% endif %} - + + {% if data.icon is defined %} + + {% endif %} + {% if data.text is defined %} + {{ data.text }} + {% endif %} + + {% if data.modal is defined and data.modal is iterable %} + + {% endif %} {% endapply %} {% endmacro %} diff --git a/templates/Froxlor/user/inline-form.html.twig b/templates/Froxlor/user/inline-form.html.twig new file mode 100644 index 00000000..1a391ccf --- /dev/null +++ b/templates/Froxlor/user/inline-form.html.twig @@ -0,0 +1,2 @@ +{% import "Froxlor/form/form.html.twig" as form %} +{{ form.form(formdata, formaction|default('#'), formdata.title, editid|default(''), true) }} From 0f4325f68d39a4c9f58655fbf3bc0f96175940fa Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 10 Apr 2022 10:05:21 +0200 Subject: [PATCH 6/8] migrate shell/helper scripts to symfony/console components Signed-off-by: Michael Kaufmann --- bin/froxlor-cli | 18 + composer.json | 3 +- composer.lock | 580 ++++++++++++------ install/scripts/config-services.php | 32 - install/scripts/index.html | 0 install/scripts/switch-server-ip.php | 32 - lib/Froxlor/Cli/Action.php | 18 - .../Cli/Action/ConfigServicesAction.php | 456 -------------- .../Cli/Action/PhpSessioncleanAction.php | 99 --- .../Cli/Action/SwitchServerIpAction.php | 186 ------ lib/Froxlor/Cli/Action/index.html | 0 lib/Froxlor/Cli/CmdLineHandler.php | 216 ------- lib/Froxlor/Cli/ConfigServices.php | 475 ++++++++++++++ lib/Froxlor/Cli/ConfigServicesCmd.php | 79 --- lib/Froxlor/Cli/PhpSessionclean.php | 88 +++ lib/Froxlor/Cli/PhpSessioncleanCmd.php | 64 -- lib/Froxlor/Cli/SwitchServerIp.php | 181 ++++++ lib/Froxlor/Cli/SwitchServerIpCmd.php | 68 -- lib/Froxlor/Cron/CronConfig.php | 2 +- scripts/php-sessionclean.php | 32 - .../settings/configuration-final.html.twig | 2 +- 21 files changed, 1146 insertions(+), 1485 deletions(-) create mode 100755 bin/froxlor-cli delete mode 100755 install/scripts/config-services.php delete mode 100644 install/scripts/index.html delete mode 100755 install/scripts/switch-server-ip.php delete mode 100644 lib/Froxlor/Cli/Action.php delete mode 100644 lib/Froxlor/Cli/Action/ConfigServicesAction.php delete mode 100644 lib/Froxlor/Cli/Action/PhpSessioncleanAction.php delete mode 100644 lib/Froxlor/Cli/Action/SwitchServerIpAction.php delete mode 100644 lib/Froxlor/Cli/Action/index.html delete mode 100644 lib/Froxlor/Cli/CmdLineHandler.php create mode 100644 lib/Froxlor/Cli/ConfigServices.php delete mode 100644 lib/Froxlor/Cli/ConfigServicesCmd.php create mode 100644 lib/Froxlor/Cli/PhpSessionclean.php delete mode 100644 lib/Froxlor/Cli/PhpSessioncleanCmd.php create mode 100644 lib/Froxlor/Cli/SwitchServerIp.php delete mode 100644 lib/Froxlor/Cli/SwitchServerIpCmd.php delete mode 100755 scripts/php-sessionclean.php diff --git a/bin/froxlor-cli b/bin/froxlor-cli new file mode 100755 index 00000000..df75b0b0 --- /dev/null +++ b/bin/froxlor-cli @@ -0,0 +1,18 @@ +#!/usr/bin/env php +add(new ConfigServices()); +$application->add(new PhpSessionclean()); +$application->add(new SwitchServerIp()); +$application->run(); diff --git a/composer.json b/composer.json index 9aa5c221..aba7f797 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,8 @@ "froxlor/idna-convert-legacy": "^2.1", "voku/anti-xss": "^4.1", "twig/twig": "^3.3", - "erusev/parsedown": "^1.7" + "erusev/parsedown": "^1.7", + "symfony/console": "^6.0" }, "require-dev": { "phpunit/phpunit": "^9", diff --git a/composer.lock b/composer.lock index ef01a54a..67408b97 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": "51513cb9d850aec753c740ee37871430", + "content-hash": "1744b69cc6cb1d92362c44860a6baeac", "packages": [ { "name": "erusev/parsedown", @@ -276,6 +276,54 @@ ], "time": "2021-11-25T16:34:11+00:00" }, + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" + }, + "time": "2021-11-05T16:50:12+00:00" + }, { "name": "psr/log", "version": "1.1.4", @@ -396,6 +444,168 @@ ], "time": "2021-10-20T12:19:55+00:00" }, + { + "name": "symfony/console", + "version": "v6.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "70dcf7b2ca2ea08ad6ebcc475f104a024fb5632e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/70dcf7b2ca2ea08ad6ebcc475f104a024fb5632e", + "reference": "70dcf7b2ca2ea08ad6ebcc475f104a024fb5632e", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.4|^6.0" + }, + "conflict": { + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/event-dispatcher": "^5.4|^6.0", + "symfony/lock": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/var-dumper": "^5.4|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v6.0.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-03-31T17:18:25+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-12T14:48:14+00:00" + }, { "name": "symfony/polyfill-ctype", "version": "v1.24.0", @@ -885,6 +1095,174 @@ ], "time": "2021-05-27T09:17:38+00:00" }, + { + "name": "symfony/service-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-04T16:48:04+00:00" + }, + { + "name": "symfony/string", + "version": "v6.0.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "522144f0c4c004c80d56fa47e40e17028e2eefc2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/522144f0c4c004c80d56fa47e40e17028e2eefc2", + "reference": "522144f0c4c004c80d56fa47e40e17028e2eefc2", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.0" + }, + "require-dev": { + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v6.0.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:55:41+00:00" + }, { "name": "twig/twig", "version": "v3.3.8", @@ -2561,54 +2939,6 @@ ], "time": "2022-01-24T07:33:35+00:00" }, - { - "name": "psr/container", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" - }, - "time": "2021-11-05T16:50:12+00:00" - }, { "name": "sebastian/cli-parser", "version": "1.0.1", @@ -3858,73 +4188,6 @@ ], "time": "2022-01-26T16:28:35+00:00" }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.5.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-07-12T14:48:14+00:00" - }, { "name": "symfony/filesystem", "version": "v5.4.3", @@ -4151,89 +4414,6 @@ ], "time": "2021-09-13T13:58:11+00:00" }, - { - "name": "symfony/service-contracts", - "version": "v2.5.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-11-04T16:48:04+00:00" - }, { "name": "theseer/tokenizer", "version": "1.2.1", @@ -4367,5 +4547,5 @@ "platform-dev": { "ext-pcntl": "*" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.2.0" } diff --git a/install/scripts/config-services.php b/install/scripts/config-services.php deleted file mode 100755 index 9ba08d08..00000000 --- a/install/scripts/config-services.php +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/php - (2018-) - * @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 { - \Froxlor\Cli\ConfigServicesCmd::processParameters($argc, $argv); -} catch (Exception $e) { - \Froxlor\Cli\ConfigServicesCmd::printerr($e->getMessage()); - exit(1); -} diff --git a/install/scripts/index.html b/install/scripts/index.html deleted file mode 100644 index e69de29b..00000000 diff --git a/install/scripts/switch-server-ip.php b/install/scripts/switch-server-ip.php deleted file mode 100755 index b76e5b3c..00000000 --- a/install/scripts/switch-server-ip.php +++ /dev/null @@ -1,32 +0,0 @@ -#!/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 { - \Froxlor\Cli\SwitchServerIpCmd::processParameters($argc, $argv); -} catch (Exception $e) { - \Froxlor\Cli\SwitchServerIpCmd::printerr($e->getMessage()); - exit(1); -} diff --git a/lib/Froxlor/Cli/Action.php b/lib/Froxlor/Cli/Action.php deleted file mode 100644 index 3f079d48..00000000 --- a/lib/Froxlor/Cli/Action.php +++ /dev/null @@ -1,18 +0,0 @@ -_args = $args; - } - - public function getActionName() - { - return get_called_class(); - } - - abstract public function run(); -} diff --git a/lib/Froxlor/Cli/Action/ConfigServicesAction.php b/lib/Froxlor/Cli/Action/ConfigServicesAction.php deleted file mode 100644 index 1cd6a5d1..00000000 --- a/lib/Froxlor/Cli/Action/ConfigServicesAction.php +++ /dev/null @@ -1,456 +0,0 @@ -validate(); - } - - /** - * validates the parsed command line parameters - * - * @throws \Exception - */ - private function validate() - { - global $lng; - - $this->checkConfigParam(true); - $this->parseConfig(); - - require FROXLOR_INSTALL_DIR . '/lib/tables.inc.php'; - - include_once FROXLOR_INSTALL_DIR . '/lng/english.lng.php'; - include_once FROXLOR_INSTALL_DIR . '/lng/lng_references.php'; - - if (array_key_exists("import-settings", $this->_args)) { - $this->importSettings(); - } - - if (array_key_exists("create", $this->_args)) { - $this->createConfig(); - } elseif (array_key_exists("apply", $this->_args)) { - $this->applyConfig(); - } elseif (array_key_exists("list-daemons", $this->_args) || array_key_exists("daemon", $this->_args)) { - ConfigServicesCmd::printwarn("--list-daemons and --daemon only work together with --apply"); - } - } - - private function importSettings() - { - if (strtoupper(substr($this->_args["import-settings"], 0, 4)) == 'HTTP') { - echo "Settings file seems to be an URL, trying to download" . PHP_EOL; - $target = "/tmp/froxlor-import-settings-" . time() . ".json"; - if (@file_exists($target)) { - @unlink($target); - } - $this->downloadFile($this->_args["import-settings"], $target); - $this->_args["import-settings"] = $target; - } - if (! is_file($this->_args["import-settings"])) { - throw new \Exception("Given settings file is not a file"); - } elseif (! file_exists($this->_args["import-settings"])) { - throw new \Exception("Given settings file cannot be found ('" . $this->_args["import-settings"] . "')"); - } elseif (! is_readable($this->_args["import-settings"])) { - throw new \Exception("Given settings file cannot be read ('" . $this->_args["import-settings"] . "')"); - } - $imp_content = file_get_contents($this->_args["import-settings"]); - SImExporter::import($imp_content); - ConfigServicesCmd::printsucc("Successfully imported settings from '" . $this->_args["import-settings"] . "'"); - } - - private function createConfig() - { - $_daemons_config = array( - 'distro' => "" - ); - - $config_dir = FROXLOR_INSTALL_DIR . '/lib/configfiles/'; - // show list of available distro's - $distros = glob($config_dir . '*.xml'); - // tmp array - $distributions_select_data = array(); - - //set default os. - $os_dist = array('ID' => 'bullseye'); - $os_version = array('0' => '11'); - $os_default = $os_dist['ID']; - - //read os-release - if(file_exists('/etc/os-release')) { - $os_dist = parse_ini_file('/etc/os-release', false); - if(is_array($os_dist) && array_key_exists('ID', $os_dist) && array_key_exists('VERSION_ID', $os_dist)) { - $os_version = explode('.',$os_dist['VERSION_ID'])[0]; - } - } - - // read in all the distros - foreach ($distros as $_distribution) { - // get configparser object - $dist = new \Froxlor\Config\ConfigParser($_distribution); - // get distro-info - $dist_display = $this->getCompleteDistroName($dist); - // store in tmp array - $distributions_select_data[$dist_display] = str_replace(".xml", "", strtolower(basename($_distribution))); - - //guess if this is the current distro. - $ver = explode('.', $dist->distributionVersion)[0]; - if (strtolower($os_dist['ID']) == strtolower($dist->distributionName) && $os_version == $ver) { - $os_default = str_replace(".xml", "", strtolower(basename($_distribution))); - } - } - - // sort by distribution name - ksort($distributions_select_data); - - // list all distributions - $mask = "|%-50.50s |%-50.50s |\n"; - printf($mask, str_repeat("-", 50), str_repeat("-", 50)); - printf($mask, 'dist', 'name'); - printf($mask, str_repeat("-", 50), str_repeat("-", 50)); - foreach ($distributions_select_data as $name => $filename) { - printf($mask, $filename, $name); - } - printf($mask, str_repeat("-", 50), str_repeat("-", 50)); - echo PHP_EOL; - - while (! in_array($_daemons_config['distro'], $distributions_select_data)) { - $_daemons_config['distro'] = ConfigServicesCmd::getInput("choose distribution", $os_default); - } - - // go through all services and let user check whether to include it or not - $configfiles = new \Froxlor\Config\ConfigParser($config_dir . '/' . $_daemons_config['distro'] . ".xml"); - $services = $configfiles->getServices(); - - foreach ($services as $si => $service) { - echo PHP_EOL . "--- " . strtoupper($si) . " ---" . PHP_EOL . PHP_EOL; - $_daemons_config[$si] = ""; - - $daemons = $service->getDaemons(); - $mask = "|%-50.50s |%-50.50s |\n"; - printf($mask, str_repeat("-", 50), str_repeat("-", 50)); - printf($mask, 'value', 'name'); - printf($mask, str_repeat("-", 50), str_repeat("-", 50)); - $default_daemon = ""; - foreach ($daemons as $di => $dd) { - $title = $dd->title; - if ($dd->default) { - $default_daemon = $di; - $title = $title . " (default)"; - } - printf($mask, $di, $title); - } - printf($mask, "x", "No " . $si); - $daemons['x'] = 'x'; - printf($mask, str_repeat("-", 50), str_repeat("-", 50)); - echo PHP_EOL; - if ($si == 'system') { - $_daemons_config[$si] = array(); - // for the system/other services we need a multiple choice possibility - ConfigServicesCmd::println("Select every service you need. Enter empty value when done"); - $sysservice = ""; - do { - $sysservice = ConfigServicesCmd::getInput("choose service"); - if (! empty($sysservice)) { - $_daemons_config[$si][] = $sysservice; - } - } while (! empty($sysservice)); - // add 'cron' as fixed part (doesn't hurt if it exists) - if (! in_array('cron', $_daemons_config[$si])) { - $_daemons_config[$si][] = 'cron'; - } - } else { - // for all others -> only one value - while (! array_key_exists($_daemons_config[$si], $daemons)) { - $_daemons_config[$si] = ConfigServicesCmd::getInput("choose service", $default_daemon); - } - } - } - - echo PHP_EOL . PHP_EOL; - $daemons_config = json_encode($_daemons_config); - $output = ConfigServicesCmd::getInput("choose output-filename", "/tmp/froxlor-config-" . date('Ymd') . ".json"); - file_put_contents($output, $daemons_config); - ConfigServicesCmd::printsucc("Successfully generated service-configfile '" . $output . "'"); - echo PHP_EOL; - ConfigServicesCmd::printsucc("You can now apply this config running:" . PHP_EOL . "php " . FROXLOR_INSTALL_DIR . "install/scripts/config-services.php --apply=" . $output); - echo PHP_EOL; - $proceed = ConfigServicesCmd::getYesNo("Do you want to apply the config now? [y/N]", 0); - if ($proceed) { - passthru("php " . FROXLOR_INSTALL_DIR . "install/scripts/config-services.php --apply=" . $output); - } - } - - private function getCompleteDistroName($cparser) - { - // get distro-info - $dist_display = $cparser->distributionName; - if ($cparser->distributionCodename != '') { - $dist_display .= " " . $cparser->distributionCodename; - } - if ($cparser->distributionVersion != '') { - $dist_display .= " (" . $cparser->distributionVersion . ")"; - } - if ($cparser->deprecated) { - $dist_display .= " [deprecated]"; - } - return $dist_display; - } - - private function applyConfig() - { - if (strtoupper(substr($this->_args["apply"], 0, 4)) == 'HTTP') { - echo "Config file seems to be an URL, trying to download" . PHP_EOL; - $target = "/tmp/froxlor-config-" . time() . ".json"; - if (@file_exists($target)) { - @unlink($target); - } - $this->downloadFile($this->_args["apply"], $target); - $this->_args["apply"] = $target; - } - if (! is_file($this->_args["apply"])) { - throw new \Exception("Given config file is not a file"); - } elseif (! file_exists($this->_args["apply"])) { - throw new \Exception("Given config file cannot be found ('" . $this->_args["apply"] . "')"); - } elseif (! is_readable($this->_args["apply"])) { - throw new \Exception("Given config file cannot be read ('" . $this->_args["apply"] . "')"); - } - - $config = file_get_contents($this->_args["apply"]); - $decoded_config = json_decode($config, true); - - if (array_key_exists("list-daemons", $this->_args)) { - $mask = "|%-50.50s |%-50.50s |\n"; - printf($mask, str_repeat("-", 50), str_repeat("-", 50)); - printf($mask, 'service', 'daemon'); - printf($mask, str_repeat("-", 50), str_repeat("-", 50)); - foreach ($decoded_config as $service => $daemon) { - if (is_array($daemon) && count($daemon) > 0) { - foreach ($daemon as $sysdaemon) { - printf($mask, $service, $sysdaemon); - } - } else { - if ($daemon == 'x') { - $daemon = '--- skipped ---'; - } - printf($mask, $service, $daemon); - } - } - printf($mask, str_repeat("-", 50), str_repeat("-", 50)); - echo PHP_EOL; - exit(); - } - - $only_daemon = null; - if (array_key_exists("daemon", $this->_args)) { - $only_daemon = $this->_args['daemon']; - } - - if (! empty($decoded_config)) { - $config_dir = FROXLOR_INSTALL_DIR . '/lib/configfiles/'; - $configfiles = new \Froxlor\Config\ConfigParser($config_dir . '/' . $decoded_config['distro'] . ".xml"); - $services = $configfiles->getServices(); - $replace_arr = $this->getReplacerArray(); - - foreach ($services as $si => $service) { - echo PHP_EOL . "--- Configuring: " . strtoupper($si) . " ---" . PHP_EOL . PHP_EOL; - if (! isset($decoded_config[$si]) || $decoded_config[$si] == 'x') { - ConfigServicesCmd::printwarn("Skipping " . strtoupper($si) . " configuration as desired"); - continue; - } - $daemons = $service->getDaemons(); - foreach ($daemons as $di => $dd) { - // check for desired service - if (($si != 'system' && $decoded_config[$si] != $di) || (is_array($decoded_config[$si]) && ! in_array($di, $decoded_config[$si]))) { - continue; - } - ConfigServicesCmd::println("Configuring '" . $di . "'"); - - if (! empty($only_daemon) && $only_daemon != $di) { - ConfigServicesCmd::printwarn("Skipping " . $di . " configuration as desired"); - continue; - } - // run all cmds - $confarr = $dd->getConfig(); - foreach ($confarr as $action) { - switch ($action['type']) { - case "install": - ConfigServicesCmd::println("Installing required packages"); - $result = null; - passthru(strtr($action['content'], $replace_arr), $result); - if (strlen($result) > 1) { - echo $result; - } - break; - case "command": - exec(strtr($action['content'], $replace_arr)); - break; - case "file": - if (array_key_exists('content', $action)) { - ConfigServicesCmd::printwarn("Creating file '" . $action['name'] . "'"); - file_put_contents($action['name'], trim(strtr($action['content'], $replace_arr))); - } elseif (array_key_exists('subcommands', $action)) { - foreach ($action['subcommands'] as $fileaction) { - if (array_key_exists('execute', $fileaction) && $fileaction['execute'] == "pre") { - exec(strtr($fileaction['content'], $replace_arr)); - } elseif (array_key_exists('execute', $fileaction) && $fileaction['execute'] == "post") { - exec(strtr($fileaction['content'], $replace_arr)); - } elseif ($fileaction['type'] == 'file') { - ConfigServicesCmd::printwarn("Creating file '" . $fileaction['name'] . "'"); - file_put_contents($fileaction['name'], trim(strtr($fileaction['content'], $replace_arr))); - } - } - } - break; - } - } - } - } - // set is_configured flag - Settings::Set('panel.is_configured', '1', true); - // run cronjob at the end to ensure configs are all up to date - exec('php ' . FROXLOR_INSTALL_DIR . '/scripts/froxlor_master_cronjob.php --force'); - // and done - ConfigServicesCmd::printsucc("All services have been configured"); - } else { - ConfigServicesCmd::printerr("Unable to decode given JSON file"); - } - } - - private function getReplacerArray() - { - $customer_tmpdir = '/tmp/'; - if (Settings::Get('system.mod_fcgid') == '1' && Settings::Get('system.mod_fcgid_tmpdir') != '') { - $customer_tmpdir = Settings::Get('system.mod_fcgid_tmpdir'); - } elseif (Settings::Get('phpfpm.enabled') == '1' && Settings::Get('phpfpm.tmpdir') != '') { - $customer_tmpdir = Settings::Get('phpfpm.tmpdir'); - } - - // try to convert namserver hosts to ip's - $ns_ips = ""; - $known_ns_ips = []; - if (Settings::Get('system.nameservers') != '') { - $nameservers = explode(',', Settings::Get('system.nameservers')); - foreach ($nameservers as $nameserver) { - $nameserver = trim($nameserver); - // DNS servers might be multi homed; allow transfer from all ip - // addresses of the DNS server - $nameserver_ips = \Froxlor\PhpHelper::gethostbynamel6($nameserver); - // append dot to hostname - if (substr($nameserver, - 1, 1) != '.') { - $nameserver .= '.'; - } - // ignore invalid responses - if (! is_array($nameserver_ips)) { - // act like \Froxlor\PhpHelper::gethostbynamel6() and return unmodified hostname on error - $nameserver_ips = array( - $nameserver - ); - } else { - $known_ns_ips = array_merge($known_ns_ips, $nameserver_ips); - } - if (!empty($ns_ips)) { - $ns_ips .= ','; - } - $ns_ips .= implode(",", $nameserver_ips); - } - } - - // AXFR server - if (Settings::Get('system.axfrservers') != '') { - $axfrservers = explode(',', Settings::Get('system.axfrservers')); - foreach ($axfrservers as $axfrserver) { - if (!in_array(trim($axfrserver), $known_ns_ips)) { - if (!empty($ns_ips)) { - $ns_ips .= ','; - } - $ns_ips .= trim($axfrserver); - } - } - } - - Database::needSqlData(); - $sql = Database::getSqlData(); - - $replace_arr = array( - '' => $sql['user'], - '' => $sql['passwd'], - '' => $sql['db'], - '' => $sql['host'], - '' => isset($sql['socket']) ? $sql['socket'] : null, - '' => Settings::Get('system.hostname'), - '' => Settings::Get('system.ipaddress'), - '' => Settings::Get('system.nameservers'), - '' => $ns_ips, - '' => Settings::Get('system.vmail_homedir'), - '' => Settings::Get('system.vmail_uid'), - '' => Settings::Get('system.vmail_gid'), - '' => (Settings::Get('system.use_ssl') == '1') ? 'imaps pop3s' : '', - '' => \Froxlor\FileDir::makeCorrectDir($customer_tmpdir), - '' => \Froxlor\FileDir::makeCorrectDir(FROXLOR_INSTALL_DIR), - '' => \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.bindconf_directory')), - '' => Settings::Get('system.apachereload_command'), - '' => \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.logfiles_directory')), - '' => \Froxlor\FileDir::makeCorrectDir(Settings::Get('phpfpm.fastcgi_ipcdir')), - '' => Settings::Get('system.httpgroup') - ); - return $replace_arr; - } - - private function parseConfig() - { - define('FROXLOR_INSTALL_DIR', $this->_args['froxlor-dir']); - if (! class_exists('\\Froxlor\\Database\\Database')) { - throw new \Exception("Could not find froxlor's Database class. Is froxlor really installed to '" . FROXLOR_INSTALL_DIR . "'?"); - } - if (! file_exists(FROXLOR_INSTALL_DIR . '/lib/userdata.inc.php')) { - throw new \Exception("Could not find froxlor's userdata.inc.php file. You should use this script only with a fully installed and setup froxlor system."); - } - } - - private function checkConfigParam($needed = false) - { - if ($needed) { - if (! isset($this->_args["froxlor-dir"])) { - $this->_args["froxlor-dir"] = \Froxlor\Froxlor::getInstallDir(); - } elseif (! is_dir($this->_args["froxlor-dir"])) { - throw new \Exception("Given --froxlor-dir parameter is not a directory"); - } elseif (! file_exists($this->_args["froxlor-dir"])) { - throw new \Exception("Given froxlor directory cannot be found ('" . $this->_args["froxlor-dir"] . "')"); - } elseif (! is_readable($this->_args["froxlor-dir"])) { - throw new \Exception("Given froxlor directory cannot be read ('" . $this->_args["froxlor-dir"] . "')"); - } - } - } - - private function downloadFile($src, $dest) - { - set_time_limit(0); - // This is the file where we save the information - $fp = fopen($dest, 'w+'); - // Here is the file we are downloading, replace spaces with %20 - $ch = curl_init(str_replace(" ", "%20", $src)); - curl_setopt($ch, CURLOPT_TIMEOUT, 50); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - // write curl response to file - curl_setopt($ch, CURLOPT_FILE, $fp); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); - // get curl response - curl_exec($ch); - curl_close($ch); - fclose($fp); - } -} diff --git a/lib/Froxlor/Cli/Action/PhpSessioncleanAction.php b/lib/Froxlor/Cli/Action/PhpSessioncleanAction.php deleted file mode 100644 index ee93883b..00000000 --- a/lib/Froxlor/Cli/Action/PhpSessioncleanAction.php +++ /dev/null @@ -1,99 +0,0 @@ -validate(); - - if ((int) Settings::Get('phpfpm.enabled') == 1) { - if (isset($this->_args["max-lifetime"]) && is_numeric($this->_args["max-lifetime"]) && $this->_args["max-lifetime"] > 0) { - $this->cleanSessionfiles((int)$this->_args["max-lifetime"]); - } else { - // use default max-lifetime value - $this->cleanSessionfiles(); - } - } - } - - /** - * validates the parsed command line parameters - * - * @throws \Exception - */ - private function validate() - { - global $lng; - - $this->checkConfigParam(true); - $this->parseConfig(); - - require FROXLOR_INSTALL_DIR . '/lib/tables.inc.php'; - } - - private function cleanSessionfiles(int $maxlifetime = 1440) - { - // store paths to clean up - $paths_to_clean = []; - // get all pool-config directories configured - $sel_stmt = Database::prepare("SELECT DISTINCT `config_dir` FROM `" . TABLE_PANEL_FPMDAEMONS . "`"); - Database::pexecute($sel_stmt); - while ($fpmd = $sel_stmt->fetch(\PDO::FETCH_ASSOC)) { - $poolfiles = glob(\Froxlor\FileDir::makeCorrectFile($fpmd['config_dir'] . '/*.conf')); - foreach ($poolfiles as $cf) { - $contents = file_get_contents($cf); - $pattern = preg_quote('session.save_path', '/'); - $pattern = "/" . $pattern . ".+?\=(.*)/"; - if (preg_match_all($pattern, $contents, $matches)) { - $paths_to_clean[] = \Froxlor\FileDir::makeCorrectDir(trim($matches[1][0])); - } - } - } - - // every path is just needed once - $paths_to_clean = array_unique($paths_to_clean); - - if (count($paths_to_clean) > 0) { - foreach ($paths_to_clean as $ptc) { - // find all files older then maxlifetime and delete them - \Froxlor\FileDir::safe_exec("find -O3 \"" . $ptc . "\" -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin \"+" . $maxlifetime . "\" -delete"); - } - } - } - private function parseConfig() - { - define('FROXLOR_INSTALL_DIR', $this->_args['froxlor-dir']); - if (!class_exists('\\Froxlor\\Database\\Database')) { - throw new \Exception("Could not find froxlor's Database class. Is froxlor really installed to '" . FROXLOR_INSTALL_DIR . "'?"); - } - if (!file_exists(FROXLOR_INSTALL_DIR . '/lib/userdata.inc.php')) { - throw new \Exception("Could not find froxlor's userdata.inc.php file. You should use this script only with a fully installed and setup froxlor system."); - } - } - - private function checkConfigParam($needed = false) - { - if ($needed) { - if (!isset($this->_args["froxlor-dir"])) { - $this->_args["froxlor-dir"] = \Froxlor\Froxlor::getInstallDir(); - } elseif (!is_dir($this->_args["froxlor-dir"])) { - throw new \Exception("Given --froxlor-dir parameter is not a directory"); - } elseif (!file_exists($this->_args["froxlor-dir"])) { - throw new \Exception("Given froxlor directory cannot be found ('" . $this->_args["froxlor-dir"] . "')"); - } elseif (!is_readable($this->_args["froxlor-dir"])) { - throw new \Exception("Given froxlor directory cannot be read ('" . $this->_args["froxlor-dir"] . "')"); - } - } - } -} diff --git a/lib/Froxlor/Cli/Action/SwitchServerIpAction.php b/lib/Froxlor/Cli/Action/SwitchServerIpAction.php deleted file mode 100644 index fe6719a5..00000000 --- a/lib/Froxlor/Cli/Action/SwitchServerIpAction.php +++ /dev/null @@ -1,186 +0,0 @@ -validate(); - } - - /** - * validates the parsed command line parameters - * - * @throws \Exception - */ - private function validate() - { - $need_config = false; - if (array_key_exists("list", $this->_args) || array_key_exists("switch", $this->_args)) { - $need_config = true; - } - - $this->checkConfigParam($need_config); - - $this->parseConfig(); - - if (array_key_exists("list", $this->_args)) { - $this->listIPs(); - } - if (array_key_exists("switch", $this->_args)) { - $this->switchIPs(); - } - } - - private function listIPs() - { - $sel_stmt = Database::prepare("SELECT * FROM panel_ipsandports ORDER BY ip ASC, port ASC"); - Database::pexecute($sel_stmt); - $ips = $sel_stmt->fetchAll(\PDO::FETCH_ASSOC); - $mask = "|%-10.10s |%-50.50s | %10.10s |\n"; - printf($mask, str_repeat("-", 10), str_repeat("-", 50), str_repeat("-", 10)); - printf($mask, 'id', 'IP address', 'port'); - printf($mask, str_repeat("-", 10), str_repeat("-", 50), str_repeat("-", 10)); - foreach ($ips as $ipdata) { - printf($mask, $ipdata['id'], $ipdata['ip'], $ipdata['port']); - } - printf($mask, str_repeat("-", 10), str_repeat("-", 50), str_repeat("-", 10)); - echo PHP_EOL . PHP_EOL; - } - - private function switchIPs() - { - $ip_list = $this->_args['switch']; - - if (empty($ip_list) || is_bool($ip_list)) { - throw new \Exception("No parameters given for --switch action."); - } - - $ips_to_switch = array(); - $ip_list = explode(" ", $ip_list); - foreach ($ip_list as $ips_combo) { - $ip_pair = explode(",", $ips_combo); - if (count($ip_pair) != 2) { - throw new \Exception("Invalid parameter given for --switch"); - } else { - if (filter_var($ip_pair[0], FILTER_VALIDATE_IP) == false) { - throw new \Exception("Invalid source ip address: " . $ip_pair[0]); - } - if (filter_var($ip_pair[1], FILTER_VALIDATE_IP) == false) { - throw new \Exception("Invalid target ip address: " . $ip_pair[1]); - } - if ($ip_pair[0] == $ip_pair[1]) { - throw new \Exception("Source and target ip address are equal"); - } - } - $ips_to_switch[] = $ip_pair; - } - - if (count($ips_to_switch) > 0) { - $check_stmt = Database::prepare("SELECT `id` FROM panel_ipsandports WHERE `ip` = :newip"); - $upd_stmt = Database::prepare("UPDATE panel_ipsandports SET `ip` = :newip WHERE `ip` = :oldip"); - - // system.ipaddress - $check_sysip_stmt = Database::prepare("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'system' and `varname` = 'ipaddress'"); - $check_sysip = Database::pexecute_first($check_sysip_stmt); - - // system.mysql_access_host - $check_mysqlip_stmt = Database::prepare("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'system' and `varname` = 'mysql_access_host'"); - $check_mysqlip = Database::pexecute_first($check_mysqlip_stmt); - - // system.axfrservers - $check_axfrip_stmt = Database::prepare("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'system' and `varname` = 'axfrservers'"); - $check_axfrip = Database::pexecute_first($check_axfrip_stmt); - - foreach ($ips_to_switch as $ip_pair) { - echo "Switching IP \033[1m" . $ip_pair[0] . "\033[0m to IP \033[1m" . $ip_pair[1] . "\033[0m" . PHP_EOL; - - $ip_check = Database::pexecute_first($check_stmt, array( - 'newip' => $ip_pair[1] - )); - if ($ip_check) { - SwitchServerIpCmd::printwarn("Note: " . $ip_pair[0] . " not updated to " . $ip_pair[1] . " - IP already exists in froxlor's database"); - continue; - } - - Database::pexecute($upd_stmt, array( - 'newip' => $ip_pair[1], - 'oldip' => $ip_pair[0] - )); - $rows_updated = $upd_stmt->rowCount(); - - if ($rows_updated == 0) { - SwitchServerIpCmd::printwarn("Note: " . $ip_pair[0] . " not updated to " . $ip_pair[1] . " (possibly no entry found in froxlor database. Use --list to see what IP addresses are added in froxlor"); - } - - // check whether the system.ipaddress needs updating - if ($check_sysip['value'] == $ip_pair[0]) { - $upd2_stmt = Database::prepare("UPDATE `panel_settings` SET `value` = :newip WHERE `settinggroup` = 'system' and `varname` = 'ipaddress'"); - Database::pexecute($upd2_stmt, array( - 'newip' => $ip_pair[1] - )); - SwitchServerIpCmd::printsucc("Updated system-ipaddress from '" . $ip_pair[0] . "' to '" . $ip_pair[1] . "'"); - } - - // check whether the system.mysql_access_host needs updating - if (strstr($check_mysqlip['value'], $ip_pair[0]) !== false) { - $new_mysqlip = str_replace($ip_pair[0], $ip_pair[1], $check_mysqlip['value']); - $upd2_stmt = Database::prepare("UPDATE `panel_settings` SET `value` = :newmysql WHERE `settinggroup` = 'system' and `varname` = 'mysql_access_host'"); - Database::pexecute($upd2_stmt, array( - 'newmysql' => $new_mysqlip - )); - SwitchServerIpCmd::printsucc("Updated mysql_access_host from '" . $check_mysqlip['value'] . "' to '" . $new_mysqlip . "'"); - } - - // check whether the system.axfrservers needs updating - if (strstr($check_axfrip['value'], $ip_pair[0]) !== false) { - $new_axfrip = str_replace($ip_pair[0], $ip_pair[1], $check_axfrip['value']); - $upd2_stmt = Database::prepare("UPDATE `panel_settings` SET `value` = :newaxfr WHERE `settinggroup` = 'system' and `varname` = 'axfrservers'"); - Database::pexecute($upd2_stmt, array( - 'newaxfr' => $new_axfrip - )); - SwitchServerIpCmd::printsucc("Updated axfrservers from '" . $check_axfrip['value'] . "' to '" . $new_axfrip . "'"); - } - } - } - - echo PHP_EOL; - SwitchServerIpCmd::printwarn("*** ATTENTION *** Remember to replace IP addresses in configuration files if used anywhere."); - SwitchServerIpCmd::printsucc("IP addresses updated"); - } - - private function parseConfig() - { - define('FROXLOR_INSTALL_DIR', $this->_args['froxlor-dir']); - if (! class_exists('\\Froxlor\\Database\\Database')) { - throw new \Exception("Could not find froxlor's Database class. Is froxlor really installed to '" . FROXLOR_INSTALL_DIR . "'?"); - } - if (! file_exists(FROXLOR_INSTALL_DIR . '/lib/userdata.inc.php')) { - throw new \Exception("Could not find froxlor's userdata.inc.php file. You should use this script only with a fully installed and setup froxlor system."); - } - } - - private function checkConfigParam($needed = false) - { - if ($needed) { - if (! isset($this->_args["froxlor-dir"])) { - $this->_args["froxlor-dir"] = \Froxlor\Froxlor::getInstallDir(); - } elseif (! is_dir($this->_args["froxlor-dir"])) { - throw new \Exception("Given --froxlor-dir parameter is not a directory"); - } elseif (! file_exists($this->_args["froxlor-dir"])) { - throw new \Exception("Given froxlor directory cannot be found ('" . $this->_args["froxlor-dir"] . "')"); - } elseif (! is_readable($this->_args["froxlor-dir"])) { - throw new \Exception("Given froxlor directory cannot be read ('" . $this->_args["froxlor-dir"] . "')"); - } - } - } -} diff --git a/lib/Froxlor/Cli/Action/index.html b/lib/Froxlor/Cli/Action/index.html deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/Froxlor/Cli/CmdLineHandler.php b/lib/Froxlor/Cli/CmdLineHandler.php deleted file mode 100644 index 1cb3fe46..00000000 --- a/lib/Froxlor/Cli/CmdLineHandler.php +++ /dev/null @@ -1,216 +0,0 @@ - (2018-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Cron - * - */ -abstract class CmdLineHandler -{ - - /** - * internal variable for passed arguments - * - * @var array - */ - private static $args = null; - - /** - * Action object read from commandline/config - * - * @var \Froxlor\Cli\Action - */ - private $action = null; - - /** - * Returns a CmdLineHandler object with given - * arguments from command line - * - * @param int $argc - * @param array $argv - * - * @return CmdLineHandler - */ - public static function processParameters($argc, $argv) - { - $me = get_called_class(); - return new $me($argc, $argv); - } - - /** - * class constructor, validates the command line parameters - * and sets the Action-object if valid - * - * @param int $argc - * @param string[] $argv - * - * @return null - * @throws \Exception - */ - private function __construct($argc, $argv) - { - self::$args = $this->parseArgs($argv); - $this->action = $this->createAction(); - $this->action->run(); - } - - /** - * Parses the arguments given via the command line; - * three types are supported: - * 1. - * --parm1 or --parm2=value - * 2. -xyz (multiple switches in one) or -a=value - * 3. parm1 parm2 - * - * The 1. will be mapped as - * ["parm1"] => true, ["parm2"] => "value" - * The 2. as - * ["x"] => true, ["y"] => true, ["z"] => true, ["a"] => "value" - * And the 3. as - * [0] => "parm1", [1] => "parm2" - * - * @param array $argv - * - * @return array - */ - private function parseArgs($argv) - { - array_shift($argv); - $o = array(); - foreach ($argv as $a) { - if (substr($a, 0, 2) == '--') { - $eq = strpos($a, '='); - if ($eq !== false) { - $o[substr($a, 2, $eq - 2)] = substr($a, $eq + 1); - } else { - $k = substr($a, 2); - if (! isset($o[$k])) { - $o[$k] = true; - } - } - } elseif (substr($a, 0, 1) == '-') { - if (substr($a, 2, 1) == '=') { - $o[substr($a, 1, 1)] = substr($a, 3); - } else { - foreach (str_split(substr($a, 1)) as $k) { - if (! isset($o[$k])) { - $o[$k] = true; - } - } - } - } else { - $o[] = $a; - } - } - return $o; - } - - /** - * Creates an Action-Object for the Action-Handler - * - * @return \Froxlor\Cli\Action - * @throws \Exception - */ - private function createAction() - { - - // Test for help-switch - if (empty(self::$args) || array_key_exists("help", self::$args) || array_key_exists("h", self::$args)) { - static::printHelp(); - // end of execution - } - // check if no unknown parameters are present - foreach (self::$args as $arg => $value) { - - if (is_numeric($arg)) { - throw new \Exception("Unknown parameter '" . $value . "' in argument list"); - } elseif (! in_array($arg, static::$params) && ! in_array($arg, static::$switches)) { - throw new \Exception("Unknown parameter '" . $arg . "' in argument list"); - } - } - - // set debugger switch - if (isset(self::$args["d"]) && self::$args["d"] == true) { - // Debugger::getInstance()->setEnabled(true); - // Debugger::getInstance()->debug("debug output enabled"); - } - - return new static::$action_class(self::$args); - } - - public static function getInput($prompt = "#", $default = "") - { - if (! empty($default)) { - $prompt .= " [" . $default . "]"; - } - $result = readline($prompt . ":"); - if (empty($result) && ! empty($default)) { - $result = $default; - } - return mb_strtolower($result); - } - - public static function getYesNo($prompt = "#", $default = null) - { - $value = null; - $_v = null; - - while (true) { - $_v = self::getInput($prompt); - - if (strtolower($_v) == 'y' || strtolower($_v) == 'yes') { - $value = 1; - break; - } elseif (strtolower($_v) == 'n' || strtolower($_v) == 'no') { - $value = 0; - break; - } else { - if ($_v == '' && $default != null) { - $value = $default; - break; - } else { - echo "Sorry, response " . $_v . " not understood. Please enter 'yes' or 'no'\n"; - $value = null; - continue; - } - } - } - - return $value; - } - - public static function println($msg = "") - { - print $msg . PHP_EOL; - } - - private static function printcolor($msg = "", $color = "0") - { - print "\033[" . $color . "m" . $msg . "\033[0m" . PHP_EOL; - } - - public static function printerr($msg = "") - { - self::printcolor($msg, "31"); - } - - public static function printsucc($msg = "") - { - self::printcolor($msg, "32"); - } - - public static function printwarn($msg = "") - { - self::printcolor($msg, "33"); - } -} diff --git a/lib/Froxlor/Cli/ConfigServices.php b/lib/Froxlor/Cli/ConfigServices.php new file mode 100644 index 00000000..16977eb9 --- /dev/null +++ b/lib/Froxlor/Cli/ConfigServices.php @@ -0,0 +1,475 @@ + (2018-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Cron + * + */ +final class ConfigServices extends Command +{ + + protected function configure() + { + $this->setName('froxlor:config-services'); + $this->setDescription('Configure system services'); + $this->addOption('create', 'c', InputOption::VALUE_NONE, 'Create a services list configuration for the --apply option.') + ->addOption('apply', 'a', InputOption::VALUE_REQUIRED, 'Configure your services by given configuration file. To create one run the command with the --create option.') + ->addOption('list', 'l', InputOption::VALUE_NONE, 'Output the services that are going to be configured using a given config file (--apply option). No services will be configured.') + ->addOption('daemon', 'd', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'When used with --apply you can specify one or multiple daemons. These will be the only services that get configured.') + ->addOption('import-settings', 'i', InputOption::VALUE_REQUIRED, 'Import settings from another froxlor installation. This can be done standalone or in addition to --apply.'); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + global $lng; + + if (!file_exists(Froxlor::getInstallDir() . '/lib/userdata.inc.php')) { + $output->writeln("Could not find froxlor's userdata.inc.php file. You should use this script only with an installed froxlor system."); + return self::INVALID; + } + + include_once Froxlor::getInstallDir() . 'lng/english.lng.php'; + include_once Froxlor::getInstallDir() . 'lng/lng_references.php'; + + $result = self::SUCCESS; + + // import settings if given + if ($input->getOption('import-settings')) { + $result = $this->importSettings($input, $output); + } + + if ($result == self::SUCCESS) { + $io = new SymfonyStyle($input, $output); + if ($input->getOption('create')) { + $result = $this->createConfig($input, $output, $io); + } elseif ($input->getOption('apply')) { + $result = $this->applyConfig($input, $output, $io); + } elseif ($input->getOption('list') || $input->getOption('daemon')) { + $output->writeln('Options --list and --daemon only work together with --apply.'); + $result = self::INVALID; + } + } + + return $result; + } + + private function createConfig(InputInterface $input, OutputInterface $output, SymfonyStyle $io) + { + $_daemons_config = array( + 'distro' => "" + ); + + $config_dir = Froxlor::getInstallDir() . '/lib/configfiles/'; + // show list of available distro's + $distros = glob($config_dir . '*.xml'); + // tmp array + $distributions_select_data = array(); + + //set default os. + $os_dist = array('ID' => 'bullseye'); + $os_version = array('0' => '11'); + $os_default = $os_dist['ID']; + + //read os-release + if (file_exists('/etc/os-release')) { + $os_dist = parse_ini_file('/etc/os-release', false); + if (is_array($os_dist) && array_key_exists('ID', $os_dist) && array_key_exists('VERSION_ID', $os_dist)) { + $os_version = explode('.', $os_dist['VERSION_ID'])[0]; + } + } + + // read in all the distros + foreach ($distros as $_distribution) { + // get configparser object + $dist = new \Froxlor\Config\ConfigParser($_distribution); + // get distro-info + $dist_display = $this->getCompleteDistroName($dist); + // store in tmp array + $distributions_select_data[$dist_display] = str_replace(".xml", "", strtolower(basename($_distribution))); + + //guess if this is the current distro. + $ver = explode('.', $dist->distributionVersion)[0]; + if (strtolower($os_dist['ID']) == strtolower($dist->distributionName) && $os_version == $ver) { + $os_default = str_replace(".xml", "", strtolower(basename($_distribution))); + } + } + + // sort by distribution name + ksort($distributions_select_data); + + // list all distributions + $table_rows = []; + $valid_dists = []; + foreach ($distributions_select_data as $name => $filename) { + $table_rows[] = [$filename, $name]; + $valid_dists[] = $filename; + } + $io->table( + ['ID', 'Distribution'], + $table_rows + ); + + $_daemons_config['distro'] = $io->choice('Choose distribution', $valid_dists, $os_default); + + // go through all services and let user check whether to include it or not + $configfiles = new ConfigParser($config_dir . '/' . $_daemons_config['distro'] . ".xml"); + $services = $configfiles->getServices(); + + foreach ($services as $si => $service) { + $output->writeln("--- " . strtoupper($si) . " ---"); + $_daemons_config[$si] = ""; + + $daemons = $service->getDaemons(); + $default_daemon = ""; + $table_rows = []; + $valid_options = []; + foreach ($daemons as $di => $dd) { + $title = $dd->title; + if ($dd->default) { + $default_daemon = $di; + $title = $title . " (default)"; + } + $table_rows[] = [$di, $title]; + $valid_options[] = $di; + } + if ($si != 'system') { + $table_rows[] = ['x', 'No']; + $valid_options[] = 'x'; + } + $io->table( + ['Value', 'Name'], + $table_rows + ); + + $daemons['x'] = 'x'; + if ($si == 'system') { + $_daemons_config[$si] = array(); + // for the system/other services we need a multiple choice possibility + $output->writeln("Select every service you need. Enter empty value when done"); + $sysservice = ""; + do { + $sysservice = $io->ask('Choose service'); + if (!empty($sysservice)) { + $_daemons_config[$si][] = $sysservice; + } + } while (!empty($sysservice)); + // add 'cron' as fixed part (doesn't hurt if it exists) + if (!in_array('cron', $_daemons_config[$si])) { + $_daemons_config[$si][] = 'cron'; + } + } else { + // for all others -> only one value + $_daemons_config[$si] = $io->choice('Choose service', $valid_options, $default_daemon); + } + } + + $daemons_config = json_encode($_daemons_config); + $output_file = $io->ask("Choose output-filename", "/tmp/froxlor-config-" . date('Ymd') . ".json"); + file_put_contents($output_file, $daemons_config); + $output->writeln("Successfully generated service-configfile '" . $output_file . "'"); + $output->writeln([ + "", + "You can now apply this config running:", + "php " . Froxlor::getInstallDir() . "bin/froxlor-cli froxlor:config-services --apply=" . $output_file, + "" + ]); + $proceed = $io->confirm("Do you want to apply the config now?", false); + if ($proceed) { + passthru("php " . Froxlor::getInstallDir() . "bin/froxlor-cli froxlor:config-services --apply=" . $output_file); + } + return self::SUCCESS; + } + + private function applyConfig(InputInterface $input, OutputInterface $output, SymfonyStyle $io) + { + $applyFile = $input->getOption('apply'); + + if (strtoupper(substr($applyFile, 0, 4)) == 'HTTP') { + $output->writeln("Config file seems to be an URL, trying to download"); + $target = "/tmp/froxlor-config-" . time() . ".json"; + if (@file_exists($target)) { + @unlink($target); + } + $this->downloadFile($applyFile, $target); + $applyFile = $target; + } + if (!is_file($applyFile)) { + $output->writeln('Given config file is not a file'); + return self::INVALID; + } elseif (!file_exists($applyFile)) { + $output->writeln('Given config file cannot be found (' . $applyFile . ')'); + return self::INVALID; + } elseif (!is_readable($applyFile)) { + $output->writeln('Given config file cannot be read (' . $applyFile . ')'); + return self::INVALID; + } + + $config = file_get_contents($applyFile); + $decoded_config = json_decode($config, true); + + if ($input->getOption('list') != false) { + $table_rows = []; + foreach ($decoded_config as $service => $daemon) { + if (is_array($daemon) && count($daemon) > 0) { + foreach ($daemon as $sysdaemon) { + $table_rows[] = [$service, $sysdaemon]; + } + } else { + if ($daemon == 'x') { + $daemon = '--- skipped ---'; + } + $table_rows[] = [$service, $daemon]; + } + } + + $io->table( + ['Service', 'Selected daemon'], + $table_rows + ); + return self::SUCCESS; + } + + $only_daemon = []; + if ($input->getOption('daemon') != false) { + $only_daemon = $input->getOption('daemon'); + } + + if (!empty($decoded_config)) { + $config_dir = Froxlor::getInstallDir() . 'lib/configfiles/'; + $configfiles = new ConfigParser($config_dir . '/' . $decoded_config['distro'] . ".xml"); + $services = $configfiles->getServices(); + $replace_arr = $this->getReplacerArray(); + + foreach ($services as $si => $service) { + $output->writeln("--- Configuring: " . strtoupper($si) . " ---"); + if (!isset($decoded_config[$si]) || $decoded_config[$si] == 'x') { + $output->writeln('Skipping ' . strtoupper($si) . ' configuration as desired'); + continue; + } + $daemons = $service->getDaemons(); + foreach ($daemons as $di => $dd) { + // check for desired service + if (($si != 'system' && $decoded_config[$si] != $di) || (is_array($decoded_config[$si]) && !in_array($di, $decoded_config[$si]))) { + continue; + } + $output->writeln("Configuring '" . $di . "'"); + + if (!empty($only_daemon) && !in_array($di, $only_daemon)) { + $output->writeln('Skipping ' . $di . ' configuration as desired'); + continue; + } + // run all cmds + $confarr = $dd->getConfig(); + foreach ($confarr as $action) { + switch ($action['type']) { + case "install": + $output->writeln("Installing required packages"); + $result = null; + passthru(strtr($action['content'], $replace_arr), $result); + if (strlen($result) > 1) { + echo $result; + } + break; + case "command": + exec(strtr($action['content'], $replace_arr)); + break; + case "file": + if (array_key_exists('content', $action)) { + $output->writeln('Creating file "' . $action['name'] . '"'); + file_put_contents($action['name'], trim(strtr($action['content'], $replace_arr))); + } elseif (array_key_exists('subcommands', $action)) { + foreach ($action['subcommands'] as $fileaction) { + if (array_key_exists('execute', $fileaction) && $fileaction['execute'] == "pre") { + exec(strtr($fileaction['content'], $replace_arr)); + } elseif (array_key_exists('execute', $fileaction) && $fileaction['execute'] == "post") { + exec(strtr($fileaction['content'], $replace_arr)); + } elseif ($fileaction['type'] == 'file') { + $output->writeln('Creating file "' . $fileaction['name'] . '"'); + file_put_contents($fileaction['name'], trim(strtr($fileaction['content'], $replace_arr))); + } + } + } + break; + } + } + } + } + // set is_configured flag + Settings::Set('panel.is_configured', '1', true); + // run cronjob at the end to ensure configs are all up to date + exec('php ' . Froxlor::getInstallDir() . 'scripts/froxlor_master_cronjob.php --force'); + // and done + $output->writeln('All services have been configured'); + return self::SUCCESS; + } else { + $output->writeln('Unable to decode given JSON file'); + return self::INVALID; + } + } + + private function getReplacerArray() + { + $customer_tmpdir = '/tmp/'; + if (Settings::Get('system.mod_fcgid') == '1' && Settings::Get('system.mod_fcgid_tmpdir') != '') { + $customer_tmpdir = Settings::Get('system.mod_fcgid_tmpdir'); + } elseif (Settings::Get('phpfpm.enabled') == '1' && Settings::Get('phpfpm.tmpdir') != '') { + $customer_tmpdir = Settings::Get('phpfpm.tmpdir'); + } + + // try to convert namserver hosts to ip's + $ns_ips = ""; + $known_ns_ips = []; + if (Settings::Get('system.nameservers') != '') { + $nameservers = explode(',', Settings::Get('system.nameservers')); + foreach ($nameservers as $nameserver) { + $nameserver = trim($nameserver); + // DNS servers might be multi homed; allow transfer from all ip + // addresses of the DNS server + $nameserver_ips = \Froxlor\PhpHelper::gethostbynamel6($nameserver); + // append dot to hostname + if (substr($nameserver, -1, 1) != '.') { + $nameserver .= '.'; + } + // ignore invalid responses + if (!is_array($nameserver_ips)) { + // act like \Froxlor\PhpHelper::gethostbynamel6() and return unmodified hostname on error + $nameserver_ips = array( + $nameserver + ); + } else { + $known_ns_ips = array_merge($known_ns_ips, $nameserver_ips); + } + if (!empty($ns_ips)) { + $ns_ips .= ','; + } + $ns_ips .= implode(",", $nameserver_ips); + } + } + + // AXFR server + if (Settings::Get('system.axfrservers') != '') { + $axfrservers = explode(',', Settings::Get('system.axfrservers')); + foreach ($axfrservers as $axfrserver) { + if (!in_array(trim($axfrserver), $known_ns_ips)) { + if (!empty($ns_ips)) { + $ns_ips .= ','; + } + $ns_ips .= trim($axfrserver); + } + } + } + + Database::needSqlData(); + $sql = Database::getSqlData(); + + $replace_arr = array( + '' => $sql['user'], + '' => $sql['passwd'], + '' => $sql['db'], + '' => $sql['host'], + '' => isset($sql['socket']) ? $sql['socket'] : null, + '' => Settings::Get('system.hostname'), + '' => Settings::Get('system.ipaddress'), + '' => Settings::Get('system.nameservers'), + '' => $ns_ips, + '' => Settings::Get('system.vmail_homedir'), + '' => Settings::Get('system.vmail_uid'), + '' => Settings::Get('system.vmail_gid'), + '' => (Settings::Get('system.use_ssl') == '1') ? 'imaps pop3s' : '', + '' => FileDir::makeCorrectDir($customer_tmpdir), + '' => Froxlor::getInstallDir(), + '' => FileDir::makeCorrectDir(Settings::Get('system.bindconf_directory')), + '' => Settings::Get('system.apachereload_command'), + '' => FileDir::makeCorrectDir(Settings::Get('system.logfiles_directory')), + '' => FileDir::makeCorrectDir(Settings::Get('phpfpm.fastcgi_ipcdir')), + '' => Settings::Get('system.httpgroup') + ); + return $replace_arr; + } + + private function getCompleteDistroName($cparser) + { + // get distro-info + $dist_display = $cparser->distributionName; + if ($cparser->distributionCodename != '') { + $dist_display .= " " . $cparser->distributionCodename; + } + if ($cparser->distributionVersion != '') { + $dist_display .= " (" . $cparser->distributionVersion . ")"; + } + if ($cparser->deprecated) { + $dist_display .= " [deprecated]"; + } + return $dist_display; + } + + private function importSettings(InputInterface $input, OutputInterface $output) + { + $importFile = $input->getOption('import-settings'); + + if (strtoupper(substr($importFile, 0, 4)) == 'HTTP') { + $output->writeln("Settings file seems to be an URL, trying to download"); + $target = "/tmp/froxlor-import-settings-" . time() . ".json"; + if (@file_exists($target)) { + @unlink($target); + } + $this->downloadFile($importFile, $target); + $importFile = $target; + } + if (!is_file($importFile)) { + $output->writeln('Given settings file is not a file'); + return self::INVALID; + } elseif (!file_exists($importFile)) { + $output->writeln('Given settings file cannot be found (' . $importFile . ')'); + return self::INVALID; + } elseif (!is_readable($importFile)) { + $output->writeln('Given settings file cannot be read (' . $importFile . ')'); + return self::INVALID; + } + $imp_content = file_get_contents($importFile); + SImExporter::import($imp_content); + $output->writeln("Successfully imported settings from '" . $input->getOption('import-settings') . "'"); + return self::SUCCESS; + } + + private function downloadFile($src, $dest) + { + set_time_limit(0); + // This is the file where we save the information + $fp = fopen($dest, 'w+'); + // Here is the file we are downloading, replace spaces with %20 + $ch = curl_init(str_replace(" ", "%20", $src)); + curl_setopt($ch, CURLOPT_TIMEOUT, 50); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + // write curl response to file + curl_setopt($ch, CURLOPT_FILE, $fp); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); + // get curl response + curl_exec($ch); + curl_close($ch); + fclose($fp); + } +} diff --git a/lib/Froxlor/Cli/ConfigServicesCmd.php b/lib/Froxlor/Cli/ConfigServicesCmd.php deleted file mode 100644 index aec0e7f9..00000000 --- a/lib/Froxlor/Cli/ConfigServicesCmd.php +++ /dev/null @@ -1,79 +0,0 @@ - (2018-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Cron - * - */ -class ConfigServicesCmd extends CmdLineHandler -{ - - /** - * list of valid switches - * - * @var array - */ - public static $switches = array( - 'h' - ); - - /** - * list of valid parameters - * - * @var array - */ - public static $params = array( - 'create', - 'apply', - 'import-settings', - 'daemon', - 'list-daemons', - 'froxlor-dir', - 'help' - ); - - public static $action_class = '\\Froxlor\\Cli\\Action\\ConfigServicesAction'; - - public static function printHelp() - { - self::println(""); - self::println("Help / command line parameters:"); - self::println(""); - // commands - self::println("--create\t\tlets you create a services list configuration for the 'apply' command"); - self::println(""); - self::println("--apply\t\t\tconfigure your services by given configuration file. To create one run the --create command"); - self::println("\t\t\tExample: --apply=/path/to/my-config.json or --apply=http://domain.tld/my-config.json"); - self::println(""); - self::println("--list-daemons\t\tOutput the services that are going to be configured using a given config file. No services will be configured."); - self::println("\t\t\tExample: --apply=/path/to/my-config.json --list-daemons"); - self::println(""); - self::println("--daemon\t\tWhen running --apply you can specify a daemon. This will be the only service that gets configured"); - self::println("\t\t\tExample: --apply=/path/to/my-config.json --daemon=apache24"); - self::println(""); - self::println("--import-settings\tImport settings from another froxlor installation. This should be done prior to running --apply or alternatively in the same command together."); - self::println("\t\t\tExample: --import-settings=/path/to/Froxlor_settings-[version]-[dbversion]-[date].json or --import-settings=http://domain.tld/Froxlor_settings-[version]-[dbversion]-[date].json"); - self::println(""); - self::println("--froxlor-dir\t\tpath to froxlor installation"); - self::println("\t\t\tExample: --froxlor-dir=/var/www/froxlor/"); - self::println(""); - self::println("--help\t\t\tshow help screen (this)"); - self::println(""); - // switches - // self::println("-d\t\t\tenable debug output"); - self::println("-h\t\t\tsame as --help"); - self::println(""); - - die(); // end of execution - } -} diff --git a/lib/Froxlor/Cli/PhpSessionclean.php b/lib/Froxlor/Cli/PhpSessionclean.php new file mode 100644 index 00000000..4af9a1dd --- /dev/null +++ b/lib/Froxlor/Cli/PhpSessionclean.php @@ -0,0 +1,88 @@ + (2018-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Cron + * + */ +final class PhpSessionclean extends Command +{ + + protected function configure() + { + $this->setName('froxlor:php-sessionclean'); + $this->setDescription('Cleans old php-session files from tmp folder'); + $this->addArgument('max-lifetime', InputArgument::OPTIONAL, 'The number of seconds after which data will be seen as "garbage" and potentially cleaned up. Defaults to "1440"'); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + if (!file_exists(Froxlor::getInstallDir() . '/lib/userdata.inc.php')) { + $output->writeln("Could not find froxlor's userdata.inc.php file. You should use this script only with an installed froxlor system."); + return self::INVALID; + } + + if ((int) Settings::Get('phpfpm.enabled') == 1) { + if ($input->hasArgument('max-lifetime') && is_numeric($input->getArgument('max-lifetime')) && $input->getArgument('max-lifetime') > 0) { + $this->cleanSessionfiles((int)$input->getArgument('max-lifetime')); + } else { + // use default max-lifetime value + $this->cleanSessionfiles(); + } + return self::SUCCESS; + } + // php-fpm not enabled + $output->writeln('PHP-FPM not enabled for this installation.'); + return self::INVALID; + } + + private function cleanSessionfiles(int $maxlifetime = 1440) + { + // store paths to clean up + $paths_to_clean = []; + // get all pool-config directories configured + $sel_stmt = Database::prepare("SELECT DISTINCT `config_dir` FROM `" . TABLE_PANEL_FPMDAEMONS . "`"); + Database::pexecute($sel_stmt); + while ($fpmd = $sel_stmt->fetch(\PDO::FETCH_ASSOC)) { + $poolfiles = glob(FileDir::makeCorrectFile($fpmd['config_dir'] . '/*.conf')); + foreach ($poolfiles as $cf) { + $contents = file_get_contents($cf); + $pattern = preg_quote('session.save_path', '/'); + $pattern = "/" . $pattern . ".+?\=(.*)/"; + if (preg_match_all($pattern, $contents, $matches)) { + $paths_to_clean[] = FileDir::makeCorrectDir(trim($matches[1][0])); + } + } + } + + // every path is just needed once + $paths_to_clean = array_unique($paths_to_clean); + + if (count($paths_to_clean) > 0) { + foreach ($paths_to_clean as $ptc) { + // find all files older then maxlifetime and delete them + FileDir::safe_exec("find -O3 \"" . $ptc . "\" -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin \"+" . $maxlifetime . "\" -delete"); + } + } + } +} diff --git a/lib/Froxlor/Cli/PhpSessioncleanCmd.php b/lib/Froxlor/Cli/PhpSessioncleanCmd.php deleted file mode 100644 index 4d83e7c3..00000000 --- a/lib/Froxlor/Cli/PhpSessioncleanCmd.php +++ /dev/null @@ -1,64 +0,0 @@ - (2018-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Cron - * - */ -class PhpSessioncleanCmd extends CmdLineHandler -{ - - /** - * list of valid switches - * - * @var array - */ - public static $switches = array( - 'h' - ); - - /** - * list of valid parameters - * - * @var array - */ - public static $params = array( - 'froxlor-dir', - 'max-lifetime', - 'help' - ); - - public static $action_class = '\\Froxlor\\Cli\\Action\\PhpSessioncleanAction'; - - public static function printHelp() - { - self::println(""); - self::println("Help / command line parameters:"); - self::println(""); - // commands - self::println("--froxlor-dir\t\tpath to froxlor installation"); - self::println("\t\t\tExample: --froxlor-dir=/var/www/froxlor/"); - self::println(""); - self::println("--max-lifetime\t\tThe number of seconds after which data will be seen as 'garbage' and potentially cleaned up. Defaults to '1440'"); - self::println("\t\t\tExample: --max-lifetime=2000"); - self::println(""); - self::println("--help\t\t\tshow help screen (this)"); - self::println(""); - // switches - self::println("-h\t\t\tsame as --help"); - self::println(""); - - die(); // end of execution - } -} diff --git a/lib/Froxlor/Cli/SwitchServerIp.php b/lib/Froxlor/Cli/SwitchServerIp.php new file mode 100644 index 00000000..9956f39b --- /dev/null +++ b/lib/Froxlor/Cli/SwitchServerIp.php @@ -0,0 +1,181 @@ + (2018-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Cron + * + */ +final class SwitchServerIp extends Command +{ + + protected function configure() + { + $this->setName('froxlor:switch-server-ip'); + $this->setDescription('Easily switch IP addresses e.g. after server migration'); + $this->addOption('switch', 's', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Switch IP-address pair. A pair is separated by comma. For example: --switch=A,B') + ->addOption('list', 'l', InputOption::VALUE_NONE, 'List all IP addresses currently added for this server in froxlor'); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + if (!file_exists(Froxlor::getInstallDir() . '/lib/userdata.inc.php')) { + $output->writeln("Could not find froxlor's userdata.inc.php file. You should use this script only with an installed froxlor system."); + return self::INVALID; + } + + if ($input->getOption('list') == false && $input->getOption('switch') == false) { + $output->writeln('Either --list or --switch option must be provided. Nothing to do, exiting.'); + return self::INVALID; + } + + $io = new SymfonyStyle($input, $output); + + $result = self::SUCCESS; + + if ($input->getOption('list')) { + + $sel_stmt = Database::prepare("SELECT * FROM panel_ipsandports ORDER BY ip ASC, port ASC"); + Database::pexecute($sel_stmt); + $ips = $sel_stmt->fetchAll(\PDO::FETCH_ASSOC); + $table_rows = []; + foreach ($ips as $ipdata) { + $table_rows[] = [$ipdata['id'], $ipdata['ip'], $ipdata['port']]; + } + + $io->table( + ['#', 'IP address', 'Port'], + $table_rows + ); + } + + if ($input->getOption('switch')) { + $result = $this->switchIPs($input, $output); + } + + return $result; + } + + private function switchIPs(InputInterface $input, OutputInterface $output): int + { + $ip_list = $input->getOption('switch'); + + $has_error = false; + foreach ($ip_list as $ips_combo) { + $ip_pair = explode(",", $ips_combo); + if (count($ip_pair) != 2) { + $output->writeln('Invalid option parameter, not a valid IP address pair.'); + $has_error = true; + } else { + if (filter_var($ip_pair[0], FILTER_VALIDATE_IP) == false) { + $output->writeln('Invalid source ip address: ' . $ip_pair[0] . ''); + $has_error = true; + } + if (filter_var($ip_pair[1], FILTER_VALIDATE_IP) == false) { + $output->writeln('Invalid target ip address: ' . $ip_pair[1] . ''); + $has_error = true; + } + if ($ip_pair[0] == $ip_pair[1] && !$has_error) { + $output->writeln('Source and target ip address are equal'); + $has_error = true; + } + } + $ips_to_switch[] = $ip_pair; + } + if ($has_error) { + return self::FAILURE; + } + + if (count($ips_to_switch) > 0) { + $check_stmt = Database::prepare("SELECT `id` FROM panel_ipsandports WHERE `ip` = :newip"); + $upd_stmt = Database::prepare("UPDATE panel_ipsandports SET `ip` = :newip WHERE `ip` = :oldip"); + + // system.ipaddress + $check_sysip_stmt = Database::prepare("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'system' and `varname` = 'ipaddress'"); + $check_sysip = Database::pexecute_first($check_sysip_stmt); + + // system.mysql_access_host + $check_mysqlip_stmt = Database::prepare("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'system' and `varname` = 'mysql_access_host'"); + $check_mysqlip = Database::pexecute_first($check_mysqlip_stmt); + + // system.axfrservers + $check_axfrip_stmt = Database::prepare("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'system' and `varname` = 'axfrservers'"); + $check_axfrip = Database::pexecute_first($check_axfrip_stmt); + + foreach ($ips_to_switch as $ip_pair) { + $output->writeln('Switching IP ' . $ip_pair[0] . ' to IP ' . $ip_pair[1] . ''); + + $ip_check = Database::pexecute_first($check_stmt, array( + 'newip' => $ip_pair[1] + )); + if ($ip_check) { + $output->writeln('Note: ' . $ip_pair[0] . ' not updated to ' . $ip_pair[1] . ' - IP already exists in froxlor\'s database'); + continue; + } + + Database::pexecute($upd_stmt, array( + 'newip' => $ip_pair[1], + 'oldip' => $ip_pair[0] + )); + $rows_updated = $upd_stmt->rowCount(); + + if ($rows_updated == 0) { + $output->writeln('Note: ' . $ip_pair[0] . ' not updated to ' . $ip_pair[1] . ' (possibly no entry found in froxlor database. Use --list to see what IP addresses are added in froxlor'); + continue; + } + + // check whether the system.ipaddress needs updating + if ($check_sysip['value'] == $ip_pair[0]) { + $upd2_stmt = Database::prepare("UPDATE `panel_settings` SET `value` = :newip WHERE `settinggroup` = 'system' and `varname` = 'ipaddress'"); + Database::pexecute($upd2_stmt, array( + 'newip' => $ip_pair[1] + )); + $output->writeln('Updated system-ipaddress from ' . $ip_pair[0] . ' to ' . $ip_pair[1] . ''); + } + + // check whether the system.mysql_access_host needs updating + if (strstr($check_mysqlip['value'], $ip_pair[0]) !== false) { + $new_mysqlip = str_replace($ip_pair[0], $ip_pair[1], $check_mysqlip['value']); + $upd2_stmt = Database::prepare("UPDATE `panel_settings` SET `value` = :newmysql WHERE `settinggroup` = 'system' and `varname` = 'mysql_access_host'"); + Database::pexecute($upd2_stmt, array( + 'newmysql' => $new_mysqlip + )); + $output->writeln('Updated mysql_access_host from ' . $check_mysqlip['value'] . ' to ' . $new_mysqlip . ''); + } + + // check whether the system.axfrservers needs updating + if (strstr($check_axfrip['value'], $ip_pair[0]) !== false) { + $new_axfrip = str_replace($ip_pair[0], $ip_pair[1], $check_axfrip['value']); + $upd2_stmt = Database::prepare("UPDATE `panel_settings` SET `value` = :newaxfr WHERE `settinggroup` = 'system' and `varname` = 'axfrservers'"); + Database::pexecute($upd2_stmt, array( + 'newaxfr' => $new_axfrip + )); + $output->writeln('Updated axfr-servers from ' . $check_axfrip['value'] . ' to ' . $new_axfrip . ''); + } + } + } + + $output->writeln(""); + $output->writeln("*** ATTENTION *** Remember to replace IP addresses in configuration files if used anywhere."); + $output->writeln("IP addresses updated"); + return self::SUCCESS; + } +} diff --git a/lib/Froxlor/Cli/SwitchServerIpCmd.php b/lib/Froxlor/Cli/SwitchServerIpCmd.php deleted file mode 100644 index 6839b765..00000000 --- a/lib/Froxlor/Cli/SwitchServerIpCmd.php +++ /dev/null @@ -1,68 +0,0 @@ - (2018-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Cron - * - */ -class SwitchServerIpCmd extends CmdLineHandler -{ - - /** - * list of valid switches - * - * @var array - */ - public static $switches = array( - 'h' - ); - - /** - * list of valid parameters - * - * @var array - */ - public static $params = array( - 'switch', - 'list', - 'froxlor-dir', - 'help' - ); - - public static $action_class = '\\Froxlor\\Cli\\Action\\SwitchServerIpAction'; - - public static function printHelp() - { - self::println(""); - self::println("Help / command line parameters:"); - self::println(""); - // commands - self::println("--switch\t\tlets you switch ip-address A with ip-address B"); - self::println("\t\t\tExample: --switch=A,B"); - self::println("\t\t\tExample: --switch=\"A1,B1 A2,B2 A3,B3 ...\""); - self::println(""); - self::println("--list\t\t\tshow all currently used ip-addresses in froxlor"); - self::println(""); - self::println("--froxlor-dir\t\tpath to froxlor installation"); - self::println("\t\t\tExample: --froxlor-dir=/var/www/froxlor/"); - self::println(""); - self::println("--help\t\t\tshow help screen (this)"); - self::println(""); - // switches - // self::println("-d\t\t\tenable debug output"); - self::println("-h\t\t\tsame as --help"); - self::println(""); - - die(); // end of execution - } -} diff --git a/lib/Froxlor/Cron/CronConfig.php b/lib/Froxlor/Cron/CronConfig.php index 5233c708..259c869e 100644 --- a/lib/Froxlor/Cron/CronConfig.php +++ b/lib/Froxlor/Cron/CronConfig.php @@ -111,7 +111,7 @@ class CronConfig // php sessionclean if enabled if ((int) Settings::Get('phpfpm.enabled') == 1) { $cronfile .= "# Look for and purge old sessions every 30 minutes" . PHP_EOL; - $cronfile .= "09,39 * * * * root " . $binpath . " " . \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . "/scripts/php-sessionclean.php") . " --froxlor-dir=" . escapeshellarg(\Froxlor\Froxlor::getInstallDir()) . " 1> /dev/null" . PHP_EOL; + $cronfile .= "09,39 * * * * root " . $binpath . " " . \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . "/bin/froxlor-cli") . " froxlor:php-sessionclean 1> /dev/null" . PHP_EOL; } if (\Froxlor\FileDir::isFreeBSD()) { diff --git a/scripts/php-sessionclean.php b/scripts/php-sessionclean.php deleted file mode 100755 index b63100b5..00000000 --- a/scripts/php-sessionclean.php +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/php - (2018-) - * @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(__DIR__) . '/vendor/autoload.php'; - -// give control to command line handler -try { - \Froxlor\Cli\PhpSessioncleanCmd::processParameters($argc, $argv); -} catch (Exception $e) { - \Froxlor\Cli\PhpSessioncleanCmd::printerr($e->getMessage()); - exit(1); -} diff --git a/templates/Froxlor/settings/configuration-final.html.twig b/templates/Froxlor/settings/configuration-final.html.twig index f8689f14..7be58716 100644 --- a/templates/Froxlor/settings/configuration-final.html.twig +++ b/templates/Froxlor/settings/configuration-final.html.twig @@ -6,7 +6,7 @@
-
{% endblock %} From f540ed4eb5f4b8857848f3f52d08e9f08038aed4 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 10 Apr 2022 10:15:29 +0200 Subject: [PATCH 7/8] require correct version of symfony/console to be php7.4 compatible Signed-off-by: Michael Kaufmann --- bin/froxlor-cli | 3 +- composer.json | 2 +- composer.lock | 293 +++++++++++++++++++++++++++++++----------------- 3 files changed, 191 insertions(+), 107 deletions(-) diff --git a/bin/froxlor-cli b/bin/froxlor-cli index df75b0b0..40e69e98 100755 --- a/bin/froxlor-cli +++ b/bin/froxlor-cli @@ -7,11 +7,12 @@ use Symfony\Component\Console\Application; use Froxlor\Cli\ConfigServices; use Froxlor\Cli\PhpSessionclean; use Froxlor\Cli\SwitchServerIp; +use Froxlor\Froxlor; require dirname(__DIR__) . '/vendor/autoload.php'; require dirname(__DIR__) . '/lib/tables.inc.php'; -$application = new Application; +$application = new Application('froxlor-cli', Froxlor::getFullVersion()); $application->add(new ConfigServices()); $application->add(new PhpSessionclean()); $application->add(new SwitchServerIp()); diff --git a/composer.json b/composer.json index aba7f797..c3c027f5 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,7 @@ "voku/anti-xss": "^4.1", "twig/twig": "^3.3", "erusev/parsedown": "^1.7", - "symfony/console": "^6.0" + "symfony/console": "^5.4" }, "require-dev": { "phpunit/phpunit": "^9", diff --git a/composer.lock b/composer.lock index 67408b97..da9589c1 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": "1744b69cc6cb1d92362c44860a6baeac", + "content-hash": "050664b27120307bec7721bac4ecb395", "packages": [ { "name": "erusev/parsedown", @@ -446,42 +446,46 @@ }, { "name": "symfony/console", - "version": "v6.0.7", + "version": "v5.4.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "70dcf7b2ca2ea08ad6ebcc475f104a024fb5632e" + "reference": "900275254f0a1a2afff1ab0e11abd5587a10e1d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/70dcf7b2ca2ea08ad6ebcc475f104a024fb5632e", - "reference": "70dcf7b2ca2ea08ad6ebcc475f104a024fb5632e", + "url": "https://api.github.com/repos/symfony/console/zipball/900275254f0a1a2afff1ab0e11abd5587a10e1d6", + "reference": "900275254f0a1a2afff1ab0e11abd5587a10e1d6", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" + "symfony/string": "^5.1|^6.0" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" }, "provide": { - "psr/log-implementation": "1.0|2.0|3.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" }, "suggest": { "psr/log": "For using the console logger", @@ -521,7 +525,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.0.7" + "source": "https://github.com/symfony/console/tree/v5.4.7" }, "funding": [ { @@ -537,7 +541,7 @@ "type": "tidelift" } ], - "time": "2022-03-31T17:18:25+00:00" + "time": "2022-03-31T17:09:19+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1095,6 +1099,168 @@ ], "time": "2021-05-27T09:17:38+00:00" }, + { + "name": "symfony/polyfill-php73", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-06-05T21:20:04+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-09-13T13:58:33+00:00" + }, { "name": "symfony/service-contracts", "version": "v2.5.0", @@ -4252,89 +4418,6 @@ ], "time": "2022-01-02T09:53:40+00:00" }, - { - "name": "symfony/polyfill-php80", - "version": "v1.24.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", - "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-09-13T13:58:33+00:00" - }, { "name": "symfony/polyfill-php81", "version": "v1.24.0", From 5081d6d916e47a890989085ad29adacf20671239 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 10 Apr 2022 10:29:43 +0200 Subject: [PATCH 8/8] fix php compatibility hopefully for real now Signed-off-by: Michael Kaufmann --- composer.lock | 425 +++++++++++++++++++++++++------------------------- 1 file changed, 214 insertions(+), 211 deletions(-) diff --git a/composer.lock b/composer.lock index da9589c1..cab706ae 100644 --- a/composer.lock +++ b/composer.lock @@ -114,16 +114,16 @@ }, { "name": "monolog/monolog", - "version": "1.26.1", + "version": "1.27.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "c6b00f05152ae2c9b04a448f99c7590beb6042f5" + "reference": "52ebd235c1f7e0d5e1b16464b695a28335f8e44a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/c6b00f05152ae2c9b04a448f99c7590beb6042f5", - "reference": "c6b00f05152ae2c9b04a448f99c7590beb6042f5", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/52ebd235c1f7e0d5e1b16464b695a28335f8e44a", + "reference": "52ebd235c1f7e0d5e1b16464b695a28335f8e44a", "shasum": "" }, "require": { @@ -184,7 +184,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/1.26.1" + "source": "https://github.com/Seldaek/monolog/tree/1.27.0" }, "funding": [ { @@ -196,20 +196,20 @@ "type": "tidelift" } ], - "time": "2021-05-28T08:32:12+00:00" + "time": "2022-03-13T20:29:46+00:00" }, { "name": "phpmailer/phpmailer", - "version": "v6.5.3", + "version": "v6.6.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "baeb7cde6b60b1286912690ab0693c7789a31e71" + "reference": "e43bac82edc26ca04b36143a48bde1c051cfd5b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/baeb7cde6b60b1286912690ab0693c7789a31e71", - "reference": "baeb7cde6b60b1286912690ab0693c7789a31e71", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e43bac82edc26ca04b36143a48bde1c051cfd5b1", + "reference": "e43bac82edc26ca04b36143a48bde1c051cfd5b1", "shasum": "" }, "require": { @@ -222,10 +222,10 @@ "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "doctrine/annotations": "^1.2", "php-parallel-lint/php-console-highlighter": "^0.5.0", - "php-parallel-lint/php-parallel-lint": "^1.3", + "php-parallel-lint/php-parallel-lint": "^1.3.1", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.6.0", + "squizlabs/php_codesniffer": "^3.6.2", "yoast/phpunit-polyfills": "^1.0.0" }, "suggest": { @@ -266,7 +266,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.3" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.0" }, "funding": [ { @@ -274,7 +274,7 @@ "type": "github" } ], - "time": "2021-11-25T16:34:11+00:00" + "time": "2022-02-28T15:31:21+00:00" }, { "name": "psr/container", @@ -376,16 +376,16 @@ }, { "name": "robthree/twofactorauth", - "version": "1.8.1", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/RobThree/TwoFactorAuth.git", - "reference": "5afcb45282f1c75562a48d479ecd1732c9bdb11b" + "reference": "65681de5a324eae05140ac58b08648a60212afc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/RobThree/TwoFactorAuth/zipball/5afcb45282f1c75562a48d479ecd1732c9bdb11b", - "reference": "5afcb45282f1c75562a48d479ecd1732c9bdb11b", + "url": "https://api.github.com/repos/RobThree/TwoFactorAuth/zipball/65681de5a324eae05140ac58b08648a60212afc0", + "reference": "65681de5a324eae05140ac58b08648a60212afc0", "shasum": "" }, "require": { @@ -442,7 +442,7 @@ "type": "github" } ], - "time": "2021-10-20T12:19:55+00:00" + "time": "2022-03-22T16:11:07+00:00" }, { "name": "symfony/console", @@ -545,16 +545,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.0", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", "shasum": "" }, "require": { @@ -592,7 +592,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" }, "funding": [ { @@ -608,11 +608,11 @@ "type": "tidelift" } ], - "time": "2021-07-12T14:48:14+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -644,12 +644,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -674,7 +674,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" }, "funding": [ { @@ -694,7 +694,7 @@ }, { "name": "symfony/polyfill-iconv", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", @@ -757,7 +757,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-iconv/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-iconv/tree/v1.25.0" }, "funding": [ { @@ -777,7 +777,7 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", @@ -838,7 +838,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" }, "funding": [ { @@ -858,7 +858,7 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -922,7 +922,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" }, "funding": [ { @@ -942,7 +942,7 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", @@ -1005,7 +1005,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" }, "funding": [ { @@ -1025,7 +1025,7 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", @@ -1081,7 +1081,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.25.0" }, "funding": [ { @@ -1180,16 +1180,16 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", - "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", "shasum": "" }, "require": { @@ -1243,7 +1243,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" }, "funding": [ { @@ -1259,26 +1259,26 @@ "type": "tidelift" } ], - "time": "2021-09-13T13:58:33+00:00" + "time": "2022-03-04T08:16:47+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.5.0", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" + "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/24d9dc654b83e91aa59f9d167b131bc3b5bea24c", + "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c", "shasum": "" }, "require": { "php": ">=7.2.5", "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1" + "symfony/deprecation-contracts": "^2.1|^3" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -1326,7 +1326,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.1" }, "funding": [ { @@ -1342,37 +1342,38 @@ "type": "tidelift" } ], - "time": "2021-11-04T16:48:04+00:00" + "time": "2022-03-13T20:07:29+00:00" }, { "name": "symfony/string", - "version": "v6.0.3", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "522144f0c4c004c80d56fa47e40e17028e2eefc2" + "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/522144f0c4c004c80d56fa47e40e17028e2eefc2", - "reference": "522144f0c4c004c80d56fa47e40e17028e2eefc2", + "url": "https://api.github.com/repos/symfony/string/zipball/92043b7d8383e48104e411bc9434b260dbeb5a10", + "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": ">=3.0" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0|^6.0" }, "type": "library", "autoload": { @@ -1411,7 +1412,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.0.3" + "source": "https://github.com/symfony/string/tree/v5.4.3" }, "funding": [ { @@ -1427,20 +1428,20 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:55:41+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "twig/twig", - "version": "v3.3.8", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "972d8604a92b7054828b539f2febb0211dd5945c" + "reference": "8442df056c51b706793adf80a9fd363406dd3674" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/972d8604a92b7054828b539f2febb0211dd5945c", - "reference": "972d8604a92b7054828b539f2febb0211dd5945c", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/8442df056c51b706793adf80a9fd363406dd3674", + "reference": "8442df056c51b706793adf80a9fd363406dd3674", "shasum": "" }, "require": { @@ -1491,7 +1492,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.3.8" + "source": "https://github.com/twigphp/Twig/tree/v3.3.10" }, "funding": [ { @@ -1503,20 +1504,20 @@ "type": "tidelift" } ], - "time": "2022-02-04T06:59:48+00:00" + "time": "2022-04-06T06:47:41+00:00" }, { "name": "voku/anti-xss", - "version": "4.1.37", + "version": "4.1.39", "source": { "type": "git", "url": "https://github.com/voku/anti-xss.git", - "reference": "728e158427a263917f33b0a29eb75d866bd18d17" + "reference": "64a59ba4744e6722866ff3440d93561da9e85cd0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/anti-xss/zipball/728e158427a263917f33b0a29eb75d866bd18d17", - "reference": "728e158427a263917f33b0a29eb75d866bd18d17", + "url": "https://api.github.com/repos/voku/anti-xss/zipball/64a59ba4744e6722866ff3440d93561da9e85cd0", + "reference": "64a59ba4744e6722866ff3440d93561da9e85cd0", "shasum": "" }, "require": { @@ -1562,7 +1563,7 @@ ], "support": { "issues": "https://github.com/voku/anti-xss/issues", - "source": "https://github.com/voku/anti-xss/tree/4.1.37" + "source": "https://github.com/voku/anti-xss/tree/4.1.39" }, "funding": [ { @@ -1586,20 +1587,20 @@ "type": "tidelift" } ], - "time": "2022-02-15T01:57:51+00:00" + "time": "2022-03-08T17:03:58+00:00" }, { "name": "voku/portable-ascii", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/voku/portable-ascii.git", - "reference": "9bd89e83cecdf8c37b64909454249eaed98b2c89" + "reference": "b56450eed252f6801410d810c8e1727224ae0743" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/portable-ascii/zipball/9bd89e83cecdf8c37b64909454249eaed98b2c89", - "reference": "9bd89e83cecdf8c37b64909454249eaed98b2c89", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b56450eed252f6801410d810c8e1727224ae0743", + "reference": "b56450eed252f6801410d810c8e1727224ae0743", "shasum": "" }, "require": { @@ -1636,7 +1637,7 @@ ], "support": { "issues": "https://github.com/voku/portable-ascii/issues", - "source": "https://github.com/voku/portable-ascii/tree/2.0.0" + "source": "https://github.com/voku/portable-ascii/tree/2.0.1" }, "funding": [ { @@ -1660,20 +1661,20 @@ "type": "tidelift" } ], - "time": "2022-01-24T18:59:03+00:00" + "time": "2022-03-08T17:03:00+00:00" }, { "name": "voku/portable-utf8", - "version": "6.0.3", + "version": "6.0.4", "source": { "type": "git", "url": "https://github.com/voku/portable-utf8.git", - "reference": "82a714b5a4973974c1113e97b11c1044a8b8cb85" + "reference": "f6c78e492520115bb2d947c3a0d90a2c6b7a60a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/portable-utf8/zipball/82a714b5a4973974c1113e97b11c1044a8b8cb85", - "reference": "82a714b5a4973974c1113e97b11c1044a8b8cb85", + "url": "https://api.github.com/repos/voku/portable-utf8/zipball/f6c78e492520115bb2d947c3a0d90a2c6b7a60a8", + "reference": "f6c78e492520115bb2d947c3a0d90a2c6b7a60a8", "shasum": "" }, "require": { @@ -1735,7 +1736,7 @@ ], "support": { "issues": "https://github.com/voku/portable-utf8/issues", - "source": "https://github.com/voku/portable-utf8/tree/6.0.3" + "source": "https://github.com/voku/portable-utf8/tree/6.0.4" }, "funding": [ { @@ -1759,36 +1760,36 @@ "type": "tidelift" } ], - "time": "2022-01-30T05:20:24+00:00" + "time": "2022-03-08T17:04:59+00:00" } ], "packages-dev": [ { "name": "composer/pcre", - "version": "1.0.1", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" + "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "url": "https://api.github.com/repos/composer/pcre/zipball/e300eb6c535192decd27a85bc72a9290f0d6b3bd", + "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "phpstan/phpstan": "^1.3", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5" + "symfony/phpunit-bridge": "^5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { @@ -1816,7 +1817,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/1.0.1" + "source": "https://github.com/composer/pcre/tree/3.0.0" }, "funding": [ { @@ -1832,31 +1833,31 @@ "type": "tidelift" } ], - "time": "2022-01-21T20:24:37+00:00" + "time": "2022-02-25T20:21:48+00:00" }, { "name": "composer/xdebug-handler", - "version": "2.0.4", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a" + "reference": "ced299686f41dce890debac69273b47ffe98a40c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", - "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", "shasum": "" }, "require": { - "composer/pcre": "^1", - "php": "^5.3.2 || ^7.0 || ^8.0", + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", "psr/log": "^1 || ^2 || ^3" }, "require-dev": { "phpstan/phpstan": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" + "symfony/phpunit-bridge": "^6.0" }, "type": "library", "autoload": { @@ -1882,7 +1883,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.4" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" }, "funding": [ { @@ -1898,33 +1899,34 @@ "type": "tidelift" } ], - "time": "2022-01-04T17:06:45+00:00" + "time": "2022-02-25T21:32:43+00:00" }, { "name": "doctrine/instantiator", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^8.0", + "doctrine/coding-standard": "^9", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.22" }, "type": "library", "autoload": { @@ -1951,7 +1953,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + "source": "https://github.com/doctrine/instantiator/tree/1.4.1" }, "funding": [ { @@ -1967,32 +1969,33 @@ "type": "tidelift" } ], - "time": "2020-11-10T18:47:58+00:00" + "time": "2022-03-03T08:28:38+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.10.2", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, - "replace": { - "myclabs/deep-copy": "self.version" + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", "autoload": { @@ -2017,7 +2020,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" }, "funding": [ { @@ -2025,7 +2028,7 @@ "type": "tidelift" } ], - "time": "2020-11-13T09:40:50+00:00" + "time": "2022-03-03T13:19:32+00:00" }, { "name": "nikic/php-parser", @@ -2085,23 +2088,23 @@ }, { "name": "pdepend/pdepend", - "version": "2.10.2", + "version": "2.10.3", "source": { "type": "git", "url": "https://github.com/pdepend/pdepend.git", - "reference": "c8c1d2af43fb8c2b5387d50e9c42a9c56de13686" + "reference": "da3166a06b4a89915920a42444f707122a1584c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pdepend/pdepend/zipball/c8c1d2af43fb8c2b5387d50e9c42a9c56de13686", - "reference": "c8c1d2af43fb8c2b5387d50e9c42a9c56de13686", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/da3166a06b4a89915920a42444f707122a1584c9", + "reference": "da3166a06b4a89915920a42444f707122a1584c9", "shasum": "" }, "require": { "php": ">=5.3.7", - "symfony/config": "^2.3.0|^3|^4|^5", - "symfony/dependency-injection": "^2.3.0|^3|^4|^5", - "symfony/filesystem": "^2.3.0|^3|^4|^5" + "symfony/config": "^2.3.0|^3|^4|^5|^6.0", + "symfony/dependency-injection": "^2.3.0|^3|^4|^5|^6.0", + "symfony/filesystem": "^2.3.0|^3|^4|^5|^6.0" }, "require-dev": { "easy-doc/easy-doc": "0.0.0|^1.2.3", @@ -2130,7 +2133,7 @@ "description": "Official version of pdepend to be handled with Composer", "support": { "issues": "https://github.com/pdepend/pdepend/issues", - "source": "https://github.com/pdepend/pdepend/tree/2.10.2" + "source": "https://github.com/pdepend/pdepend/tree/2.10.3" }, "funding": [ { @@ -2138,7 +2141,7 @@ "type": "tidelift" } ], - "time": "2021-11-16T20:05:32+00:00" + "time": "2022-02-23T07:53:09+00:00" }, { "name": "phar-io/manifest", @@ -2202,16 +2205,16 @@ }, { "name": "phar-io/version", - "version": "3.1.1", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "15a90844ad40f127afd244c0cad228de2a80052a" + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/15a90844ad40f127afd244c0cad228de2a80052a", - "reference": "15a90844ad40f127afd244c0cad228de2a80052a", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { @@ -2247,9 +2250,9 @@ "description": "Library for handling version information and constraints", "support": { "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.1.1" + "source": "https://github.com/phar-io/version/tree/3.2.1" }, - "time": "2022-02-07T21:56:48+00:00" + "time": "2022-02-21T01:04:05+00:00" }, { "name": "phpcompatibility/php-compatibility", @@ -2425,16 +2428,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.6.0", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706" + "reference": "77a32518733312af16a44300404e945338981de3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706", - "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", + "reference": "77a32518733312af16a44300404e945338981de3", "shasum": "" }, "require": { @@ -2469,9 +2472,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" }, - "time": "2022-01-04T19:58:01+00:00" + "time": "2022-03-15T21:29:03+00:00" }, { "name": "phploc/phploc", @@ -2536,22 +2539,22 @@ }, { "name": "phpmd/phpmd", - "version": "2.11.1", + "version": "2.12.0", "source": { "type": "git", "url": "https://github.com/phpmd/phpmd.git", - "reference": "08b60a2eb7e14c23f46ff8865b510ae08b75d0fd" + "reference": "c0b678ba71902f539c27c14332aa0ddcf14388ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmd/phpmd/zipball/08b60a2eb7e14c23f46ff8865b510ae08b75d0fd", - "reference": "08b60a2eb7e14c23f46ff8865b510ae08b75d0fd", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/c0b678ba71902f539c27c14332aa0ddcf14388ec", + "reference": "c0b678ba71902f539c27c14332aa0ddcf14388ec", "shasum": "" }, "require": { - "composer/xdebug-handler": "^1.0 || ^2.0", + "composer/xdebug-handler": "^1.0 || ^2.0 || ^3.0", "ext-xml": "*", - "pdepend/pdepend": "^2.10.2", + "pdepend/pdepend": "^2.10.3", "php": ">=5.3.9" }, "require-dev": { @@ -2607,7 +2610,7 @@ "support": { "irc": "irc://irc.freenode.org/phpmd", "issues": "https://github.com/phpmd/phpmd/issues", - "source": "https://github.com/phpmd/phpmd/tree/2.11.1" + "source": "https://github.com/phpmd/phpmd/tree/2.12.0" }, "funding": [ { @@ -2615,7 +2618,7 @@ "type": "tidelift" } ], - "time": "2021-12-17T11:25:43+00:00" + "time": "2022-03-24T13:33:01+00:00" }, { "name": "phpspec/prophecy", @@ -2686,16 +2689,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.10", + "version": "9.2.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687" + "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d5850aaf931743067f4bfc1ae4cbd06468400687", - "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", "shasum": "" }, "require": { @@ -2751,7 +2754,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.10" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" }, "funding": [ { @@ -2759,7 +2762,7 @@ "type": "github" } ], - "time": "2021-12-05T09:12:13+00:00" + "time": "2022-03-07T09:28:20+00:00" }, { "name": "phpunit/php-file-iterator", @@ -3004,16 +3007,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.13", + "version": "9.5.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "597cb647654ede35e43b137926dfdfef0fb11743" + "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/597cb647654ede35e43b137926dfdfef0fb11743", - "reference": "597cb647654ede35e43b137926dfdfef0fb11743", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/12bc8879fb65aef2138b26fc633cb1e3620cffba", + "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba", "shasum": "" }, "require": { @@ -3029,7 +3032,7 @@ "phar-io/version": "^3.0.2", "php": ">=7.3", "phpspec/prophecy": "^1.12.1", - "phpunit/php-code-coverage": "^9.2.7", + "phpunit/php-code-coverage": "^9.2.13", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.3", @@ -3043,7 +3046,7 @@ "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^2.3.4", + "sebastian/type": "^3.0", "sebastian/version": "^3.0.2" }, "require-dev": { @@ -3091,7 +3094,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.13" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.20" }, "funding": [ { @@ -3103,7 +3106,7 @@ "type": "github" } ], - "time": "2022-01-24T07:33:35+00:00" + "time": "2022-04-01T12:37:26+00:00" }, { "name": "sebastian/cli-parser", @@ -3471,16 +3474,16 @@ }, { "name": "sebastian/environment", - "version": "5.1.3", + "version": "5.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", "shasum": "" }, "require": { @@ -3522,7 +3525,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" }, "funding": [ { @@ -3530,7 +3533,7 @@ "type": "github" } ], - "time": "2020-09-28T05:52:38+00:00" + "time": "2022-04-03T09:37:03+00:00" }, { "name": "sebastian/exporter", @@ -4023,28 +4026,28 @@ }, { "name": "sebastian/type", - "version": "2.3.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", - "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", + "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -4067,7 +4070,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + "source": "https://github.com/sebastianbergmann/type/tree/3.0.0" }, "funding": [ { @@ -4075,7 +4078,7 @@ "type": "github" } ], - "time": "2021-06-15T12:49:02+00:00" + "time": "2022-03-15T09:54:48+00:00" }, { "name": "sebastian/version", @@ -4188,16 +4191,16 @@ }, { "name": "symfony/config", - "version": "v5.4.3", + "version": "v5.4.7", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "d65e1bd990c740e31feb07d2b0927b8d4df9956f" + "reference": "05624c386afa1b4ccc1357463d830fade8d9d404" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/d65e1bd990c740e31feb07d2b0927b8d4df9956f", - "reference": "d65e1bd990c740e31feb07d2b0927b8d4df9956f", + "url": "https://api.github.com/repos/symfony/config/zipball/05624c386afa1b4ccc1357463d830fade8d9d404", + "reference": "05624c386afa1b4ccc1357463d830fade8d9d404", "shasum": "" }, "require": { @@ -4247,7 +4250,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v5.4.3" + "source": "https://github.com/symfony/config/tree/v5.4.7" }, "funding": [ { @@ -4263,20 +4266,20 @@ "type": "tidelift" } ], - "time": "2022-01-03T09:50:52+00:00" + "time": "2022-03-21T13:42:03+00:00" }, { "name": "symfony/dependency-injection", - "version": "v5.4.3", + "version": "v5.4.7", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "974580fd67f14d65b045c11b09eb149cd4b13df5" + "reference": "35588b2afb08ea3a142d62fefdcad4cb09be06ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/974580fd67f14d65b045c11b09eb149cd4b13df5", - "reference": "974580fd67f14d65b045c11b09eb149cd4b13df5", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/35588b2afb08ea3a142d62fefdcad4cb09be06ed", + "reference": "35588b2afb08ea3a142d62fefdcad4cb09be06ed", "shasum": "" }, "require": { @@ -4292,7 +4295,7 @@ "symfony/config": "<5.3", "symfony/finder": "<4.4", "symfony/proxy-manager-bridge": "<4.4", - "symfony/yaml": "<4.4" + "symfony/yaml": "<4.4.26" }, "provide": { "psr/container-implementation": "1.0", @@ -4301,7 +4304,7 @@ "require-dev": { "symfony/config": "^5.3|^6.0", "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/yaml": "^4.4|^5.0|^6.0" + "symfony/yaml": "^4.4.26|^5.0|^6.0" }, "suggest": { "symfony/config": "", @@ -4336,7 +4339,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v5.4.3" + "source": "https://github.com/symfony/dependency-injection/tree/v5.4.7" }, "funding": [ { @@ -4352,20 +4355,20 @@ "type": "tidelift" } ], - "time": "2022-01-26T16:28:35+00:00" + "time": "2022-03-08T15:43:06+00:00" }, { "name": "symfony/filesystem", - "version": "v5.4.3", + "version": "v5.4.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "0f0c4bf1840420f4aef3f32044a9dbb24682731b" + "reference": "3a4442138d80c9f7b600fb297534ac718b61d37f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/0f0c4bf1840420f4aef3f32044a9dbb24682731b", - "reference": "0f0c4bf1840420f4aef3f32044a9dbb24682731b", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/3a4442138d80c9f7b600fb297534ac718b61d37f", + "reference": "3a4442138d80c9f7b600fb297534ac718b61d37f", "shasum": "" }, "require": { @@ -4400,7 +4403,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.3" + "source": "https://github.com/symfony/filesystem/tree/v5.4.7" }, "funding": [ { @@ -4416,11 +4419,11 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-04-01T12:33:59+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", @@ -4479,7 +4482,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0" }, "funding": [ { @@ -4630,5 +4633,5 @@ "platform-dev": { "ext-pcntl": "*" }, - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" }