From 85319f27af81ef6e11641b6cb481c59ed2b78c24 Mon Sep 17 00:00:00 2001 From: Luca Date: Fri, 23 Sep 2022 14:55:00 +0200 Subject: [PATCH 1/3] Aggiunte cartelle e file da escludere dal backup --- src/Backup.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Backup.php b/src/Backup.php index f9579d044..f58226e0f 100755 --- a/src/Backup.php +++ b/src/Backup.php @@ -164,11 +164,15 @@ class Backup $ignores = [ 'files' => [ 'config.inc.php', + '*.lock', + '*.phar', + '*.log', ], 'dirs' => [ 'node_modules', 'tests', 'tmp', + '.git', ], ]; From eb83eba45c920e52527530d5738eaa633e2d8cd3 Mon Sep 17 00:00:00 2001 From: Luca Date: Fri, 23 Sep 2022 16:25:00 +0200 Subject: [PATCH 2/3] Aggiunto confronto con secondo checksum del db per la versione 5.7.x di mysql attualmente supportata --- .gitignore | 1 + gulpfile.js | 1 + modules/aggiornamenti/database.php | 13 +++++++++---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index cecf1ee56..9671f94d7 100755 --- a/.gitignore +++ b/.gitignore @@ -92,6 +92,7 @@ REVISION manifest.json checksum.json database.json +database_5_7.json /tests/_log/* /tests/_temp/* diff --git a/gulpfile.js b/gulpfile.js index 4b8ab7eeb..0809c04e5 100755 --- a/gulpfile.js +++ b/gulpfile.js @@ -407,6 +407,7 @@ function release(done) { '**/*', '!checksum.json', '!database.json', + '!database_5_7.json', '!.idea/**', '!.git/**', '!node_modules/**', diff --git a/modules/aggiornamenti/database.php b/modules/aggiornamenti/database.php index 9f975a956..d54bcbbd6 100644 --- a/modules/aggiornamenti/database.php +++ b/modules/aggiornamenti/database.php @@ -72,14 +72,18 @@ $(document).ready(function () { return; } -$contents = file_get_contents(base_dir().'/database.json'); +$mysql_min_version = '5.7.0'; +$mysql_max_version = '5.7.99'; + +$contents = ((version_compare($database->getMySQLVersion(), $mysql_min_version, ">=") && version_compare($database->getMySQLVersion(), $mysql_max_version, "<=")) ? $file_to_check_database = 'database_5_7.json' : $file_to_check_database = 'database.json' ); +$contents = file_get_contents(base_dir().'/'.$file_to_check_database); $data = json_decode($contents, true); if (empty($data)) { echo '
'.tr('Impossibile effettuare controlli di integrità in assenza del file _FILE_', [ - '_FILE_' => 'database.json', + '_FILE_' => ''.$file_to_check_database.'', ]).'.
'; @@ -96,8 +100,9 @@ if (!empty($results)) {

'.tr("Segue l'elenco delle tabelle del database che presentano una struttura diversa rispetto a quella prevista nella versione ufficiale del gestionale").'.

- '.tr('Attenzione: questa funzionalità può presentare dei risultati falsamente positivi, sulla base del contenuto del file _FILE_', [ - '_FILE_' => 'database.json', + '.tr('Attenzione: questa funzionalità può presentare dei risultati falsamente positivi, sulla base del contenuto del file _FILE_ e la versione di _MYSQL_VERSION_ di MySQL rilevata a sistema', [ + '_FILE_' => ''.$file_to_check_database.'', + '_MYSQL_VERSION_' => ''.$database->getMySQLVersion().'', ]).'.
'; From 2678a7db87b5ccb84d98456039079071482709cb Mon Sep 17 00:00:00 2001 From: Luca Date: Fri, 23 Sep 2022 16:50:56 +0200 Subject: [PATCH 3/3] Fix controllo impostazione Attiva aggiornamenti --- modules/aggiornamenti/actions.php | 6 +++++- modules/aggiornamenti/edit.php | 29 +++++++++++++++++++---------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/modules/aggiornamenti/actions.php b/modules/aggiornamenti/actions.php index b8a872537..6424cbf1c 100755 --- a/modules/aggiornamenti/actions.php +++ b/modules/aggiornamenti/actions.php @@ -44,7 +44,11 @@ switch (filter('op')) { break; case 'upload': - include base_dir().'/modules/aggiornamenti/upload_modules.php'; + if (setting('Attiva aggiornamenti')){ + include base_dir().'/modules/aggiornamenti/upload_modules.php'; + }else{ + flash()->error(tr('Non è permesso il caricamento di aggiornamenti o moduli!')); + } break; diff --git a/modules/aggiornamenti/edit.php b/modules/aggiornamenti/edit.php index 28225fde5..ae895e18b 100755 --- a/modules/aggiornamenti/edit.php +++ b/modules/aggiornamenti/edit.php @@ -92,7 +92,6 @@ if (!function_exists('base_dir')) { } // Aggiornamenti -if (setting('Attiva aggiornamenti')) { $alerts = []; if (!extension_loaded('zip')) { @@ -184,19 +183,22 @@ function search(button) { } -
+
'; + + +echo'

- '.tr('Carica un aggiornamento').' + '.tr('Carica aggiornamenti o nuovi moduli').'

- {[ "type": "file", "name": "blob", "required": 1, "accept": ".zip" ]} + {[ "type": "file", "name": "blob", "required": 1, "accept": ".zip", "disabled": '.(setting('Attiva aggiornamenti')? 0 : 1).' ]} '; @@ -218,12 +220,16 @@ echo ' + '; + +echo '
-
+
'; + +echo '
@@ -245,7 +251,9 @@ echo '
-
+
'; + +echo '
@@ -265,11 +273,12 @@ echo ' '; } - echo '
+echo '
- + '; + +echo ' '; -} // Requisiti echo '